// Generated by Futhark 0.22.0
// git: e8b7244 (Wed Jan 12 23:26:03 2022 +0100)

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

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

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

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

#ifdef __cplusplus
extern "C" {
#endif

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

// Arrays
struct futhark_f64_2d;
struct futhark_f64_2d *futhark_new_f64_2d(struct futhark_context *ctx, const
                                          double *data, int64_t dim0,
                                          int64_t dim1);
struct futhark_f64_2d *futhark_new_raw_f64_2d(struct futhark_context *ctx, const
                                              cl_mem data, int64_t offset,
                                              int64_t dim0, int64_t dim1);
int futhark_free_f64_2d(struct futhark_context *ctx,
                        struct futhark_f64_2d *arr);
int futhark_values_f64_2d(struct futhark_context *ctx,
                          struct futhark_f64_2d *arr, double *data);
cl_mem futhark_values_raw_f64_2d(struct futhark_context *ctx,
                                 struct futhark_f64_2d *arr);
const int64_t *futhark_shape_f64_2d(struct futhark_context *ctx,
                                    struct futhark_f64_2d *arr);

// Opaque values


// Entry points
int futhark_entry_main(struct futhark_context *ctx,
                       struct futhark_f64_2d **out0,
                       struct futhark_f64_2d **out1,
                       struct futhark_f64_2d **out2, const
                       struct futhark_f64_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, const int64_t in12, const int64_t in13,
                       const int64_t in14);

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

#ifdef __cplusplus
}
#endif

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

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

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

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

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

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

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

    va_list vl;
    va_start(vl, msg);

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

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

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

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

  return s;
}

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

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

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

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

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

  return 0;
}

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

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

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

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

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

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

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

#ifndef __OPENCL_VERSION__
#define __constant
#endif

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

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

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

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

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

  return hbits;
}

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

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

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

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

#ifdef _WIN32

#include <windows.h>

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

#else
// Assuming POSIX

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

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

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

#endif

// End of timing.h.

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


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


// Start of lock.h.

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

#ifdef _WIN32

typedef HANDLE lock_t;

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

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

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

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

#else
// Assuming POSIX

#include <pthread.h>

typedef pthread_mutex_t lock_t;

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

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

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

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

#endif

// End of lock.h.

#define FUTHARK_F64_ENABLED

// Start of scalar.h.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#elif defined(__CUDA_ARCH__)

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

  return aa * bb >> 8;
}

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

  return aa * bb >> 16;
}

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

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

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

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

  return aa * bb >> 8;
}

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

  return aa * bb >> 16;
}

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

  return aa * bb >> 32;
}

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

  return aa * bb >> 64;
}
#endif

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

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

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

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

#else // Not OpenCL

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

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

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

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

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

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

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

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

#elif defined(__CUDA_ARCH__)

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

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

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

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

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

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

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

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

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

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

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

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

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

#elif defined(__CUDA_ARCH__)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#ifdef FUTHARK_F64_ENABLED

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#endif

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

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

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

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

#ifdef EMULATE_F16

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

#else

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

typedef half f16;

#endif

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#ifndef EMULATE_F16

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

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

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

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

#else // Assuming CUDA.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#else // Assume CUDA.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#endif

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

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

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

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

#else // No native f16 - emulate.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#else

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

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

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

#endif

#endif

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

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

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

#ifdef FUTHARK_F64_ENABLED

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

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

#endif


// End of scalar_f16.h.

static int init_constants(struct futhark_context *);
static int free_constants(struct futhark_context *);
static int32_t mainzicounter_mem_realtype_237046[10240];
static int32_t mainzicounter_mem_realtype_237062[10240];
static int32_t mainzicounter_mem_realtype_237098[10240];
static int32_t mainzicounter_mem_realtype_237114[10240];
static int32_t mainzicounter_mem_realtype_237150[10240];
static int32_t mainzicounter_mem_realtype_237166[10240];
static int32_t mainzicounter_mem_realtype_237207[10240];
static int32_t mainzicounter_mem_realtype_237238[10240];
static int32_t mainzicounter_mem_realtype_237269[10240];
static int32_t mainzicounter_mem_realtype_237310[10240];
static int32_t mainzicounter_mem_realtype_237326[10240];
static int32_t mainzicounter_mem_realtype_237352[10240];
static int32_t mainzicounter_mem_realtype_237368[10240];
static int32_t mainzicounter_mem_realtype_237394[10240];
static int32_t mainzicounter_mem_realtype_237410[10240];
static int32_t mainzicounter_mem_realtype_237471[10240];
static int32_t mainzicounter_mem_realtype_237487[10240];
static int32_t mainzicounter_mem_realtype_237523[10240];
static int32_t mainzicounter_mem_realtype_237539[10240];
static int32_t mainzicounter_mem_realtype_237575[10240];
static int32_t mainzicounter_mem_realtype_237591[10240];
static int32_t mainzicounter_mem_realtype_237707[10240];
struct memblock_device {
    int *references;
    cl_mem mem;
    int64_t size;
    const char *desc;
};
struct memblock {
    int *references;
    unsigned char *mem;
    int64_t size;
    const char *desc;
};
typedef cl_mem fl_mem_t;
// Start of free_list.h.

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

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

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

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

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

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

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

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

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

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

  l->used++;
}

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

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

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

  return 1;
}

// End of free_list.h.

// Start of opencl.h.

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

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

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

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

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

  int default_group_size_changed;
  int default_tile_size_changed;

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

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

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

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

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

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

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

  struct opencl_config cfg;

  struct free_list free_list;

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

  size_t lockstep_width;

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

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

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

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

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

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

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

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

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

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

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

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

  info = (char*) malloc(req_bytes);

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

  return info;
}

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

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

  info = (char*) malloc(req_bytes);

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

  return info;
}

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

  cl_platform_id *all_platforms;
  cl_uint *platform_num_devices;

  cl_uint num_platforms;

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

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

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

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

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

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

    if (num_platform_devices == 0) {
      continue;
    }

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

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

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

  *devices_out = devices;
  *num_devices_out = num_devices;
}

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

  opencl_all_device_options(&devices, &num_devices);

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

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

  return 0;
}

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

  opencl_all_device_options(&devices, &num_devices);

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

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

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

  return ret;
}

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

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

  opencl_all_device_options(&devices, &num_devices);

  int num_device_matches = 0;

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

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

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

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

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

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

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

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

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

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

    free(build_log);
  }

  return build_status;
}

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

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

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

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

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

  ctx->device = device_option.device;

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

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

  size_t max_tile_size = sqrt(max_group_size);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    OPENCL_SUCCEED_FATAL(status);
    OPENCL_SUCCEED_FATAL(error);
  }

  int compile_opts_size = 1024;

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

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

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

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

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

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

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

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

  free(compile_opts);
  free(fut_opencl_src);

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

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

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

  return prog;
}

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

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

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

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

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

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

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

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

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

    cl_ulong start_t, end_t;

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

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

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

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

  ctx->profiling_records_used = 0;

  return CL_SUCCESS;
}

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

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

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

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

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

  return error;
}

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

  size_t size;

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

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

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

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

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

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

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

  return error;
}

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

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

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

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

  return error;
}

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

  return CL_SUCCESS;
}

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

// End of opencl.h.

static const char *opencl_program[] =
                  {"\n// Clang-based OpenCL implementations need this for 'static' to work.\n#ifdef cl_clang_storage_class_specifiers\n#pragma OPENCL EXTENSION cl_clang_storage_class_specifiers : enable\n#endif\n#pragma OPENCL EXTENSION cl_khr_byte_addressable_store : enable\n\n#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n#define FUTHARK_F64_ENABLED\n\n// Some OpenCL programs dislike empty progams, or programs with no kernels.\n// Declare a dummy kernel to ensure they remain our friends.\n__kernel void dummy_kernel(__global unsigned char *dummy, int n)\n{\n    const int thread_gid = get_global_id(0);\n    if (thread_gid >= n) return;\n}\n\n#pragma OPENCL EXTENSION cl_khr_int64_base_atomics : enable\n#pragma OPENCL EXTENSION cl_khr_int64_extended_atomics : enable\n\ntypedef char int8_t;\ntypedef short int16_t;\ntypedef int int32_t;\ntypedef long int64_t;\n\ntypedef uchar uint8_t;\ntypedef ushort uint16_t;\ntypedef uint uint32_t;\ntypedef ulong uint64_t;\n\n// NVIDIAs OpenCL does not create device-wide memory fences (see #734), so we\n// use inline assembly if we detect we are on an NVIDIA GPU.\n#ifdef cl_nv_pragma_unroll\nstatic inline void mem_fence_global() {\n  asm(\"membar.gl;\");\n}\n#else\nstatic inline void mem_fence_global() {\n  mem_fence(CLK_LOCAL_MEM_FENCE | CLK_GLOBAL_MEM_FENCE);\n}\n#endif\nstatic inline void mem_fence_local() {\n  mem_fence(CLK_LOCAL_MEM_FENCE);\n}\n// Start of half.h.\n\n// Conversion functions are from http://half.sourceforge.net/, but\n// translated to C.\n//\n// Copyright (c) 2012-2021 Christian Rau\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission noti",
                   "ce shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef __OPENCL_VERSION__\n#define __constant\n#endif\n\n__constant static const uint16_t base_table[512] = {\n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,\n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,\n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,\n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,\n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,\n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,\n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100,\n  0x0200, 0x0400, 0x0800, 0x0C00, 0x1000, 0x1400, 0x1800, 0x1C00, 0x2000, 0x2400, 0x2800, 0x2C00, 0x3000, 0x3400, 0x3800, 0x3C00,\n  0x4000, 0x4400, 0x4800, 0x4C00, 0x5000, 0x5400, 0x5800, 0x5C00, 0x6000, 0x6400, 0x6800, 0x6C00, 0x7000, 0x7400, 0x7800, 0x7C00,\n  0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00,\n  0x7C00, 0x7C00, 0x7C00, 0x",
                   "7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00,\n  0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00,\n  0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00,\n  0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00,\n  0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00,\n  0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00,\n  0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,\n  0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,\n  0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,\n  0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,\n  0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,\n  0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,\n  0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8001, 0x8002, 0x8004, 0x8008, 0x8010, 0x8020, 0x8040, 0x8080, 0x8100,\n  0x8200, 0x8400, 0x8800, 0x8C00, 0x9000, 0x9400, 0x9800, 0x9C00, 0xA000, 0xA400, 0xA800, 0xAC00, 0xB000, 0xB400, 0xB800, 0xBC00,\n  0xC000, 0xC400, 0xC800, 0xCC00, 0xD000, 0xD400, 0xD800, 0xDC00, 0xE000, 0xE400, 0xE800, 0xEC00, 0xF000, 0xF400, 0xF800, 0xFC00,\n  0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC",
                   "00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00,\n  0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00,\n  0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00,\n  0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00,\n  0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00,\n  0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00,\n  0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00 };\n\n__constant static const unsigned char shift_table[512] = {\n  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n  24, 24, 24, 24, 24, 24, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 13,\n  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, ",
                   "24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n  24, 24, 24, 24, 24, 24, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 13 };\n\n__constant static const uint32_t mantissa_table[2048] = {\n  0x00000000, 0x33800000, 0x34000000, 0x34400000, 0x34800000, 0x34A00000, 0x34C00000, 0x34E00000, 0x35000000, 0x35100000, 0x35200000, 0x35300000, 0x35400000, 0x35500000, 0x35600000, 0x35700000,\n  0x35800000, 0x35880000, 0x35900000, 0x35980000, 0x35A00000, 0x35A80000, 0x35B00000, 0x35B80000, 0x35C00000, 0x35C80000, 0x35D00000, 0x35D80000, 0x35E00000, 0x35E80000, 0x35F00000, 0x35F80000,\n  0x36000000, 0x36040000, 0x36080000, 0x360C0000, 0x36100000, 0x36140000, 0x36180000, 0x361C0000, 0x36200000, 0x36240000, 0x36280000, 0x362C0000, 0x36300000, 0x36340000, 0x36380000, 0x363C0000,\n  0x36400000, 0x36440000, 0x36480000, 0x364C0000, 0x36500000, 0x36540000, 0x36580000, 0x365C0000, 0x36600000, 0x36640000, 0x36680000, 0x366C0000, 0x36700000, 0x36740000, 0x36780000, 0x367C0000,\n  0x36800000, 0x36820000, 0x36840000, 0x36860000, 0x36880000, 0x368A0000, 0x368C0000, 0x368E0000, 0x36900000, 0x36920000, 0x36940000, 0x36960000, 0x36980000, 0x369A0000, 0x369C0000, 0x369E0",
                   "000,\n  0x36A00000, 0x36A20000, 0x36A40000, 0x36A60000, 0x36A80000, 0x36AA0000, 0x36AC0000, 0x36AE0000, 0x36B00000, 0x36B20000, 0x36B40000, 0x36B60000, 0x36B80000, 0x36BA0000, 0x36BC0000, 0x36BE0000,\n  0x36C00000, 0x36C20000, 0x36C40000, 0x36C60000, 0x36C80000, 0x36CA0000, 0x36CC0000, 0x36CE0000, 0x36D00000, 0x36D20000, 0x36D40000, 0x36D60000, 0x36D80000, 0x36DA0000, 0x36DC0000, 0x36DE0000,\n  0x36E00000, 0x36E20000, 0x36E40000, 0x36E60000, 0x36E80000, 0x36EA0000, 0x36EC0000, 0x36EE0000, 0x36F00000, 0x36F20000, 0x36F40000, 0x36F60000, 0x36F80000, 0x36FA0000, 0x36FC0000, 0x36FE0000,\n  0x37000000, 0x37010000, 0x37020000, 0x37030000, 0x37040000, 0x37050000, 0x37060000, 0x37070000, 0x37080000, 0x37090000, 0x370A0000, 0x370B0000, 0x370C0000, 0x370D0000, 0x370E0000, 0x370F0000,\n  0x37100000, 0x37110000, 0x37120000, 0x37130000, 0x37140000, 0x37150000, 0x37160000, 0x37170000, 0x37180000, 0x37190000, 0x371A0000, 0x371B0000, 0x371C0000, 0x371D0000, 0x371E0000, 0x371F0000,\n  0x37200000, 0x37210000, 0x37220000, 0x37230000, 0x37240000, 0x37250000, 0x37260000, 0x37270000, 0x37280000, 0x37290000, 0x372A0000, 0x372B0000, 0x372C0000, 0x372D0000, 0x372E0000, 0x372F0000,\n  0x37300000, 0x37310000, 0x37320000, 0x37330000, 0x37340000, 0x37350000, 0x37360000, 0x37370000, 0x37380000, 0x37390000, 0x373A0000, 0x373B0000, 0x373C0000, 0x373D0000, 0x373E0000, 0x373F0000,\n  0x37400000, 0x37410000, 0x37420000, 0x37430000, 0x37440000, 0x37450000, 0x37460000, 0x37470000, 0x37480000, 0x37490000, 0x374A0000, 0x374B0000, 0x374C0000, 0x374D0000, 0x374E0000, 0x374F0000,\n  0x37500000, 0x37510000, 0x37520000, 0x37530000, 0x37540000, 0x37550000, 0x37560000, 0x37570000, 0x37580000, 0x37590000, 0x375A0000, 0x375B0000, 0x375C0000, 0x375D0000, 0x375E0000, 0x375F0000,\n  0x37600000, 0x37610000, 0x37620000, 0x37630000, 0x37640000, 0x37650000, 0x37660000, 0x37670000, 0x37680000, 0x37690000, 0x376A0000, 0x376B0000, 0x376C0000, 0x376D0000, 0x376E0000, 0x376F0000,\n  0x37700000, 0x37710000, 0x37720000, 0x37730000, 0x377",
                   "40000, 0x37750000, 0x37760000, 0x37770000, 0x37780000, 0x37790000, 0x377A0000, 0x377B0000, 0x377C0000, 0x377D0000, 0x377E0000, 0x377F0000,\n  0x37800000, 0x37808000, 0x37810000, 0x37818000, 0x37820000, 0x37828000, 0x37830000, 0x37838000, 0x37840000, 0x37848000, 0x37850000, 0x37858000, 0x37860000, 0x37868000, 0x37870000, 0x37878000,\n  0x37880000, 0x37888000, 0x37890000, 0x37898000, 0x378A0000, 0x378A8000, 0x378B0000, 0x378B8000, 0x378C0000, 0x378C8000, 0x378D0000, 0x378D8000, 0x378E0000, 0x378E8000, 0x378F0000, 0x378F8000,\n  0x37900000, 0x37908000, 0x37910000, 0x37918000, 0x37920000, 0x37928000, 0x37930000, 0x37938000, 0x37940000, 0x37948000, 0x37950000, 0x37958000, 0x37960000, 0x37968000, 0x37970000, 0x37978000,\n  0x37980000, 0x37988000, 0x37990000, 0x37998000, 0x379A0000, 0x379A8000, 0x379B0000, 0x379B8000, 0x379C0000, 0x379C8000, 0x379D0000, 0x379D8000, 0x379E0000, 0x379E8000, 0x379F0000, 0x379F8000,\n  0x37A00000, 0x37A08000, 0x37A10000, 0x37A18000, 0x37A20000, 0x37A28000, 0x37A30000, 0x37A38000, 0x37A40000, 0x37A48000, 0x37A50000, 0x37A58000, 0x37A60000, 0x37A68000, 0x37A70000, 0x37A78000,\n  0x37A80000, 0x37A88000, 0x37A90000, 0x37A98000, 0x37AA0000, 0x37AA8000, 0x37AB0000, 0x37AB8000, 0x37AC0000, 0x37AC8000, 0x37AD0000, 0x37AD8000, 0x37AE0000, 0x37AE8000, 0x37AF0000, 0x37AF8000,\n  0x37B00000, 0x37B08000, 0x37B10000, 0x37B18000, 0x37B20000, 0x37B28000, 0x37B30000, 0x37B38000, 0x37B40000, 0x37B48000, 0x37B50000, 0x37B58000, 0x37B60000, 0x37B68000, 0x37B70000, 0x37B78000,\n  0x37B80000, 0x37B88000, 0x37B90000, 0x37B98000, 0x37BA0000, 0x37BA8000, 0x37BB0000, 0x37BB8000, 0x37BC0000, 0x37BC8000, 0x37BD0000, 0x37BD8000, 0x37BE0000, 0x37BE8000, 0x37BF0000, 0x37BF8000,\n  0x37C00000, 0x37C08000, 0x37C10000, 0x37C18000, 0x37C20000, 0x37C28000, 0x37C30000, 0x37C38000, 0x37C40000, 0x37C48000, 0x37C50000, 0x37C58000, 0x37C60000, 0x37C68000, 0x37C70000, 0x37C78000,\n  0x37C80000, 0x37C88000, 0x37C90000, 0x37C98000, 0x37CA0000, 0x37CA8000, 0x37CB0000, 0x37CB8000, 0x37CC0000, 0x37C",
                   "C8000, 0x37CD0000, 0x37CD8000, 0x37CE0000, 0x37CE8000, 0x37CF0000, 0x37CF8000,\n  0x37D00000, 0x37D08000, 0x37D10000, 0x37D18000, 0x37D20000, 0x37D28000, 0x37D30000, 0x37D38000, 0x37D40000, 0x37D48000, 0x37D50000, 0x37D58000, 0x37D60000, 0x37D68000, 0x37D70000, 0x37D78000,\n  0x37D80000, 0x37D88000, 0x37D90000, 0x37D98000, 0x37DA0000, 0x37DA8000, 0x37DB0000, 0x37DB8000, 0x37DC0000, 0x37DC8000, 0x37DD0000, 0x37DD8000, 0x37DE0000, 0x37DE8000, 0x37DF0000, 0x37DF8000,\n  0x37E00000, 0x37E08000, 0x37E10000, 0x37E18000, 0x37E20000, 0x37E28000, 0x37E30000, 0x37E38000, 0x37E40000, 0x37E48000, 0x37E50000, 0x37E58000, 0x37E60000, 0x37E68000, 0x37E70000, 0x37E78000,\n  0x37E80000, 0x37E88000, 0x37E90000, 0x37E98000, 0x37EA0000, 0x37EA8000, 0x37EB0000, 0x37EB8000, 0x37EC0000, 0x37EC8000, 0x37ED0000, 0x37ED8000, 0x37EE0000, 0x37EE8000, 0x37EF0000, 0x37EF8000,\n  0x37F00000, 0x37F08000, 0x37F10000, 0x37F18000, 0x37F20000, 0x37F28000, 0x37F30000, 0x37F38000, 0x37F40000, 0x37F48000, 0x37F50000, 0x37F58000, 0x37F60000, 0x37F68000, 0x37F70000, 0x37F78000,\n  0x37F80000, 0x37F88000, 0x37F90000, 0x37F98000, 0x37FA0000, 0x37FA8000, 0x37FB0000, 0x37FB8000, 0x37FC0000, 0x37FC8000, 0x37FD0000, 0x37FD8000, 0x37FE0000, 0x37FE8000, 0x37FF0000, 0x37FF8000,\n  0x38000000, 0x38004000, 0x38008000, 0x3800C000, 0x38010000, 0x38014000, 0x38018000, 0x3801C000, 0x38020000, 0x38024000, 0x38028000, 0x3802C000, 0x38030000, 0x38034000, 0x38038000, 0x3803C000,\n  0x38040000, 0x38044000, 0x38048000, 0x3804C000, 0x38050000, 0x38054000, 0x38058000, 0x3805C000, 0x38060000, 0x38064000, 0x38068000, 0x3806C000, 0x38070000, 0x38074000, 0x38078000, 0x3807C000,\n  0x38080000, 0x38084000, 0x38088000, 0x3808C000, 0x38090000, 0x38094000, 0x38098000, 0x3809C000, 0x380A0000, 0x380A4000, 0x380A8000, 0x380AC000, 0x380B0000, 0x380B4000, 0x380B8000, 0x380BC000,\n  0x380C0000, 0x380C4000, 0x380C8000, 0x380CC000, 0x380D0000, 0x380D4000, 0x380D8000, 0x380DC000, 0x380E0000, 0x380E4000, 0x380E8000, 0x380EC000, 0x380F0000, 0x380F4000, 0x380",
                   "F8000, 0x380FC000,\n  0x38100000, 0x38104000, 0x38108000, 0x3810C000, 0x38110000, 0x38114000, 0x38118000, 0x3811C000, 0x38120000, 0x38124000, 0x38128000, 0x3812C000, 0x38130000, 0x38134000, 0x38138000, 0x3813C000,\n  0x38140000, 0x38144000, 0x38148000, 0x3814C000, 0x38150000, 0x38154000, 0x38158000, 0x3815C000, 0x38160000, 0x38164000, 0x38168000, 0x3816C000, 0x38170000, 0x38174000, 0x38178000, 0x3817C000,\n  0x38180000, 0x38184000, 0x38188000, 0x3818C000, 0x38190000, 0x38194000, 0x38198000, 0x3819C000, 0x381A0000, 0x381A4000, 0x381A8000, 0x381AC000, 0x381B0000, 0x381B4000, 0x381B8000, 0x381BC000,\n  0x381C0000, 0x381C4000, 0x381C8000, 0x381CC000, 0x381D0000, 0x381D4000, 0x381D8000, 0x381DC000, 0x381E0000, 0x381E4000, 0x381E8000, 0x381EC000, 0x381F0000, 0x381F4000, 0x381F8000, 0x381FC000,\n  0x38200000, 0x38204000, 0x38208000, 0x3820C000, 0x38210000, 0x38214000, 0x38218000, 0x3821C000, 0x38220000, 0x38224000, 0x38228000, 0x3822C000, 0x38230000, 0x38234000, 0x38238000, 0x3823C000,\n  0x38240000, 0x38244000, 0x38248000, 0x3824C000, 0x38250000, 0x38254000, 0x38258000, 0x3825C000, 0x38260000, 0x38264000, 0x38268000, 0x3826C000, 0x38270000, 0x38274000, 0x38278000, 0x3827C000,\n  0x38280000, 0x38284000, 0x38288000, 0x3828C000, 0x38290000, 0x38294000, 0x38298000, 0x3829C000, 0x382A0000, 0x382A4000, 0x382A8000, 0x382AC000, 0x382B0000, 0x382B4000, 0x382B8000, 0x382BC000,\n  0x382C0000, 0x382C4000, 0x382C8000, 0x382CC000, 0x382D0000, 0x382D4000, 0x382D8000, 0x382DC000, 0x382E0000, 0x382E4000, 0x382E8000, 0x382EC000, 0x382F0000, 0x382F4000, 0x382F8000, 0x382FC000,\n  0x38300000, 0x38304000, 0x38308000, 0x3830C000, 0x38310000, 0x38314000, 0x38318000, 0x3831C000, 0x38320000, 0x38324000, 0x38328000, 0x3832C000, 0x38330000, 0x38334000, 0x38338000, 0x3833C000,\n  0x38340000, 0x38344000, 0x38348000, 0x3834C000, 0x38350000, 0x38354000, 0x38358000, 0x3835C000, 0x38360000, 0x38364000, 0x38368000, 0x3836C000, 0x38370000, 0x38374000, 0x38378000, 0x3837C000,\n  0x38380000, 0x38384000, 0x38388000, 0x3",
                   "838C000, 0x38390000, 0x38394000, 0x38398000, 0x3839C000, 0x383A0000, 0x383A4000, 0x383A8000, 0x383AC000, 0x383B0000, 0x383B4000, 0x383B8000, 0x383BC000,\n  0x383C0000, 0x383C4000, 0x383C8000, 0x383CC000, 0x383D0000, 0x383D4000, 0x383D8000, 0x383DC000, 0x383E0000, 0x383E4000, 0x383E8000, 0x383EC000, 0x383F0000, 0x383F4000, 0x383F8000, 0x383FC000,\n  0x38400000, 0x38404000, 0x38408000, 0x3840C000, 0x38410000, 0x38414000, 0x38418000, 0x3841C000, 0x38420000, 0x38424000, 0x38428000, 0x3842C000, 0x38430000, 0x38434000, 0x38438000, 0x3843C000,\n  0x38440000, 0x38444000, 0x38448000, 0x3844C000, 0x38450000, 0x38454000, 0x38458000, 0x3845C000, 0x38460000, 0x38464000, 0x38468000, 0x3846C000, 0x38470000, 0x38474000, 0x38478000, 0x3847C000,\n  0x38480000, 0x38484000, 0x38488000, 0x3848C000, 0x38490000, 0x38494000, 0x38498000, 0x3849C000, 0x384A0000, 0x384A4000, 0x384A8000, 0x384AC000, 0x384B0000, 0x384B4000, 0x384B8000, 0x384BC000,\n  0x384C0000, 0x384C4000, 0x384C8000, 0x384CC000, 0x384D0000, 0x384D4000, 0x384D8000, 0x384DC000, 0x384E0000, 0x384E4000, 0x384E8000, 0x384EC000, 0x384F0000, 0x384F4000, 0x384F8000, 0x384FC000,\n  0x38500000, 0x38504000, 0x38508000, 0x3850C000, 0x38510000, 0x38514000, 0x38518000, 0x3851C000, 0x38520000, 0x38524000, 0x38528000, 0x3852C000, 0x38530000, 0x38534000, 0x38538000, 0x3853C000,\n  0x38540000, 0x38544000, 0x38548000, 0x3854C000, 0x38550000, 0x38554000, 0x38558000, 0x3855C000, 0x38560000, 0x38564000, 0x38568000, 0x3856C000, 0x38570000, 0x38574000, 0x38578000, 0x3857C000,\n  0x38580000, 0x38584000, 0x38588000, 0x3858C000, 0x38590000, 0x38594000, 0x38598000, 0x3859C000, 0x385A0000, 0x385A4000, 0x385A8000, 0x385AC000, 0x385B0000, 0x385B4000, 0x385B8000, 0x385BC000,\n  0x385C0000, 0x385C4000, 0x385C8000, 0x385CC000, 0x385D0000, 0x385D4000, 0x385D8000, 0x385DC000, 0x385E0000, 0x385E4000, 0x385E8000, 0x385EC000, 0x385F0000, 0x385F4000, 0x385F8000, 0x385FC000,\n  0x38600000, 0x38604000, 0x38608000, 0x3860C000, 0x38610000, 0x38614000, 0x38618000, 0x3861C000, 0x3",
                   "8620000, 0x38624000, 0x38628000, 0x3862C000, 0x38630000, 0x38634000, 0x38638000, 0x3863C000,\n  0x38640000, 0x38644000, 0x38648000, 0x3864C000, 0x38650000, 0x38654000, 0x38658000, 0x3865C000, 0x38660000, 0x38664000, 0x38668000, 0x3866C000, 0x38670000, 0x38674000, 0x38678000, 0x3867C000,\n  0x38680000, 0x38684000, 0x38688000, 0x3868C000, 0x38690000, 0x38694000, 0x38698000, 0x3869C000, 0x386A0000, 0x386A4000, 0x386A8000, 0x386AC000, 0x386B0000, 0x386B4000, 0x386B8000, 0x386BC000,\n  0x386C0000, 0x386C4000, 0x386C8000, 0x386CC000, 0x386D0000, 0x386D4000, 0x386D8000, 0x386DC000, 0x386E0000, 0x386E4000, 0x386E8000, 0x386EC000, 0x386F0000, 0x386F4000, 0x386F8000, 0x386FC000,\n  0x38700000, 0x38704000, 0x38708000, 0x3870C000, 0x38710000, 0x38714000, 0x38718000, 0x3871C000, 0x38720000, 0x38724000, 0x38728000, 0x3872C000, 0x38730000, 0x38734000, 0x38738000, 0x3873C000,\n  0x38740000, 0x38744000, 0x38748000, 0x3874C000, 0x38750000, 0x38754000, 0x38758000, 0x3875C000, 0x38760000, 0x38764000, 0x38768000, 0x3876C000, 0x38770000, 0x38774000, 0x38778000, 0x3877C000,\n  0x38780000, 0x38784000, 0x38788000, 0x3878C000, 0x38790000, 0x38794000, 0x38798000, 0x3879C000, 0x387A0000, 0x387A4000, 0x387A8000, 0x387AC000, 0x387B0000, 0x387B4000, 0x387B8000, 0x387BC000,\n  0x387C0000, 0x387C4000, 0x387C8000, 0x387CC000, 0x387D0000, 0x387D4000, 0x387D8000, 0x387DC000, 0x387E0000, 0x387E4000, 0x387E8000, 0x387EC000, 0x387F0000, 0x387F4000, 0x387F8000, 0x387FC000,\n  0x38000000, 0x38002000, 0x38004000, 0x38006000, 0x38008000, 0x3800A000, 0x3800C000, 0x3800E000, 0x38010000, 0x38012000, 0x38014000, 0x38016000, 0x38018000, 0x3801A000, 0x3801C000, 0x3801E000,\n  0x38020000, 0x38022000, 0x38024000, 0x38026000, 0x38028000, 0x3802A000, 0x3802C000, 0x3802E000, 0x38030000, 0x38032000, 0x38034000, 0x38036000, 0x38038000, 0x3803A000, 0x3803C000, 0x3803E000,\n  0x38040000, 0x38042000, 0x38044000, 0x38046000, 0x38048000, 0x3804A000, 0x3804C000, 0x3804E000, 0x38050000, 0x38052000, 0x38054000, 0x38056000, 0x38058000, 0x3",
                   "805A000, 0x3805C000, 0x3805E000,\n  0x38060000, 0x38062000, 0x38064000, 0x38066000, 0x38068000, 0x3806A000, 0x3806C000, 0x3806E000, 0x38070000, 0x38072000, 0x38074000, 0x38076000, 0x38078000, 0x3807A000, 0x3807C000, 0x3807E000,\n  0x38080000, 0x38082000, 0x38084000, 0x38086000, 0x38088000, 0x3808A000, 0x3808C000, 0x3808E000, 0x38090000, 0x38092000, 0x38094000, 0x38096000, 0x38098000, 0x3809A000, 0x3809C000, 0x3809E000,\n  0x380A0000, 0x380A2000, 0x380A4000, 0x380A6000, 0x380A8000, 0x380AA000, 0x380AC000, 0x380AE000, 0x380B0000, 0x380B2000, 0x380B4000, 0x380B6000, 0x380B8000, 0x380BA000, 0x380BC000, 0x380BE000,\n  0x380C0000, 0x380C2000, 0x380C4000, 0x380C6000, 0x380C8000, 0x380CA000, 0x380CC000, 0x380CE000, 0x380D0000, 0x380D2000, 0x380D4000, 0x380D6000, 0x380D8000, 0x380DA000, 0x380DC000, 0x380DE000,\n  0x380E0000, 0x380E2000, 0x380E4000, 0x380E6000, 0x380E8000, 0x380EA000, 0x380EC000, 0x380EE000, 0x380F0000, 0x380F2000, 0x380F4000, 0x380F6000, 0x380F8000, 0x380FA000, 0x380FC000, 0x380FE000,\n  0x38100000, 0x38102000, 0x38104000, 0x38106000, 0x38108000, 0x3810A000, 0x3810C000, 0x3810E000, 0x38110000, 0x38112000, 0x38114000, 0x38116000, 0x38118000, 0x3811A000, 0x3811C000, 0x3811E000,\n  0x38120000, 0x38122000, 0x38124000, 0x38126000, 0x38128000, 0x3812A000, 0x3812C000, 0x3812E000, 0x38130000, 0x38132000, 0x38134000, 0x38136000, 0x38138000, 0x3813A000, 0x3813C000, 0x3813E000,\n  0x38140000, 0x38142000, 0x38144000, 0x38146000, 0x38148000, 0x3814A000, 0x3814C000, 0x3814E000, 0x38150000, 0x38152000, 0x38154000, 0x38156000, 0x38158000, 0x3815A000, 0x3815C000, 0x3815E000,\n  0x38160000, 0x38162000, 0x38164000, 0x38166000, 0x38168000, 0x3816A000, 0x3816C000, 0x3816E000, 0x38170000, 0x38172000, 0x38174000, 0x38176000, 0x38178000, 0x3817A000, 0x3817C000, 0x3817E000,\n  0x38180000, 0x38182000, 0x38184000, 0x38186000, 0x38188000, 0x3818A000, 0x3818C000, 0x3818E000, 0x38190000, 0x38192000, 0x38194000, 0x38196000, 0x38198000, 0x3819A000, 0x3819C000, 0x3819E000,\n  0x381A0000, 0x381A2000, 0",
                   "x381A4000, 0x381A6000, 0x381A8000, 0x381AA000, 0x381AC000, 0x381AE000, 0x381B0000, 0x381B2000, 0x381B4000, 0x381B6000, 0x381B8000, 0x381BA000, 0x381BC000, 0x381BE000,\n  0x381C0000, 0x381C2000, 0x381C4000, 0x381C6000, 0x381C8000, 0x381CA000, 0x381CC000, 0x381CE000, 0x381D0000, 0x381D2000, 0x381D4000, 0x381D6000, 0x381D8000, 0x381DA000, 0x381DC000, 0x381DE000,\n  0x381E0000, 0x381E2000, 0x381E4000, 0x381E6000, 0x381E8000, 0x381EA000, 0x381EC000, 0x381EE000, 0x381F0000, 0x381F2000, 0x381F4000, 0x381F6000, 0x381F8000, 0x381FA000, 0x381FC000, 0x381FE000,\n  0x38200000, 0x38202000, 0x38204000, 0x38206000, 0x38208000, 0x3820A000, 0x3820C000, 0x3820E000, 0x38210000, 0x38212000, 0x38214000, 0x38216000, 0x38218000, 0x3821A000, 0x3821C000, 0x3821E000,\n  0x38220000, 0x38222000, 0x38224000, 0x38226000, 0x38228000, 0x3822A000, 0x3822C000, 0x3822E000, 0x38230000, 0x38232000, 0x38234000, 0x38236000, 0x38238000, 0x3823A000, 0x3823C000, 0x3823E000,\n  0x38240000, 0x38242000, 0x38244000, 0x38246000, 0x38248000, 0x3824A000, 0x3824C000, 0x3824E000, 0x38250000, 0x38252000, 0x38254000, 0x38256000, 0x38258000, 0x3825A000, 0x3825C000, 0x3825E000,\n  0x38260000, 0x38262000, 0x38264000, 0x38266000, 0x38268000, 0x3826A000, 0x3826C000, 0x3826E000, 0x38270000, 0x38272000, 0x38274000, 0x38276000, 0x38278000, 0x3827A000, 0x3827C000, 0x3827E000,\n  0x38280000, 0x38282000, 0x38284000, 0x38286000, 0x38288000, 0x3828A000, 0x3828C000, 0x3828E000, 0x38290000, 0x38292000, 0x38294000, 0x38296000, 0x38298000, 0x3829A000, 0x3829C000, 0x3829E000,\n  0x382A0000, 0x382A2000, 0x382A4000, 0x382A6000, 0x382A8000, 0x382AA000, 0x382AC000, 0x382AE000, 0x382B0000, 0x382B2000, 0x382B4000, 0x382B6000, 0x382B8000, 0x382BA000, 0x382BC000, 0x382BE000,\n  0x382C0000, 0x382C2000, 0x382C4000, 0x382C6000, 0x382C8000, 0x382CA000, 0x382CC000, 0x382CE000, 0x382D0000, 0x382D2000, 0x382D4000, 0x382D6000, 0x382D8000, 0x382DA000, 0x382DC000, 0x382DE000,\n  0x382E0000, 0x382E2000, 0x382E4000, 0x382E6000, 0x382E8000, 0x382EA000, 0x382EC000, 0",
                   "x382EE000, 0x382F0000, 0x382F2000, 0x382F4000, 0x382F6000, 0x382F8000, 0x382FA000, 0x382FC000, 0x382FE000,\n  0x38300000, 0x38302000, 0x38304000, 0x38306000, 0x38308000, 0x3830A000, 0x3830C000, 0x3830E000, 0x38310000, 0x38312000, 0x38314000, 0x38316000, 0x38318000, 0x3831A000, 0x3831C000, 0x3831E000,\n  0x38320000, 0x38322000, 0x38324000, 0x38326000, 0x38328000, 0x3832A000, 0x3832C000, 0x3832E000, 0x38330000, 0x38332000, 0x38334000, 0x38336000, 0x38338000, 0x3833A000, 0x3833C000, 0x3833E000,\n  0x38340000, 0x38342000, 0x38344000, 0x38346000, 0x38348000, 0x3834A000, 0x3834C000, 0x3834E000, 0x38350000, 0x38352000, 0x38354000, 0x38356000, 0x38358000, 0x3835A000, 0x3835C000, 0x3835E000,\n  0x38360000, 0x38362000, 0x38364000, 0x38366000, 0x38368000, 0x3836A000, 0x3836C000, 0x3836E000, 0x38370000, 0x38372000, 0x38374000, 0x38376000, 0x38378000, 0x3837A000, 0x3837C000, 0x3837E000,\n  0x38380000, 0x38382000, 0x38384000, 0x38386000, 0x38388000, 0x3838A000, 0x3838C000, 0x3838E000, 0x38390000, 0x38392000, 0x38394000, 0x38396000, 0x38398000, 0x3839A000, 0x3839C000, 0x3839E000,\n  0x383A0000, 0x383A2000, 0x383A4000, 0x383A6000, 0x383A8000, 0x383AA000, 0x383AC000, 0x383AE000, 0x383B0000, 0x383B2000, 0x383B4000, 0x383B6000, 0x383B8000, 0x383BA000, 0x383BC000, 0x383BE000,\n  0x383C0000, 0x383C2000, 0x383C4000, 0x383C6000, 0x383C8000, 0x383CA000, 0x383CC000, 0x383CE000, 0x383D0000, 0x383D2000, 0x383D4000, 0x383D6000, 0x383D8000, 0x383DA000, 0x383DC000, 0x383DE000,\n  0x383E0000, 0x383E2000, 0x383E4000, 0x383E6000, 0x383E8000, 0x383EA000, 0x383EC000, 0x383EE000, 0x383F0000, 0x383F2000, 0x383F4000, 0x383F6000, 0x383F8000, 0x383FA000, 0x383FC000, 0x383FE000,\n  0x38400000, 0x38402000, 0x38404000, 0x38406000, 0x38408000, 0x3840A000, 0x3840C000, 0x3840E000, 0x38410000, 0x38412000, 0x38414000, 0x38416000, 0x38418000, 0x3841A000, 0x3841C000, 0x3841E000,\n  0x38420000, 0x38422000, 0x38424000, 0x38426000, 0x38428000, 0x3842A000, 0x3842C000, 0x3842E000, 0x38430000, 0x38432000, 0x38434000, 0x38436000, 0",
                   "x38438000, 0x3843A000, 0x3843C000, 0x3843E000,\n  0x38440000, 0x38442000, 0x38444000, 0x38446000, 0x38448000, 0x3844A000, 0x3844C000, 0x3844E000, 0x38450000, 0x38452000, 0x38454000, 0x38456000, 0x38458000, 0x3845A000, 0x3845C000, 0x3845E000,\n  0x38460000, 0x38462000, 0x38464000, 0x38466000, 0x38468000, 0x3846A000, 0x3846C000, 0x3846E000, 0x38470000, 0x38472000, 0x38474000, 0x38476000, 0x38478000, 0x3847A000, 0x3847C000, 0x3847E000,\n  0x38480000, 0x38482000, 0x38484000, 0x38486000, 0x38488000, 0x3848A000, 0x3848C000, 0x3848E000, 0x38490000, 0x38492000, 0x38494000, 0x38496000, 0x38498000, 0x3849A000, 0x3849C000, 0x3849E000,\n  0x384A0000, 0x384A2000, 0x384A4000, 0x384A6000, 0x384A8000, 0x384AA000, 0x384AC000, 0x384AE000, 0x384B0000, 0x384B2000, 0x384B4000, 0x384B6000, 0x384B8000, 0x384BA000, 0x384BC000, 0x384BE000,\n  0x384C0000, 0x384C2000, 0x384C4000, 0x384C6000, 0x384C8000, 0x384CA000, 0x384CC000, 0x384CE000, 0x384D0000, 0x384D2000, 0x384D4000, 0x384D6000, 0x384D8000, 0x384DA000, 0x384DC000, 0x384DE000,\n  0x384E0000, 0x384E2000, 0x384E4000, 0x384E6000, 0x384E8000, 0x384EA000, 0x384EC000, 0x384EE000, 0x384F0000, 0x384F2000, 0x384F4000, 0x384F6000, 0x384F8000, 0x384FA000, 0x384FC000, 0x384FE000,\n  0x38500000, 0x38502000, 0x38504000, 0x38506000, 0x38508000, 0x3850A000, 0x3850C000, 0x3850E000, 0x38510000, 0x38512000, 0x38514000, 0x38516000, 0x38518000, 0x3851A000, 0x3851C000, 0x3851E000,\n  0x38520000, 0x38522000, 0x38524000, 0x38526000, 0x38528000, 0x3852A000, 0x3852C000, 0x3852E000, 0x38530000, 0x38532000, 0x38534000, 0x38536000, 0x38538000, 0x3853A000, 0x3853C000, 0x3853E000,\n  0x38540000, 0x38542000, 0x38544000, 0x38546000, 0x38548000, 0x3854A000, 0x3854C000, 0x3854E000, 0x38550000, 0x38552000, 0x38554000, 0x38556000, 0x38558000, 0x3855A000, 0x3855C000, 0x3855E000,\n  0x38560000, 0x38562000, 0x38564000, 0x38566000, 0x38568000, 0x3856A000, 0x3856C000, 0x3856E000, 0x38570000, 0x38572000, 0x38574000, 0x38576000, 0x38578000, 0x3857A000, 0x3857C000, 0x3857E000,\n  0x38580000,",
                   " 0x38582000, 0x38584000, 0x38586000, 0x38588000, 0x3858A000, 0x3858C000, 0x3858E000, 0x38590000, 0x38592000, 0x38594000, 0x38596000, 0x38598000, 0x3859A000, 0x3859C000, 0x3859E000,\n  0x385A0000, 0x385A2000, 0x385A4000, 0x385A6000, 0x385A8000, 0x385AA000, 0x385AC000, 0x385AE000, 0x385B0000, 0x385B2000, 0x385B4000, 0x385B6000, 0x385B8000, 0x385BA000, 0x385BC000, 0x385BE000,\n  0x385C0000, 0x385C2000, 0x385C4000, 0x385C6000, 0x385C8000, 0x385CA000, 0x385CC000, 0x385CE000, 0x385D0000, 0x385D2000, 0x385D4000, 0x385D6000, 0x385D8000, 0x385DA000, 0x385DC000, 0x385DE000,\n  0x385E0000, 0x385E2000, 0x385E4000, 0x385E6000, 0x385E8000, 0x385EA000, 0x385EC000, 0x385EE000, 0x385F0000, 0x385F2000, 0x385F4000, 0x385F6000, 0x385F8000, 0x385FA000, 0x385FC000, 0x385FE000,\n  0x38600000, 0x38602000, 0x38604000, 0x38606000, 0x38608000, 0x3860A000, 0x3860C000, 0x3860E000, 0x38610000, 0x38612000, 0x38614000, 0x38616000, 0x38618000, 0x3861A000, 0x3861C000, 0x3861E000,\n  0x38620000, 0x38622000, 0x38624000, 0x38626000, 0x38628000, 0x3862A000, 0x3862C000, 0x3862E000, 0x38630000, 0x38632000, 0x38634000, 0x38636000, 0x38638000, 0x3863A000, 0x3863C000, 0x3863E000,\n  0x38640000, 0x38642000, 0x38644000, 0x38646000, 0x38648000, 0x3864A000, 0x3864C000, 0x3864E000, 0x38650000, 0x38652000, 0x38654000, 0x38656000, 0x38658000, 0x3865A000, 0x3865C000, 0x3865E000,\n  0x38660000, 0x38662000, 0x38664000, 0x38666000, 0x38668000, 0x3866A000, 0x3866C000, 0x3866E000, 0x38670000, 0x38672000, 0x38674000, 0x38676000, 0x38678000, 0x3867A000, 0x3867C000, 0x3867E000,\n  0x38680000, 0x38682000, 0x38684000, 0x38686000, 0x38688000, 0x3868A000, 0x3868C000, 0x3868E000, 0x38690000, 0x38692000, 0x38694000, 0x38696000, 0x38698000, 0x3869A000, 0x3869C000, 0x3869E000,\n  0x386A0000, 0x386A2000, 0x386A4000, 0x386A6000, 0x386A8000, 0x386AA000, 0x386AC000, 0x386AE000, 0x386B0000, 0x386B2000, 0x386B4000, 0x386B6000, 0x386B8000, 0x386BA000, 0x386BC000, 0x386BE000,\n  0x386C0000, 0x386C2000, 0x386C4000, 0x386C6000, 0x386C8000, 0x386CA000,",
                   " 0x386CC000, 0x386CE000, 0x386D0000, 0x386D2000, 0x386D4000, 0x386D6000, 0x386D8000, 0x386DA000, 0x386DC000, 0x386DE000,\n  0x386E0000, 0x386E2000, 0x386E4000, 0x386E6000, 0x386E8000, 0x386EA000, 0x386EC000, 0x386EE000, 0x386F0000, 0x386F2000, 0x386F4000, 0x386F6000, 0x386F8000, 0x386FA000, 0x386FC000, 0x386FE000,\n  0x38700000, 0x38702000, 0x38704000, 0x38706000, 0x38708000, 0x3870A000, 0x3870C000, 0x3870E000, 0x38710000, 0x38712000, 0x38714000, 0x38716000, 0x38718000, 0x3871A000, 0x3871C000, 0x3871E000,\n  0x38720000, 0x38722000, 0x38724000, 0x38726000, 0x38728000, 0x3872A000, 0x3872C000, 0x3872E000, 0x38730000, 0x38732000, 0x38734000, 0x38736000, 0x38738000, 0x3873A000, 0x3873C000, 0x3873E000,\n  0x38740000, 0x38742000, 0x38744000, 0x38746000, 0x38748000, 0x3874A000, 0x3874C000, 0x3874E000, 0x38750000, 0x38752000, 0x38754000, 0x38756000, 0x38758000, 0x3875A000, 0x3875C000, 0x3875E000,\n  0x38760000, 0x38762000, 0x38764000, 0x38766000, 0x38768000, 0x3876A000, 0x3876C000, 0x3876E000, 0x38770000, 0x38772000, 0x38774000, 0x38776000, 0x38778000, 0x3877A000, 0x3877C000, 0x3877E000,\n  0x38780000, 0x38782000, 0x38784000, 0x38786000, 0x38788000, 0x3878A000, 0x3878C000, 0x3878E000, 0x38790000, 0x38792000, 0x38794000, 0x38796000, 0x38798000, 0x3879A000, 0x3879C000, 0x3879E000,\n  0x387A0000, 0x387A2000, 0x387A4000, 0x387A6000, 0x387A8000, 0x387AA000, 0x387AC000, 0x387AE000, 0x387B0000, 0x387B2000, 0x387B4000, 0x387B6000, 0x387B8000, 0x387BA000, 0x387BC000, 0x387BE000,\n  0x387C0000, 0x387C2000, 0x387C4000, 0x387C6000, 0x387C8000, 0x387CA000, 0x387CC000, 0x387CE000, 0x387D0000, 0x387D2000, 0x387D4000, 0x387D6000, 0x387D8000, 0x387DA000, 0x387DC000, 0x387DE000,\n  0x387E0000, 0x387E2000, 0x387E4000, 0x387E6000, 0x387E8000, 0x387EA000, 0x387EC000, 0x387EE000, 0x387F0000, 0x387F2000, 0x387F4000, 0x387F6000, 0x387F8000, 0x387FA000, 0x387FC000, 0x387FE000 };\n__constant static const uint32_t exponent_table[64] = {\n  0x00000000, 0x00800000, 0x01000000, 0x01800000, 0x02000000, 0x02800000, 0",
                   "x03000000, 0x03800000, 0x04000000, 0x04800000, 0x05000000, 0x05800000, 0x06000000, 0x06800000, 0x07000000, 0x07800000,\n  0x08000000, 0x08800000, 0x09000000, 0x09800000, 0x0A000000, 0x0A800000, 0x0B000000, 0x0B800000, 0x0C000000, 0x0C800000, 0x0D000000, 0x0D800000, 0x0E000000, 0x0E800000, 0x0F000000, 0x47800000,\n  0x80000000, 0x80800000, 0x81000000, 0x81800000, 0x82000000, 0x82800000, 0x83000000, 0x83800000, 0x84000000, 0x84800000, 0x85000000, 0x85800000, 0x86000000, 0x86800000, 0x87000000, 0x87800000,\n  0x88000000, 0x88800000, 0x89000000, 0x89800000, 0x8A000000, 0x8A800000, 0x8B000000, 0x8B800000, 0x8C000000, 0x8C800000, 0x8D000000, 0x8D800000, 0x8E000000, 0x8E800000, 0x8F000000, 0xC7800000 };\n__constant static const unsigned short offset_table[64] = {\n  0, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n  0, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024 };\n\nstatic uint16_t float2halfbits(float value) {\n  union { float x; uint32_t y; } u;\n  u.x = value;\n  uint32_t bits = u.y;\n\n  uint16_t hbits = base_table[bits>>23] + (uint16_t)((bits&0x7FFFFF)>>shift_table[bits>>23]);;\n\n  return hbits;\n}\n\nstatic float halfbits2float(uint16_t value) {\n  uint32_t bits = mantissa_table[offset_table[value>>10]+(value&0x3FF)] + exponent_table[value>>10];\n\n  union { uint32_t x; float y; } u;\n  u.x = bits;\n  return u.y;\n}\n\n// End of half.h.\n// Start of scalar.h.\n\n// Implementation of the primitive scalar operations.  Very\n// repetitive.  This code is inserted directly into both CUDA and\n// OpenCL programs, as well as the CPU code, so it has some #ifdefs to\n// work everywhere.  Some operations are defined as macros because\n// this allows us to use them as constant expressions in things like\n// array sizes and static i",
                   "nitialisers.\n\n// Some of the #ifdefs are because OpenCL uses type-generic functions\n// for some operations (e.g. sqrt), while C and CUDA sensibly use\n// distinct functions for different precisions (e.g. sqrtf() and\n// sqrt()).  This is quite annoying.  Due to C's unfortunate casting\n// rules, it is also really easy to accidentally implement\n// floating-point functions in the wrong precision, so be careful.\n\n// Double-precision definitions are only included if the preprocessor\n// macro FUTHARK_F64_ENABLED is set.\n\nstatic inline uint8_t add8(uint8_t x, uint8_t y) {\n  return x + y;\n}\n\nstatic inline uint16_t add16(uint16_t x, uint16_t y) {\n  return x + y;\n}\n\nstatic inline uint32_t add32(uint32_t x, uint32_t y) {\n  return x + y;\n}\n\nstatic inline uint64_t add64(uint64_t x, uint64_t y) {\n  return x + y;\n}\n\nstatic inline uint8_t sub8(uint8_t x, uint8_t y) {\n  return x - y;\n}\n\nstatic inline uint16_t sub16(uint16_t x, uint16_t y) {\n  return x - y;\n}\n\nstatic inline uint32_t sub32(uint32_t x, uint32_t y) {\n  return x - y;\n}\n\nstatic inline uint64_t sub64(uint64_t x, uint64_t y) {\n  return x - y;\n}\n\nstatic inline uint8_t mul8(uint8_t x, uint8_t y) {\n  return x * y;\n}\n\nstatic inline uint16_t mul16(uint16_t x, uint16_t y) {\n  return x * y;\n}\n\nstatic inline uint32_t mul32(uint32_t x, uint32_t y) {\n  return x * y;\n}\n\nstatic inline uint64_t mul64(uint64_t x, uint64_t y) {\n  return x * y;\n}\n\nstatic inline uint8_t udiv8(uint8_t x, uint8_t y) {\n  return x / y;\n}\n\nstatic inline uint16_t udiv16(uint16_t x, uint16_t y) {\n  return x / y;\n}\n\nstatic inline uint32_t udiv32(uint32_t x, uint32_t y) {\n  return x / y;\n}\n\nstatic inline uint64_t udiv64(uint64_t x, uint64_t y) {\n  return x / y;\n}\n\nstatic inline uint8_t udiv_up8(uint8_t x, uint8_t y) {\n  return (x + y - 1) / y;\n}\n\nstatic inline uint16_t udiv_up16(uint16_t x, uint16_t y) {\n  return (x + y - 1) / y;\n}\n\nstatic inline uint32_t udiv_up32(uint32_t x, uint32_t y) {\n  return (x + y - 1) / y;\n}\n\nstatic inline uint64_t udiv_up64(uint64_t x, uint",
                   "64_t y) {\n  return (x + y - 1) / y;\n}\n\nstatic inline uint8_t umod8(uint8_t x, uint8_t y) {\n  return x % y;\n}\n\nstatic inline uint16_t umod16(uint16_t x, uint16_t y) {\n  return x % y;\n}\n\nstatic inline uint32_t umod32(uint32_t x, uint32_t y) {\n  return x % y;\n}\n\nstatic inline uint64_t umod64(uint64_t x, uint64_t y) {\n  return x % y;\n}\n\nstatic inline uint8_t udiv_safe8(uint8_t x, uint8_t y) {\n  return y == 0 ? 0 : x / y;\n}\n\nstatic inline uint16_t udiv_safe16(uint16_t x, uint16_t y) {\n  return y == 0 ? 0 : x / y;\n}\n\nstatic inline uint32_t udiv_safe32(uint32_t x, uint32_t y) {\n  return y == 0 ? 0 : x / y;\n}\n\nstatic inline uint64_t udiv_safe64(uint64_t x, uint64_t y) {\n  return y == 0 ? 0 : x / y;\n}\n\nstatic inline uint8_t udiv_up_safe8(uint8_t x, uint8_t y) {\n  return y == 0 ? 0 : (x + y - 1) / y;\n}\n\nstatic inline uint16_t udiv_up_safe16(uint16_t x, uint16_t y) {\n  return y == 0 ? 0 : (x + y - 1) / y;\n}\n\nstatic inline uint32_t udiv_up_safe32(uint32_t x, uint32_t y) {\n  return y == 0 ? 0 : (x + y - 1) / y;\n}\n\nstatic inline uint64_t udiv_up_safe64(uint64_t x, uint64_t y) {\n  return y == 0 ? 0 : (x + y - 1) / y;\n}\n\nstatic inline uint8_t umod_safe8(uint8_t x, uint8_t y) {\n  return y == 0 ? 0 : x % y;\n}\n\nstatic inline uint16_t umod_safe16(uint16_t x, uint16_t y) {\n  return y == 0 ? 0 : x % y;\n}\n\nstatic inline uint32_t umod_safe32(uint32_t x, uint32_t y) {\n  return y == 0 ? 0 : x % y;\n}\n\nstatic inline uint64_t umod_safe64(uint64_t x, uint64_t y) {\n  return y == 0 ? 0 : x % y;\n}\n\nstatic inline int8_t sdiv8(int8_t x, int8_t y) {\n  int8_t q = x / y;\n  int8_t r = x % y;\n\n  return q - ((r != 0 && r < 0 != y < 0) ? 1 : 0);\n}\n\nstatic inline int16_t sdiv16(int16_t x, int16_t y) {\n  int16_t q = x / y;\n  int16_t r = x % y;\n\n  return q - ((r != 0 && r < 0 != y < 0) ? 1 : 0);\n}\n\nstatic inline int32_t sdiv32(int32_t x, int32_t y) {\n  int32_t q = x / y;\n  int32_t r = x % y;\n\n  return q - ((r != 0 && r < 0 != y < 0) ? 1 : 0);\n}\n\nstatic inline int64_t sdiv64(int64_t x, int64_t y) {\n  int64_t q ",
                   "= x / y;\n  int64_t r = x % y;\n\n  return q - ((r != 0 && r < 0 != y < 0) ? 1 : 0);\n}\n\nstatic inline int8_t sdiv_up8(int8_t x, int8_t y) {\n  return sdiv8(x + y - 1, y);\n}\n\nstatic inline int16_t sdiv_up16(int16_t x, int16_t y) {\n  return sdiv16(x + y - 1, y);\n}\n\nstatic inline int32_t sdiv_up32(int32_t x, int32_t y) {\n  return sdiv32(x + y - 1, y);\n}\n\nstatic inline int64_t sdiv_up64(int64_t x, int64_t y) {\n  return sdiv64(x + y - 1, y);\n}\n\nstatic inline int8_t smod8(int8_t x, int8_t y) {\n  int8_t r = x % y;\n\n  return r + (r == 0 || (x > 0 && y > 0) || (x < 0 && y < 0) ? 0 : y);\n}\n\nstatic inline int16_t smod16(int16_t x, int16_t y) {\n  int16_t r = x % y;\n\n  return r + (r == 0 || (x > 0 && y > 0) || (x < 0 && y < 0) ? 0 : y);\n}\n\nstatic inline int32_t smod32(int32_t x, int32_t y) {\n  int32_t r = x % y;\n\n  return r + (r == 0 || (x > 0 && y > 0) || (x < 0 && y < 0) ? 0 : y);\n}\n\nstatic inline int64_t smod64(int64_t x, int64_t y) {\n  int64_t r = x % y;\n\n  return r + (r == 0 || (x > 0 && y > 0) || (x < 0 && y < 0) ? 0 : y);\n}\n\nstatic inline int8_t sdiv_safe8(int8_t x, int8_t y) {\n  return y == 0 ? 0 : sdiv8(x, y);\n}\n\nstatic inline int16_t sdiv_safe16(int16_t x, int16_t y) {\n  return y == 0 ? 0 : sdiv16(x, y);\n}\n\nstatic inline int32_t sdiv_safe32(int32_t x, int32_t y) {\n  return y == 0 ? 0 : sdiv32(x, y);\n}\n\nstatic inline int64_t sdiv_safe64(int64_t x, int64_t y) {\n  return y == 0 ? 0 : sdiv64(x, y);\n}\n\nstatic inline int8_t sdiv_up_safe8(int8_t x, int8_t y) {\n  return sdiv_safe8(x + y - 1, y);\n}\n\nstatic inline int16_t sdiv_up_safe16(int16_t x, int16_t y) {\n  return sdiv_safe16(x + y - 1, y);\n}\n\nstatic inline int32_t sdiv_up_safe32(int32_t x, int32_t y) {\n  return sdiv_safe32(x + y - 1, y);\n}\n\nstatic inline int64_t sdiv_up_safe64(int64_t x, int64_t y) {\n  return sdiv_safe64(x + y - 1, y);\n}\n\nstatic inline int8_t smod_safe8(int8_t x, int8_t y) {\n  return y == 0 ? 0 : smod8(x, y);\n}\n\nstatic inline int16_t smod_safe16(int16_t x, int16_t y) {\n  return y == 0 ? 0 : smod16(x, y);\n}\n\nst",
                   "atic inline int32_t smod_safe32(int32_t x, int32_t y) {\n  return y == 0 ? 0 : smod32(x, y);\n}\n\nstatic inline int64_t smod_safe64(int64_t x, int64_t y) {\n  return y == 0 ? 0 : smod64(x, y);\n}\n\nstatic inline int8_t squot8(int8_t x, int8_t y) {\n  return x / y;\n}\n\nstatic inline int16_t squot16(int16_t x, int16_t y) {\n  return x / y;\n}\n\nstatic inline int32_t squot32(int32_t x, int32_t y) {\n  return x / y;\n}\n\nstatic inline int64_t squot64(int64_t x, int64_t y) {\n  return x / y;\n}\n\nstatic inline int8_t srem8(int8_t x, int8_t y) {\n  return x % y;\n}\n\nstatic inline int16_t srem16(int16_t x, int16_t y) {\n  return x % y;\n}\n\nstatic inline int32_t srem32(int32_t x, int32_t y) {\n  return x % y;\n}\n\nstatic inline int64_t srem64(int64_t x, int64_t y) {\n  return x % y;\n}\n\nstatic inline int8_t squot_safe8(int8_t x, int8_t y) {\n  return y == 0 ? 0 : x / y;\n}\n\nstatic inline int16_t squot_safe16(int16_t x, int16_t y) {\n  return y == 0 ? 0 : x / y;\n}\n\nstatic inline int32_t squot_safe32(int32_t x, int32_t y) {\n  return y == 0 ? 0 : x / y;\n}\n\nstatic inline int64_t squot_safe64(int64_t x, int64_t y) {\n  return y == 0 ? 0 : x / y;\n}\n\nstatic inline int8_t srem_safe8(int8_t x, int8_t y) {\n  return y == 0 ? 0 : x % y;\n}\n\nstatic inline int16_t srem_safe16(int16_t x, int16_t y) {\n  return y == 0 ? 0 : x % y;\n}\n\nstatic inline int32_t srem_safe32(int32_t x, int32_t y) {\n  return y == 0 ? 0 : x % y;\n}\n\nstatic inline int64_t srem_safe64(int64_t x, int64_t y) {\n  return y == 0 ? 0 : x % y;\n}\n\nstatic inline int8_t smin8(int8_t x, int8_t y) {\n  return x < y ? x : y;\n}\n\nstatic inline int16_t smin16(int16_t x, int16_t y) {\n  return x < y ? x : y;\n}\n\nstatic inline int32_t smin32(int32_t x, int32_t y) {\n  return x < y ? x : y;\n}\n\nstatic inline int64_t smin64(int64_t x, int64_t y) {\n  return x < y ? x : y;\n}\n\nstatic inline uint8_t umin8(uint8_t x, uint8_t y) {\n  return x < y ? x : y;\n}\n\nstatic inline uint16_t umin16(uint16_t x, uint16_t y) {\n  return x < y ? x : y;\n}\n\nstatic inline uint32_t umin32(uint32_t x, ",
                   "uint32_t y) {\n  return x < y ? x : y;\n}\n\nstatic inline uint64_t umin64(uint64_t x, uint64_t y) {\n  return x < y ? x : y;\n}\n\nstatic inline int8_t smax8(int8_t x, int8_t y) {\n  return x < y ? y : x;\n}\n\nstatic inline int16_t smax16(int16_t x, int16_t y) {\n  return x < y ? y : x;\n}\n\nstatic inline int32_t smax32(int32_t x, int32_t y) {\n  return x < y ? y : x;\n}\n\nstatic inline int64_t smax64(int64_t x, int64_t y) {\n  return x < y ? y : x;\n}\n\nstatic inline uint8_t umax8(uint8_t x, uint8_t y) {\n  return x < y ? y : x;\n}\n\nstatic inline uint16_t umax16(uint16_t x, uint16_t y) {\n  return x < y ? y : x;\n}\n\nstatic inline uint32_t umax32(uint32_t x, uint32_t y) {\n  return x < y ? y : x;\n}\n\nstatic inline uint64_t umax64(uint64_t x, uint64_t y) {\n  return x < y ? y : x;\n}\n\nstatic inline uint8_t shl8(uint8_t x, uint8_t y) {\n  return (uint8_t)(x << y);\n}\n\nstatic inline uint16_t shl16(uint16_t x, uint16_t y) {\n  return (uint16_t)(x << y);\n}\n\nstatic inline uint32_t shl32(uint32_t x, uint32_t y) {\n  return x << y;\n}\n\nstatic inline uint64_t shl64(uint64_t x, uint64_t y) {\n  return x << y;\n}\n\nstatic inline uint8_t lshr8(uint8_t x, uint8_t y) {\n  return x >> y;\n}\n\nstatic inline uint16_t lshr16(uint16_t x, uint16_t y) {\n  return x >> y;\n}\n\nstatic inline uint32_t lshr32(uint32_t x, uint32_t y) {\n  return x >> y;\n}\n\nstatic inline uint64_t lshr64(uint64_t x, uint64_t y) {\n  return x >> y;\n}\n\nstatic inline int8_t ashr8(int8_t x, int8_t y) {\n  return x >> y;\n}\n\nstatic inline int16_t ashr16(int16_t x, int16_t y) {\n  return x >> y;\n}\n\nstatic inline int32_t ashr32(int32_t x, int32_t y) {\n  return x >> y;\n}\n\nstatic inline int64_t ashr64(int64_t x, int64_t y) {\n  return x >> y;\n}\n\nstatic inline uint8_t and8(uint8_t x, uint8_t y) {\n  return x & y;\n}\n\nstatic inline uint16_t and16(uint16_t x, uint16_t y) {\n  return x & y;\n}\n\nstatic inline uint32_t and32(uint32_t x, uint32_t y) {\n  return x & y;\n}\n\nstatic inline uint64_t and64(uint64_t x, uint64_t y) {\n  return x & y;\n}\n\nstatic inline uint8_t or8(uint8_t",
                   " x, uint8_t y) {\n  return x | y;\n}\n\nstatic inline uint16_t or16(uint16_t x, uint16_t y) {\n  return x | y;\n}\n\nstatic inline uint32_t or32(uint32_t x, uint32_t y) {\n  return x | y;\n}\n\nstatic inline uint64_t or64(uint64_t x, uint64_t y) {\n  return x | y;\n}\n\nstatic inline uint8_t xor8(uint8_t x, uint8_t y) {\n  return x ^ y;\n}\n\nstatic inline uint16_t xor16(uint16_t x, uint16_t y) {\n  return x ^ y;\n}\n\nstatic inline uint32_t xor32(uint32_t x, uint32_t y) {\n  return x ^ y;\n}\n\nstatic inline uint64_t xor64(uint64_t x, uint64_t y) {\n  return x ^ y;\n}\n\nstatic inline bool ult8(uint8_t x, uint8_t y) {\n  return x < y;\n}\n\nstatic inline bool ult16(uint16_t x, uint16_t y) {\n  return x < y;\n}\n\nstatic inline bool ult32(uint32_t x, uint32_t y) {\n  return x < y;\n}\n\nstatic inline bool ult64(uint64_t x, uint64_t y) {\n  return x < y;\n}\n\nstatic inline bool ule8(uint8_t x, uint8_t y) {\n  return x <= y;\n}\n\nstatic inline bool ule16(uint16_t x, uint16_t y) {\n  return x <= y;\n}\n\nstatic inline bool ule32(uint32_t x, uint32_t y) {\n  return x <= y;\n}\n\nstatic inline bool ule64(uint64_t x, uint64_t y) {\n  return x <= y;\n}\n\nstatic inline bool slt8(int8_t x, int8_t y) {\n  return x < y;\n}\n\nstatic inline bool slt16(int16_t x, int16_t y) {\n  return x < y;\n}\n\nstatic inline bool slt32(int32_t x, int32_t y) {\n  return x < y;\n}\n\nstatic inline bool slt64(int64_t x, int64_t y) {\n  return x < y;\n}\n\nstatic inline bool sle8(int8_t x, int8_t y) {\n  return x <= y;\n}\n\nstatic inline bool sle16(int16_t x, int16_t y) {\n  return x <= y;\n}\n\nstatic inline bool sle32(int32_t x, int32_t y) {\n  return x <= y;\n}\n\nstatic inline bool sle64(int64_t x, int64_t y) {\n  return x <= y;\n}\n\nstatic inline uint8_t pow8(uint8_t x, uint8_t y) {\n  uint8_t res = 1, rem = y;\n\n  while (rem != 0) {\n    if (rem & 1)\n      res *= x;\n    rem >>= 1;\n    x *= x;\n  }\n  return res;\n}\n\nstatic inline uint16_t pow16(uint16_t x, uint16_t y) {\n  uint16_t res = 1, rem = y;\n\n  while (rem != 0) {\n    if (rem & 1)\n      res *= x;\n    rem >>= 1;\n    x *= x;\n  }\n ",
                   " return res;\n}\n\nstatic inline uint32_t pow32(uint32_t x, uint32_t y) {\n  uint32_t res = 1, rem = y;\n\n  while (rem != 0) {\n    if (rem & 1)\n      res *= x;\n    rem >>= 1;\n    x *= x;\n  }\n  return res;\n}\n\nstatic inline uint64_t pow64(uint64_t x, uint64_t y) {\n  uint64_t res = 1, rem = y;\n\n  while (rem != 0) {\n    if (rem & 1)\n      res *= x;\n    rem >>= 1;\n    x *= x;\n  }\n  return res;\n}\n\nstatic inline bool itob_i8_bool(int8_t x) {\n  return x;\n}\n\nstatic inline bool itob_i16_bool(int16_t x) {\n  return x;\n}\n\nstatic inline bool itob_i32_bool(int32_t x) {\n  return x;\n}\n\nstatic inline bool itob_i64_bool(int64_t x) {\n  return x;\n}\n\nstatic inline int8_t btoi_bool_i8(bool x) {\n  return x;\n}\n\nstatic inline int16_t btoi_bool_i16(bool x) {\n  return x;\n}\n\nstatic inline int32_t btoi_bool_i32(bool x) {\n  return x;\n}\n\nstatic inline int64_t btoi_bool_i64(bool x) {\n  return x;\n}\n\n#define sext_i8_i8(x) ((int8_t) (int8_t) (x))\n#define sext_i8_i16(x) ((int16_t) (int8_t) (x))\n#define sext_i8_i32(x) ((int32_t) (int8_t) (x))\n#define sext_i8_i64(x) ((int64_t) (int8_t) (x))\n#define sext_i16_i8(x) ((int8_t) (int16_t) (x))\n#define sext_i16_i16(x) ((int16_t) (int16_t) (x))\n#define sext_i16_i32(x) ((int32_t) (int16_t) (x))\n#define sext_i16_i64(x) ((int64_t) (int16_t) (x))\n#define sext_i32_i8(x) ((int8_t) (int32_t) (x))\n#define sext_i32_i16(x) ((int16_t) (int32_t) (x))\n#define sext_i32_i32(x) ((int32_t) (int32_t) (x))\n#define sext_i32_i64(x) ((int64_t) (int32_t) (x))\n#define sext_i64_i8(x) ((int8_t) (int64_t) (x))\n#define sext_i64_i16(x) ((int16_t) (int64_t) (x))\n#define sext_i64_i32(x) ((int32_t) (int64_t) (x))\n#define sext_i64_i64(x) ((int64_t) (int64_t) (x))\n#define zext_i8_i8(x) ((int8_t) (uint8_t) (x))\n#define zext_i8_i16(x) ((int16_t) (uint8_t) (x))\n#define zext_i8_i32(x) ((int32_t) (uint8_t) (x))\n#define zext_i8_i64(x) ((int64_t) (uint8_t) (x))\n#define zext_i16_i8(x) ((int8_t) (uint16_t) (x))\n#define zext_i16_i16(x) ((int16_t) (uint16_t) (x))\n#define zext_i16_i32(x) ((int32_t) (uint16_t) (x",
                   "))\n#define zext_i16_i64(x) ((int64_t) (uint16_t) (x))\n#define zext_i32_i8(x) ((int8_t) (uint32_t) (x))\n#define zext_i32_i16(x) ((int16_t) (uint32_t) (x))\n#define zext_i32_i32(x) ((int32_t) (uint32_t) (x))\n#define zext_i32_i64(x) ((int64_t) (uint32_t) (x))\n#define zext_i64_i8(x) ((int8_t) (uint64_t) (x))\n#define zext_i64_i16(x) ((int16_t) (uint64_t) (x))\n#define zext_i64_i32(x) ((int32_t) (uint64_t) (x))\n#define zext_i64_i64(x) ((int64_t) (uint64_t) (x))\n\nstatic int8_t abs8(int8_t x) {\n  return (int8_t)abs(x);\n}\n\nstatic int16_t abs16(int16_t x) {\n  return (int16_t)abs(x);\n}\n\nstatic int32_t abs32(int32_t x) {\n  return abs(x);\n}\n\nstatic int64_t abs64(int64_t x) {\n#if defined(__OPENCL_VERSION__)\n  return abs(x);\n#else\n  return llabs(x);\n#endif\n}\n\n#if defined(__OPENCL_VERSION__)\nstatic int32_t futrts_popc8(int8_t x) {\n  return popcount(x);\n}\n\nstatic int32_t futrts_popc16(int16_t x) {\n  return popcount(x);\n}\n\nstatic int32_t futrts_popc32(int32_t x) {\n  return popcount(x);\n}\n\nstatic int32_t futrts_popc64(int64_t x) {\n  return popcount(x);\n}\n#elif defined(__CUDA_ARCH__)\n\nstatic int32_t futrts_popc8(int8_t x) {\n  return __popc(zext_i8_i32(x));\n}\n\nstatic int32_t futrts_popc16(int16_t x) {\n  return __popc(zext_i16_i32(x));\n}\n\nstatic int32_t futrts_popc32(int32_t x) {\n  return __popc(x);\n}\n\nstatic int32_t futrts_popc64(int64_t x) {\n  return __popcll(x);\n}\n\n#else // Not OpenCL or CUDA, but plain C.\n\nstatic int32_t futrts_popc8(uint8_t x) {\n  int c = 0;\n  for (; x; ++c) { x &= x - 1; }\n  return c;\n}\n\nstatic int32_t futrts_popc16(uint16_t x) {\n  int c = 0;\n  for (; x; ++c) { x &= x - 1; }\n  return c;\n}\n\nstatic int32_t futrts_popc32(uint32_t x) {\n  int c = 0;\n  for (; x; ++c) { x &= x - 1; }\n  return c;\n}\n\nstatic int32_t futrts_popc64(uint64_t x) {\n  int c = 0;\n  for (; x; ++c) { x &= x - 1; }\n  return c;\n}\n#endif\n\n#if defined(__OPENCL_VERSION__)\nstatic uint8_t futrts_mul_hi8(uint8_t a, uint8_t b) {\n  return mul_hi(a, b);\n}\n\nstatic uint16_t futrts_mul_hi16(uint16_t a, uint16_t b) {",
                   "\n  return mul_hi(a, b);\n}\n\nstatic uint32_t futrts_mul_hi32(uint32_t a, uint32_t b) {\n  return mul_hi(a, b);\n}\n\nstatic uint64_t futrts_mul_hi64(uint64_t a, uint64_t b) {\n  return mul_hi(a, b);\n}\n\n#elif defined(__CUDA_ARCH__)\n\nstatic uint8_t futrts_mul_hi8(uint8_t a, uint8_t b) {\n  uint16_t aa = a;\n  uint16_t bb = b;\n\n  return aa * bb >> 8;\n}\n\nstatic uint16_t futrts_mul_hi16(uint16_t a, uint16_t b) {\n  uint32_t aa = a;\n  uint32_t bb = b;\n\n  return aa * bb >> 16;\n}\n\nstatic uint32_t futrts_mul_hi32(uint32_t a, uint32_t b) {\n  return mulhi(a, b);\n}\n\nstatic uint64_t futrts_mul_hi64(uint64_t a, uint64_t b) {\n  return mul64hi(a, b);\n}\n\n#else // Not OpenCL or CUDA, but plain C.\n\nstatic uint8_t futrts_mul_hi8(uint8_t a, uint8_t b) {\n  uint16_t aa = a;\n  uint16_t bb = b;\n\n  return aa * bb >> 8;\n}\n\nstatic uint16_t futrts_mul_hi16(uint16_t a, uint16_t b) {\n  uint32_t aa = a;\n  uint32_t bb = b;\n\n  return aa * bb >> 16;\n}\n\nstatic uint32_t futrts_mul_hi32(uint32_t a, uint32_t b) {\n  uint64_t aa = a;\n  uint64_t bb = b;\n\n  return aa * bb >> 32;\n}\n\nstatic uint64_t futrts_mul_hi64(uint64_t a, uint64_t b) {\n  __uint128_t aa = a;\n  __uint128_t bb = b;\n\n  return aa * bb >> 64;\n}\n#endif\n\n#if defined(__OPENCL_VERSION__)\nstatic uint8_t futrts_mad_hi8(uint8_t a, uint8_t b, uint8_t c) {\n  return mad_hi(a, b, c);\n}\n\nstatic uint16_t futrts_mad_hi16(uint16_t a, uint16_t b, uint16_t c) {\n  return mad_hi(a, b, c);\n}\n\nstatic uint32_t futrts_mad_hi32(uint32_t a, uint32_t b, uint32_t c) {\n  return mad_hi(a, b, c);\n}\n\nstatic uint64_t futrts_mad_hi64(uint64_t a, uint64_t b, uint64_t c) {\n  return mad_hi(a, b, c);\n}\n\n#else // Not OpenCL\n\nstatic uint8_t futrts_mad_hi8(uint8_t a, uint8_t b, uint8_t c) {\n  return futrts_mul_hi8(a, b) + c;\n}\n\nstatic uint16_t futrts_mad_hi16(uint16_t a, uint16_t b, uint16_t c) {\n  return futrts_mul_hi16(a, b) + c;\n}\n\nstatic uint32_t futrts_mad_hi32(uint32_t a, uint32_t b, uint32_t c) {\n  return futrts_mul_hi32(a, b) + c;\n}\n\nstatic uint64_t futrts_mad_hi64(uint64_t a, uint64_t",
                   " b, uint64_t c) {\n  return futrts_mul_hi64(a, b) + c;\n}\n#endif\n\n#if defined(__OPENCL_VERSION__)\nstatic int32_t futrts_clzz8(int8_t x) {\n  return clz(x);\n}\n\nstatic int32_t futrts_clzz16(int16_t x) {\n  return clz(x);\n}\n\nstatic int32_t futrts_clzz32(int32_t x) {\n  return clz(x);\n}\n\nstatic int32_t futrts_clzz64(int64_t x) {\n  return clz(x);\n}\n\n#elif defined(__CUDA_ARCH__)\n\nstatic int32_t futrts_clzz8(int8_t x) {\n  return __clz(zext_i8_i32(x)) - 24;\n}\n\nstatic int32_t futrts_clzz16(int16_t x) {\n  return __clz(zext_i16_i32(x)) - 16;\n}\n\nstatic int32_t futrts_clzz32(int32_t x) {\n  return __clz(x);\n}\n\nstatic int32_t futrts_clzz64(int64_t x) {\n  return __clzll(x);\n}\n\n#else // Not OpenCL or CUDA, but plain C.\n\nstatic int32_t futrts_clzz8(int8_t x) {\n  return x == 0 ? 8 : __builtin_clz((uint32_t)zext_i8_i32(x)) - 24;\n}\n\nstatic int32_t futrts_clzz16(int16_t x) {\n  return x == 0 ? 16 : __builtin_clz((uint32_t)zext_i16_i32(x)) - 16;\n}\n\nstatic int32_t futrts_clzz32(int32_t x) {\n  return x == 0 ? 32 : __builtin_clz((uint32_t)x);\n}\n\nstatic int32_t futrts_clzz64(int64_t x) {\n  return x == 0 ? 64 : __builtin_clzll((uint64_t)x);\n}\n#endif\n\n#if defined(__OPENCL_VERSION__)\nstatic int32_t futrts_ctzz8(int8_t x) {\n  int i = 0;\n  for (; i < 8 && (x & 1) == 0; i++, x >>= 1)\n    ;\n  return i;\n}\n\nstatic int32_t futrts_ctzz16(int16_t x) {\n  int i = 0;\n  for (; i < 16 && (x & 1) == 0; i++, x >>= 1)\n    ;\n  return i;\n}\n\nstatic int32_t futrts_ctzz32(int32_t x) {\n  int i = 0;\n  for (; i < 32 && (x & 1) == 0; i++, x >>= 1)\n    ;\n  return i;\n}\n\nstatic int32_t futrts_ctzz64(int64_t x) {\n  int i = 0;\n  for (; i < 64 && (x & 1) == 0; i++, x >>= 1)\n    ;\n  return i;\n}\n\n#elif defined(__CUDA_ARCH__)\n\nstatic int32_t futrts_ctzz8(int8_t x) {\n  int y = __ffs(x);\n  return y == 0 ? 8 : y - 1;\n}\n\nstatic int32_t futrts_ctzz16(int16_t x) {\n  int y = __ffs(x);\n  return y == 0 ? 16 : y - 1;\n}\n\nstatic int32_t futrts_ctzz32(int32_t x) {\n  int y = __ffs(x);\n  return y == 0 ? 32 : y - 1;\n}\n\nstatic int32_t futrts_ctzz64(int",
                   "64_t x) {\n  int y = __ffsll(x);\n  return y == 0 ? 64 : y - 1;\n}\n\n#else // Not OpenCL or CUDA, but plain C.\n\nstatic int32_t futrts_ctzz8(int8_t x) {\n  return x == 0 ? 8 : __builtin_ctz((uint32_t)x);\n}\n\nstatic int32_t futrts_ctzz16(int16_t x) {\n  return x == 0 ? 16 : __builtin_ctz((uint32_t)x);\n}\n\nstatic int32_t futrts_ctzz32(int32_t x) {\n  return x == 0 ? 32 : __builtin_ctz((uint32_t)x);\n}\n\nstatic int32_t futrts_ctzz64(int64_t x) {\n  return x == 0 ? 64 : __builtin_ctzll((uint64_t)x);\n}\n#endif\n\nstatic inline float fdiv32(float x, float y) {\n  return x / y;\n}\n\nstatic inline float fadd32(float x, float y) {\n  return x + y;\n}\n\nstatic inline float fsub32(float x, float y) {\n  return x - y;\n}\n\nstatic inline float fmul32(float x, float y) {\n  return x * y;\n}\n\nstatic inline bool cmplt32(float x, float y) {\n  return x < y;\n}\n\nstatic inline bool cmple32(float x, float y) {\n  return x <= y;\n}\n\nstatic inline float sitofp_i8_f32(int8_t x) {\n  return (float) x;\n}\n\nstatic inline float sitofp_i16_f32(int16_t x) {\n  return (float) x;\n}\n\nstatic inline float sitofp_i32_f32(int32_t x) {\n  return (float) x;\n}\n\nstatic inline float sitofp_i64_f32(int64_t x) {\n  return (float) x;\n}\n\nstatic inline float uitofp_i8_f32(uint8_t x) {\n  return (float) x;\n}\n\nstatic inline float uitofp_i16_f32(uint16_t x) {\n  return (float) x;\n}\n\nstatic inline float uitofp_i32_f32(uint32_t x) {\n  return (float) x;\n}\n\nstatic inline float uitofp_i64_f32(uint64_t x) {\n  return (float) x;\n}\n\nstatic inline int8_t fptosi_f32_i8(float x) {\n  return (int8_t) x;\n}\n\nstatic inline int16_t fptosi_f32_i16(float x) {\n  return (int16_t) x;\n}\n\nstatic inline int32_t fptosi_f32_i32(float x) {\n  return (int32_t) x;\n}\n\nstatic inline int64_t fptosi_f32_i64(float x) {\n  return (int64_t) x;\n}\n\nstatic inline uint8_t fptoui_f32_i8(float x) {\n  return (uint8_t) x;\n}\n\nstatic inline uint16_t fptoui_f32_i16(float x) {\n  return (uint16_t) x;\n}\n\nstatic inline uint32_t fptoui_f32_i32(float x) {\n  return (uint32_t) x;\n}\n\nstatic inline uint64_t fpt",
                   "oui_f32_i64(float x) {\n  return (uint64_t) x;\n}\n\n#ifdef __OPENCL_VERSION__\nstatic inline float fabs32(float x) {\n  return fabs(x);\n}\n\nstatic inline float fmax32(float x, float y) {\n  return fmax(x, y);\n}\n\nstatic inline float fmin32(float x, float y) {\n  return fmin(x, y);\n}\n\nstatic inline float fpow32(float x, float y) {\n  return pow(x, y);\n}\n\n#else // Not OpenCL, but CUDA or plain C.\n\nstatic inline float fabs32(float x) {\n  return fabsf(x);\n}\n\nstatic inline float fmax32(float x, float y) {\n  return fmaxf(x, y);\n}\n\nstatic inline float fmin32(float x, float y) {\n  return fminf(x, y);\n}\n\nstatic inline float fpow32(float x, float y) {\n  return powf(x, y);\n}\n#endif\n\nstatic inline bool futrts_isnan32(float x) {\n  return isnan(x);\n}\n\nstatic inline bool futrts_isinf32(float x) {\n  return isinf(x);\n}\n\n#ifdef __OPENCL_VERSION__\nstatic inline float futrts_log32(float x) {\n  return log(x);\n}\n\nstatic inline float futrts_log2_32(float x) {\n  return log2(x);\n}\n\nstatic inline float futrts_log10_32(float x) {\n  return log10(x);\n}\n\nstatic inline float futrts_sqrt32(float x) {\n  return sqrt(x);\n}\n\nstatic inline float futrts_exp32(float x) {\n  return exp(x);\n}\n\nstatic inline float futrts_cos32(float x) {\n  return cos(x);\n}\n\nstatic inline float futrts_sin32(float x) {\n  return sin(x);\n}\n\nstatic inline float futrts_tan32(float x) {\n  return tan(x);\n}\n\nstatic inline float futrts_acos32(float x) {\n  return acos(x);\n}\n\nstatic inline float futrts_asin32(float x) {\n  return asin(x);\n}\n\nstatic inline float futrts_atan32(float x) {\n  return atan(x);\n}\n\nstatic inline float futrts_cosh32(float x) {\n  return cosh(x);\n}\n\nstatic inline float futrts_sinh32(float x) {\n  return sinh(x);\n}\n\nstatic inline float futrts_tanh32(float x) {\n  return tanh(x);\n}\n\nstatic inline float futrts_acosh32(float x) {\n  return acosh(x);\n}\n\nstatic inline float futrts_asinh32(float x) {\n  return asinh(x);\n}\n\nstatic inline float futrts_atanh32(float x) {\n  return atanh(x);\n}\n\nstatic inline float futrts_atan2_32(float x, fl",
                   "oat y) {\n  return atan2(x, y);\n}\n\nstatic inline float futrts_hypot32(float x, float y) {\n  return hypot(x, y);\n}\n\nstatic inline float futrts_gamma32(float x) {\n  return tgamma(x);\n}\n\nstatic inline float futrts_lgamma32(float x) {\n  return lgamma(x);\n}\n\nstatic inline float fmod32(float x, float y) {\n  return fmod(x, y);\n}\n\nstatic inline float futrts_round32(float x) {\n  return rint(x);\n}\n\nstatic inline float futrts_floor32(float x) {\n  return floor(x);\n}\n\nstatic inline float futrts_ceil32(float x) {\n  return ceil(x);\n}\n\nstatic inline float futrts_lerp32(float v0, float v1, float t) {\n  return mix(v0, v1, t);\n}\n\nstatic inline float futrts_mad32(float a, float b, float c) {\n  return mad(a, b, c);\n}\n\nstatic inline float futrts_fma32(float a, float b, float c) {\n  return fma(a, b, c);\n}\n\n#else // Not OpenCL, but CUDA or plain C.\n\nstatic inline float futrts_log32(float x) {\n  return logf(x);\n}\n\nstatic inline float futrts_log2_32(float x) {\n  return log2f(x);\n}\n\nstatic inline float futrts_log10_32(float x) {\n  return log10f(x);\n}\n\nstatic inline float futrts_sqrt32(float x) {\n  return sqrtf(x);\n}\n\nstatic inline float futrts_exp32(float x) {\n  return expf(x);\n}\n\nstatic inline float futrts_cos32(float x) {\n  return cosf(x);\n}\n\nstatic inline float futrts_sin32(float x) {\n  return sinf(x);\n}\n\nstatic inline float futrts_tan32(float x) {\n  return tanf(x);\n}\n\nstatic inline float futrts_acos32(float x) {\n  return acosf(x);\n}\n\nstatic inline float futrts_asin32(float x) {\n  return asinf(x);\n}\n\nstatic inline float futrts_atan32(float x) {\n  return atanf(x);\n}\n\nstatic inline float futrts_cosh32(float x) {\n  return coshf(x);\n}\n\nstatic inline float futrts_sinh32(float x) {\n  return sinhf(x);\n}\n\nstatic inline float futrts_tanh32(float x) {\n  return tanhf(x);\n}\n\nstatic inline float futrts_acosh32(float x) {\n  return acoshf(x);\n}\n\nstatic inline float futrts_asinh32(float x) {\n  return asinhf(x);\n}\n\nstatic inline float futrts_atanh32(float x) {\n  return atanhf(x);\n}\n\nstatic inline float futr",
                   "ts_atan2_32(float x, float y) {\n  return atan2f(x, y);\n}\n\nstatic inline float futrts_hypot32(float x, float y) {\n  return hypotf(x, y);\n}\n\nstatic inline float futrts_gamma32(float x) {\n  return tgammaf(x);\n}\n\nstatic inline float futrts_lgamma32(float x) {\n  return lgammaf(x);\n}\n\nstatic inline float fmod32(float x, float y) {\n  return fmodf(x, y);\n}\n\nstatic inline float futrts_round32(float x) {\n  return rintf(x);\n}\n\nstatic inline float futrts_floor32(float x) {\n  return floorf(x);\n}\n\nstatic inline float futrts_ceil32(float x) {\n  return ceilf(x);\n}\n\nstatic inline float futrts_lerp32(float v0, float v1, float t) {\n  return v0 + (v1 - v0) * t;\n}\n\nstatic inline float futrts_mad32(float a, float b, float c) {\n  return a * b + c;\n}\n\nstatic inline float futrts_fma32(float a, float b, float c) {\n  return fmaf(a, b, c);\n}\n#endif\n\nstatic inline int32_t futrts_to_bits32(float x) {\n  union {\n    float f;\n    int32_t t;\n  } p;\n\n  p.f = x;\n  return p.t;\n}\n\nstatic inline float futrts_from_bits32(int32_t x) {\n  union {\n    int32_t f;\n    float t;\n  } p;\n\n  p.f = x;\n  return p.t;\n}\n\nstatic inline float fsignum32(float x) {\n  return futrts_isnan32(x) ? x : (x > 0) - (x < 0);\n}\n\n#ifdef FUTHARK_F64_ENABLED\n\nstatic inline double fdiv64(double x, double y) {\n  return x / y;\n}\n\nstatic inline double fadd64(double x, double y) {\n  return x + y;\n}\n\nstatic inline double fsub64(double x, double y) {\n  return x - y;\n}\n\nstatic inline double fmul64(double x, double y) {\n  return x * y;\n}\n\nstatic inline bool cmplt64(double x, double y) {\n  return x < y;\n}\n\nstatic inline bool cmple64(double x, double y) {\n  return x <= y;\n}\n\nstatic inline double sitofp_i8_f64(int8_t x) {\n  return (double) x;\n}\n\nstatic inline double sitofp_i16_f64(int16_t x) {\n  return (double) x;\n}\n\nstatic inline double sitofp_i32_f64(int32_t x) {\n  return (double) x;\n}\n\nstatic inline double sitofp_i64_f64(int64_t x) {\n  return (double) x;\n}\n\nstatic inline double uitofp_i8_f64(uint8_t x) {\n  return (double) x;\n}\n\nstatic inline dou",
                   "ble uitofp_i16_f64(uint16_t x) {\n  return (double) x;\n}\n\nstatic inline double uitofp_i32_f64(uint32_t x) {\n  return (double) x;\n}\n\nstatic inline double uitofp_i64_f64(uint64_t x) {\n  return (double) x;\n}\n\nstatic inline int8_t fptosi_f64_i8(double x) {\n  return (int8_t) x;\n}\n\nstatic inline int16_t fptosi_f64_i16(double x) {\n  return (int16_t) x;\n}\n\nstatic inline int32_t fptosi_f64_i32(double x) {\n  return (int32_t) x;\n}\n\nstatic inline int64_t fptosi_f64_i64(double x) {\n  return (int64_t) x;\n}\n\nstatic inline uint8_t fptoui_f64_i8(double x) {\n  return (uint8_t) x;\n}\n\nstatic inline uint16_t fptoui_f64_i16(double x) {\n  return (uint16_t) x;\n}\n\nstatic inline uint32_t fptoui_f64_i32(double x) {\n  return (uint32_t) x;\n}\n\nstatic inline uint64_t fptoui_f64_i64(double x) {\n  return (uint64_t) x;\n}\n\nstatic inline double fabs64(double x) {\n  return fabs(x);\n}\n\nstatic inline double fmax64(double x, double y) {\n  return fmax(x, y);\n}\n\nstatic inline double fmin64(double x, double y) {\n  return fmin(x, y);\n}\n\nstatic inline double fpow64(double x, double y) {\n  return pow(x, y);\n}\n\nstatic inline double futrts_log64(double x) {\n  return log(x);\n}\n\nstatic inline double futrts_log2_64(double x) {\n  return log2(x);\n}\n\nstatic inline double futrts_log10_64(double x) {\n  return log10(x);\n}\n\nstatic inline double futrts_sqrt64(double x) {\n  return sqrt(x);\n}\n\nstatic inline double futrts_exp64(double x) {\n  return exp(x);\n}\n\nstatic inline double futrts_cos64(double x) {\n  return cos(x);\n}\n\nstatic inline double futrts_sin64(double x) {\n  return sin(x);\n}\n\nstatic inline double futrts_tan64(double x) {\n  return tan(x);\n}\n\nstatic inline double futrts_acos64(double x) {\n  return acos(x);\n}\n\nstatic inline double futrts_asin64(double x) {\n  return asin(x);\n}\n\nstatic inline double futrts_atan64(double x) {\n  return atan(x);\n}\n\nstatic inline double futrts_cosh64(double x) {\n  return cosh(x);\n}\n\nstatic inline double futrts_sinh64(double x) {\n  return sinh(x);\n}\n\nstatic inline double futrts_tanh64(double",
                   " x) {\n  return tanh(x);\n}\n\nstatic inline double futrts_acosh64(double x) {\n  return acosh(x);\n}\n\nstatic inline double futrts_asinh64(double x) {\n  return asinh(x);\n}\n\nstatic inline double futrts_atanh64(double x) {\n  return atanh(x);\n}\n\nstatic inline double futrts_atan2_64(double x, double y) {\n  return atan2(x, y);\n}\n\nstatic inline double futrts_hypot64(double x, double y) {\n  return hypot(x, y);\n}\n\nstatic inline double futrts_gamma64(double x) {\n  return tgamma(x);\n}\n\nstatic inline double futrts_lgamma64(double x) {\n  return lgamma(x);\n}\n\nstatic inline double futrts_fma64(double a, double b, double c) {\n  return fma(a, b, c);\n}\n\nstatic inline double futrts_round64(double x) {\n  return rint(x);\n}\n\nstatic inline double futrts_ceil64(double x) {\n  return ceil(x);\n}\n\nstatic inline double futrts_floor64(double x) {\n  return floor(x);\n}\n\nstatic inline bool futrts_isnan64(double x) {\n  return isnan(x);\n}\n\nstatic inline bool futrts_isinf64(double x) {\n  return isinf(x);\n}\n\nstatic inline int64_t futrts_to_bits64(double x) {\n  union {\n    double f;\n    int64_t t;\n  } p;\n\n  p.f = x;\n  return p.t;\n}\n\nstatic inline double futrts_from_bits64(int64_t x) {\n  union {\n    int64_t f;\n    double t;\n  } p;\n\n  p.f = x;\n  return p.t;\n}\n\nstatic inline double fmod64(double x, double y) {\n  return fmod(x, y);\n}\n\nstatic inline double fsignum64(double x) {\n  return futrts_isnan64(x) ? x : (x > 0) - (x < 0);\n}\n\nstatic inline double futrts_lerp64(double v0, double v1, double t) {\n#ifdef __OPENCL_VERSION__\n  return mix(v0, v1, t);\n#else\n  return v0 + (v1 - v0) * t;\n#endif\n}\n\nstatic inline double futrts_mad64(double a, double b, double c) {\n#ifdef __OPENCL_VERSION__\n  return mad(a, b, c);\n#else\n  return a * b + c;\n#endif\n}\n\nstatic inline float fpconv_f32_f32(float x) {\n  return (float) x;\n}\n\nstatic inline double fpconv_f32_f64(float x) {\n  return (double) x;\n}\n\nstatic inline float fpconv_f64_f32(double x) {\n  return (float) x;\n}\n\nstatic inline double fpconv_f64_f64(double x) {\n  return (double) ",
                   "x;\n}\n\n#endif\n\n// End of scalar.h.\n// Start of scalar_f16.h.\n\n// Half-precision is emulated if needed (e.g. in straight C) with the\n// native type used if possible.  The emulation works by typedef'ing\n// 'float' to 'f16', and then implementing all operations on single\n// precision.  To cut down on duplication, we use the same code for\n// those Futhark functions that require just operators or casts.  The\n// in-memory representation for arrays will still be 16 bits even\n// under emulation, so the compiler will have to be careful when\n// generating reads or writes.\n\n#if !defined(cl_khr_fp16) && !(defined(__CUDA_ARCH__) && __CUDA_ARCH__ >= 600)\n#define EMULATE_F16\n#endif\n\n#if !defined(EMULATE_F16) && defined(__OPENCL_VERSION__)\n#pragma OPENCL EXTENSION cl_khr_fp16 : enable\n#endif\n\n#ifdef EMULATE_F16\n\n// Note that the half-precision storage format is still 16 bits - the\n// compiler will have to be real careful!\ntypedef float f16;\n\n#else\n\n#ifdef __CUDA_ARCH__\n#include <cuda_fp16.h>\n#endif\n\ntypedef half f16;\n\n#endif\n\n// Some of these functions convert to single precision because half\n// precision versions are not available.\n\nstatic inline f16 fadd16(f16 x, f16 y) {\n  return x + y;\n}\n\nstatic inline f16 fsub16(f16 x, f16 y) {\n  return x - y;\n}\n\nstatic inline f16 fmul16(f16 x, f16 y) {\n  return x * y;\n}\n\nstatic inline bool cmplt16(f16 x, f16 y) {\n  return x < y;\n}\n\nstatic inline bool cmple16(f16 x, f16 y) {\n  return x <= y;\n}\n\nstatic inline f16 sitofp_i8_f16(int8_t x) {\n  return (f16) x;\n}\n\nstatic inline f16 sitofp_i16_f16(int16_t x) {\n  return (f16) x;\n}\n\nstatic inline f16 sitofp_i32_f16(int32_t x) {\n  return (f16) x;\n}\n\nstatic inline f16 sitofp_i64_f16(int64_t x) {\n  return (f16) x;\n}\n\nstatic inline f16 uitofp_i8_f16(uint8_t x) {\n  return (f16) x;\n}\n\nstatic inline f16 uitofp_i16_f16(uint16_t x) {\n  return (f16) x;\n}\n\nstatic inline f16 uitofp_i32_f16(uint32_t x) {\n  return (f16) x;\n}\n\nstatic inline f16 uitofp_i64_f16(uint64_t x) {\n  return (f16) x;\n}\n\nstatic inline int8_t fpt",
                   "osi_f16_i8(f16 x) {\n  return (int8_t) (float) x;\n}\n\nstatic inline int16_t fptosi_f16_i16(f16 x) {\n  return (int16_t) x;\n}\n\nstatic inline int32_t fptosi_f16_i32(f16 x) {\n  return (int32_t) x;\n}\n\nstatic inline int64_t fptosi_f16_i64(f16 x) {\n  return (int64_t) x;\n}\n\nstatic inline uint8_t fptoui_f16_i8(f16 x) {\n  return (uint8_t) (float) x;\n}\n\nstatic inline uint16_t fptoui_f16_i16(f16 x) {\n  return (uint16_t) x;\n}\n\nstatic inline uint32_t fptoui_f16_i32(f16 x) {\n  return (uint32_t) x;\n}\n\nstatic inline uint64_t fptoui_f16_i64(f16 x) {\n  return (uint64_t) x;\n}\n\n#ifndef EMULATE_F16\n\n#ifdef __OPENCL_VERSION__\nstatic inline f16 fabs16(f16 x) {\n  return fabs(x);\n}\n\nstatic inline f16 fmax16(f16 x, f16 y) {\n  return fmax(x, y);\n}\n\nstatic inline f16 fmin16(f16 x, f16 y) {\n  return fmin(x, y);\n}\n\nstatic inline f16 fpow16(f16 x, f16 y) {\n  return pow(x, y);\n}\n\n#else // Assuming CUDA.\n\nstatic inline f16 fabs16(f16 x) {\n  return fabsf(x);\n}\n\nstatic inline f16 fmax16(f16 x, f16 y) {\n  return fmaxf(x, y);\n}\n\nstatic inline f16 fmin16(f16 x, f16 y) {\n  return fminf(x, y);\n}\n\nstatic inline f16 fpow16(f16 x, f16 y) {\n  return powf(x, y);\n}\n#endif\n\nstatic inline bool futrts_isnan16(f16 x) {\n  return isnan((float)x);\n}\n\nstatic inline bool futrts_isinf16(f16 x) {\n  return isinf((float)x);\n}\n\n#ifdef __OPENCL_VERSION__\nstatic inline f16 futrts_log16(f16 x) {\n  return log(x);\n}\n\nstatic inline f16 futrts_log2_16(f16 x) {\n  return log2(x);\n}\n\nstatic inline f16 futrts_log10_16(f16 x) {\n  return log10(x);\n}\n\nstatic inline f16 futrts_sqrt16(f16 x) {\n  return sqrt(x);\n}\n\nstatic inline f16 futrts_exp16(f16 x) {\n  return exp(x);\n}\n\nstatic inline f16 futrts_cos16(f16 x) {\n  return cos(x);\n}\n\nstatic inline f16 futrts_sin16(f16 x) {\n  return sin(x);\n}\n\nstatic inline f16 futrts_tan16(f16 x) {\n  return tan(x);\n}\n\nstatic inline f16 futrts_acos16(f16 x) {\n  return acos(x);\n}\n\nstatic inline f16 futrts_asin16(f16 x) {\n  return asin(x);\n}\n\nstatic inline f16 futrts_atan16(f16 x) {\n  return atan(x);\n}\n\nstatic inli",
                   "ne f16 futrts_cosh16(f16 x) {\n  return cosh(x);\n}\n\nstatic inline f16 futrts_sinh16(f16 x) {\n  return sinh(x);\n}\n\nstatic inline f16 futrts_tanh16(f16 x) {\n  return tanh(x);\n}\n\nstatic inline f16 futrts_acosh16(f16 x) {\n  return acosh(x);\n}\n\nstatic inline f16 futrts_asinh16(f16 x) {\n  return asinh(x);\n}\n\nstatic inline f16 futrts_atanh16(f16 x) {\n  return atanh(x);\n}\n\nstatic inline f16 futrts_atan2_16(f16 x, f16 y) {\n  return atan2(x, y);\n}\n\nstatic inline f16 futrts_hypot16(f16 x, f16 y) {\n  return hypot(x, y);\n}\n\nstatic inline f16 futrts_gamma16(f16 x) {\n  return tgamma(x);\n}\n\nstatic inline f16 futrts_lgamma16(f16 x) {\n  return lgamma(x);\n}\n\nstatic inline f16 fmod16(f16 x, f16 y) {\n  return fmod(x, y);\n}\n\nstatic inline f16 futrts_round16(f16 x) {\n  return rint(x);\n}\n\nstatic inline f16 futrts_floor16(f16 x) {\n  return floor(x);\n}\n\nstatic inline f16 futrts_ceil16(f16 x) {\n  return ceil(x);\n}\n\nstatic inline f16 futrts_lerp16(f16 v0, f16 v1, f16 t) {\n  return mix(v0, v1, t);\n}\n\nstatic inline f16 futrts_mad16(f16 a, f16 b, f16 c) {\n  return mad(a, b, c);\n}\n\nstatic inline f16 futrts_fma16(f16 a, f16 b, f16 c) {\n  return fma(a, b, c);\n}\n\n#else // Assume CUDA.\n\nstatic inline f16 futrts_log16(f16 x) {\n  return hlog(x);\n}\n\nstatic inline f16 futrts_log2_16(f16 x) {\n  return hlog2(x);\n}\n\nstatic inline f16 futrts_log10_16(f16 x) {\n  return hlog10(x);\n}\n\nstatic inline f16 futrts_sqrt16(f16 x) {\n  return hsqrt(x);\n}\n\nstatic inline f16 futrts_exp16(f16 x) {\n  return hexp(x);\n}\n\nstatic inline f16 futrts_cos16(f16 x) {\n  return hcos(x);\n}\n\nstatic inline f16 futrts_sin16(f16 x) {\n  return hsin(x);\n}\n\nstatic inline f16 futrts_tan16(f16 x) {\n  return tanf(x);\n}\n\nstatic inline f16 futrts_acos16(f16 x) {\n  return acosf(x);\n}\n\nstatic inline f16 futrts_asin16(f16 x) {\n  return asinf(x);\n}\n\nstatic inline f16 futrts_atan16(f16 x) {\n  return atanf(x);\n}\n\nstatic inline f16 futrts_cosh16(f16 x) {\n  return coshf(x);\n}\n\nstatic inline f16 futrts_sinh16(f16 x) {\n  return sinhf(x);\n}\n\nstatic inline f16 ",
                   "futrts_tanh16(f16 x) {\n  return tanhf(x);\n}\n\nstatic inline f16 futrts_acosh16(f16 x) {\n  return acoshf(x);\n}\n\nstatic inline f16 futrts_asinh16(f16 x) {\n  return asinhf(x);\n}\n\nstatic inline f16 futrts_atanh16(f16 x) {\n  return atanhf(x);\n}\n\nstatic inline f16 futrts_atan2_16(f16 x, f16 y) {\n  return atan2f(x, y);\n}\n\nstatic inline f16 futrts_hypot16(f16 x, f16 y) {\n  return hypotf(x, y);\n}\n\nstatic inline f16 futrts_gamma16(f16 x) {\n  return tgammaf(x);\n}\n\nstatic inline f16 futrts_lgamma16(f16 x) {\n  return lgammaf(x);\n}\n\nstatic inline f16 fmod16(f16 x, f16 y) {\n  return fmodf(x, y);\n}\n\nstatic inline f16 futrts_round16(f16 x) {\n  return rintf(x);\n}\n\nstatic inline f16 futrts_floor16(f16 x) {\n  return hfloor(x);\n}\n\nstatic inline f16 futrts_ceil16(f16 x) {\n  return hceil(x);\n}\n\nstatic inline f16 futrts_lerp16(f16 v0, f16 v1, f16 t) {\n  return v0 + (v1 - v0) * t;\n}\n\nstatic inline f16 futrts_mad16(f16 a, f16 b, f16 c) {\n  return a * b + c;\n}\n\nstatic inline f16 futrts_fma16(f16 a, f16 b, f16 c) {\n  return fmaf(a, b, c);\n}\n\n#endif\n\n// The CUDA __half type cannot be put in unions for some reason, so we\n// use bespoke conversion functions instead.\n#ifdef __CUDA_ARCH__\nstatic inline int16_t futrts_to_bits16(f16 x) {\n  return __half_as_ushort(x);\n}\nstatic inline f16 futrts_from_bits16(int16_t x) {\n  return __ushort_as_half(x);\n}\n#else\nstatic inline int16_t futrts_to_bits16(f16 x) {\n  union {\n    f16 f;\n    int16_t t;\n  } p;\n\n  p.f = x;\n  return p.t;\n}\n\nstatic inline f16 futrts_from_bits16(int16_t x) {\n  union {\n    int16_t f;\n    f16 t;\n  } p;\n\n  p.f = x;\n  return p.t;\n}\n#endif\n\n#else // No native f16 - emulate.\n\nstatic inline f16 fabs16(f16 x) {\n  return fabs32(x);\n}\n\nstatic inline f16 fmax16(f16 x, f16 y) {\n  return fmax32(x, y);\n}\n\nstatic inline f16 fmin16(f16 x, f16 y) {\n  return fmin32(x, y);\n}\n\nstatic inline f16 fpow16(f16 x, f16 y) {\n  return fpow32(x, y);\n}\n\nstatic inline bool futrts_isnan16(f16 x) {\n  return futrts_isnan32(x);\n}\n\nstatic inline bool futrts_isinf16(f16 x) {",
                   "\n  return futrts_isinf32(x);\n}\n\nstatic inline f16 futrts_log16(f16 x) {\n  return futrts_log32(x);\n}\n\nstatic inline f16 futrts_log2_16(f16 x) {\n  return futrts_log2_32(x);\n}\n\nstatic inline f16 futrts_log10_16(f16 x) {\n  return futrts_log10_32(x);\n}\n\nstatic inline f16 futrts_sqrt16(f16 x) {\n  return futrts_sqrt32(x);\n}\n\nstatic inline f16 futrts_exp16(f16 x) {\n  return futrts_exp32(x);\n}\n\nstatic inline f16 futrts_cos16(f16 x) {\n  return futrts_cos32(x);\n}\n\nstatic inline f16 futrts_sin16(f16 x) {\n  return futrts_sin32(x);\n}\n\nstatic inline f16 futrts_tan16(f16 x) {\n  return futrts_tan32(x);\n}\n\nstatic inline f16 futrts_acos16(f16 x) {\n  return futrts_acos32(x);\n}\n\nstatic inline f16 futrts_asin16(f16 x) {\n  return futrts_asin32(x);\n}\n\nstatic inline f16 futrts_atan16(f16 x) {\n  return futrts_atan32(x);\n}\n\nstatic inline f16 futrts_cosh16(f16 x) {\n  return futrts_cosh32(x);\n}\n\nstatic inline f16 futrts_sinh16(f16 x) {\n  return futrts_sinh32(x);\n}\n\nstatic inline f16 futrts_tanh16(f16 x) {\n  return futrts_tanh32(x);\n}\n\nstatic inline f16 futrts_acosh16(f16 x) {\n  return futrts_acosh32(x);\n}\n\nstatic inline f16 futrts_asinh16(f16 x) {\n  return futrts_asinh32(x);\n}\n\nstatic inline f16 futrts_atanh16(f16 x) {\n  return futrts_atanh32(x);\n}\n\nstatic inline f16 futrts_atan2_16(f16 x, f16 y) {\n  return futrts_atan2_32(x, y);\n}\n\nstatic inline f16 futrts_hypot16(f16 x, f16 y) {\n  return futrts_hypot32(x, y);\n}\n\nstatic inline f16 futrts_gamma16(f16 x) {\n  return futrts_gamma32(x);\n}\n\nstatic inline f16 futrts_lgamma16(f16 x) {\n  return futrts_lgamma32(x);\n}\n\nstatic inline f16 fmod16(f16 x, f16 y) {\n  return fmod32(x, y);\n}\n\nstatic inline f16 futrts_round16(f16 x) {\n  return futrts_round32(x);\n}\n\nstatic inline f16 futrts_floor16(f16 x) {\n  return futrts_floor32(x);\n}\n\nstatic inline f16 futrts_ceil16(f16 x) {\n  return futrts_ceil32(x);\n}\n\nstatic inline f16 futrts_lerp16(f16 v0, f16 v1, f16 t) {\n  return futrts_lerp32(v0, v1, t);\n}\n\nstatic inline f16 futrts_mad16(f16 a, f16 b, f16 c) {\n  return f",
                   "utrts_mad32(a, b, c);\n}\n\nstatic inline f16 futrts_fma16(f16 a, f16 b, f16 c) {\n  return futrts_fma32(a, b, c);\n}\n\n// Even when we are using an OpenCL that does not support cl_khr_fp16,\n// it must still support vload_half for actually creating a\n// half-precision number, which can then be efficiently converted to a\n// float.  Similarly for vstore_half.\n#ifdef __OPENCL_VERSION__\n\nstatic inline int16_t futrts_to_bits16(f16 x) {\n  int16_t y;\n  // Violating strict aliasing here.\n  vstore_half((float)x, 0, (half*)&y);\n  return y;\n}\n\nstatic inline f16 futrts_from_bits16(int16_t x) {\n  return (f16)vload_half(0, (half*)&x);\n}\n\n#else\n\nstatic inline int16_t futrts_to_bits16(f16 x) {\n  return (int16_t)float2halfbits(x);\n}\n\nstatic inline f16 futrts_from_bits16(int16_t x) {\n  return halfbits2float((uint16_t)x);\n}\n\nstatic inline f16 fsignum16(f16 x) {\n  return futrts_isnan16(x) ? x : (x > 0) - (x < 0);\n}\n\n#endif\n\n#endif\n\nstatic inline float fpconv_f16_f16(f16 x) {\n  return x;\n}\n\nstatic inline float fpconv_f16_f32(f16 x) {\n  return x;\n}\n\nstatic inline f16 fpconv_f32_f16(float x) {\n  return x;\n}\n\n#ifdef FUTHARK_F64_ENABLED\n\nstatic inline double fpconv_f16_f64(f16 x) {\n  return (double) x;\n}\n\nstatic inline f16 fpconv_f64_f16(double x) {\n  return (f16) x;\n}\n\n#endif\n\n\n// End of scalar_f16.h.\n// Start of atomics.h\n\ninline int32_t atomic_xchg_i32_global(volatile __global int32_t *p, int32_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicExch((int32_t*)p, x);\n#else\n  return atomic_xor(p, x);\n#endif\n}\n\ninline int32_t atomic_xchg_i32_local(volatile __local int32_t *p, int32_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicExch((int32_t*)p, x);\n#else\n  return atomic_xor(p, x);\n#endif\n}\n\ninline int32_t atomic_cmpxchg_i32_global(volatile __global int32_t *p,\n                                         int32_t cmp, int32_t val) {\n#ifdef FUTHARK_CUDA\n  return atomicCAS((int32_t*)p, cmp, val);\n#else\n  return atomic_cmpxchg(p, cmp, val);\n#endif\n}\n\ninline int32_t atomic_cmpxchg_i32_local(volatile __local int32_t *p",
                   ",\n                                        int32_t cmp, int32_t val) {\n#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, int32_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicXor((int32_t*)p, x);\n#else\n  return atomic_xor(p, x);\n#endif\n}\n\ninline int32_t atomic_xor_i32_local(volatile __local int32_t *p, int32_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicXor((int32_t*)p, x);\n#else\n  return atomic_xor(p, x);\n#endif\n}\n\n// Start of 64 bit atomics\n\ninline int64_t atomic_xchg_i64_global(volatile __global int64_t *p, int",
                   "64_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 at",
                   "omicOr((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__kernel void builtinzhreplicate_f64zireplicate_232951(int32_t num_elems_232948,\n                                                       double val_232949,\n                                                       __global\n                                                       unsigned char *mem_232947)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t replicate_gtid_232951;\n    int32_t replicate_ltid_232952;\n    int32_t replicate_gid_232953;\n    \n    replicate_gtid_232951 = get_global_id(0);\n    replicate_ltid_232952 = get_local_id(0);\n    replicate_gid_232953 = get_group_id(0);\n    \n    int64_t slice_232957 = num_elems_232948;\n    int64_t rep_i_232956 = sext_i32_i64(replicate_gtid_232951);\n    int64_t remnant_232958 = sext_i32_i64(replicate_gtid_232951) - rep_i_232956;\n    \n    if (slt64(replicate_gtid_232951, num_elems_232948)) {\n        ((__global double *) mem_232947)[rep_i_232956] = val_232949;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void builtinzhreplicate_i64zireplicate_232534(int32_t num_elems_232531,\n                                                       int64_t val_232532,\n                                                       __global\n                                                       unsigned char *mem_232530)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 ",
                   "= 2;\n    int32_t replicate_gtid_232534;\n    int32_t replicate_ltid_232535;\n    int32_t replicate_gid_232536;\n    \n    replicate_gtid_232534 = get_global_id(0);\n    replicate_ltid_232535 = get_local_id(0);\n    replicate_gid_232536 = get_group_id(0);\n    \n    int64_t slice_232540 = num_elems_232531;\n    int64_t rep_i_232539 = sext_i32_i64(replicate_gtid_232534);\n    int64_t remnant_232541 = sext_i32_i64(replicate_gtid_232534) - rep_i_232539;\n    \n    if (slt64(replicate_gtid_232534, num_elems_232531)) {\n        ((__global int64_t *) mem_232530)[rep_i_232539] = val_232532;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void gpu_map_transpose_f64(__local volatile\n                                    int64_t *block_9_backing_aligned_0,\n                                    int32_t destoffset_1, int32_t srcoffset_3,\n                                    int32_t num_arrays_4, int32_t x_elems_5,\n                                    int32_t y_elems_6, int32_t mulx_7,\n                                    int32_t muly_8, __global\n                                    unsigned char *destmem_0, __global\n                                    unsigned char *srcmem_2)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict block_9_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) block_9_backing_aligned_0;\n    __local unsigned char *block_9;\n    \n    block_9 = (__local unsigned char *) block_9_backing_0;\n    \n    int32_t get_global_id_0_37;\n    \n    get_global_id_0_37 = get_global_id(0);\n    \n    int32_t get_local_id_0_38;\n    \n    get_local_id_0_38 = get_local_id(0);\n    \n    int32_t get_local_id_1_39;\n    \n    get_local_id_1_39 = get_local_id(1);\n    \n    int32_t get_group_id_0_40;\n    \n    get_group_id_0_40 = get_group_id(0);\n    \n    int32_t get_group_id_1_41;\n    \n    get_group_id_1_41 = get_group_id(1);\n    \n    int32_t get_group_id_2_42;\n   ",
                   " \n    get_group_id_2_42 = get_group_id(2);\n    \n    int32_t our_array_offset_30 = get_group_id_2_42 * x_elems_5 * y_elems_6;\n    int32_t odata_offset_33 = squot32(destoffset_1, 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    double val_44;\n    \n    if (slt32(x_index_31, x_elems_5)) {\n        for (int32_t j_43 = 0; j_43 < 4; j_43++) {\n            int32_t index_in_35 = (y_index_32 + j_43 * 8) * x_elems_5 +\n                    x_index_31;\n            \n            if (slt32(y_index_32 + j_43 * 8, y_elems_6)) {\n                val_44 = ((__global\n                           double *) srcmem_2)[sext_i32_i64(idata_offset_34 +\n                                               index_in_35)];\n                ((__local double *) block_9)[sext_i32_i64((get_local_id_1_39 +\n                                                           j_43 * 8) * 33 +\n                                             get_local_id_0_38)] = val_44;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    x_index_31 = get_group_id_1_41 * 32 + get_local_id_0_38;\n    y_index_32 = get_group_id_0_40 * 32 + get_local_id_1_39;\n    if (slt32(x_index_31, y_elems_6)) {\n        for (int32_t j_43 = 0; j_43 < 4; j_43++) {\n            int32_t index_out_36 = (y_index_32 + j_43 * 8) * y_elems_6 +\n                    x_index_31;\n            \n            if (slt32(y_index_32 + j_43 * 8, x_elems_5)) {\n                val_44 = ((__local\n                           double *) block_9)[sext_i32_i64(get_local_id_0_38 *\n                                              33 + get_local_id_1_39 + j_43 *\n                                              8)];\n                ((__global double *) destmem_0)[sext_i32_i64(odata_offset_33 +\n                                                index_out_36)] = val_44;\n            }\n        }\n    }\n    \n  error_0:\n    return;\n}\n",
                   "__kernel void gpu_map_transpose_f64_low_height(__local volatile\n                                               int64_t *block_9_backing_aligned_0,\n                                               int32_t destoffset_1,\n                                               int32_t srcoffset_3,\n                                               int32_t num_arrays_4,\n                                               int32_t x_elems_5,\n                                               int32_t y_elems_6,\n                                               int32_t mulx_7, int32_t muly_8,\n                                               __global\n                                               unsigned char *destmem_0,\n                                               __global unsigned char *srcmem_2)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict block_9_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) block_9_backing_aligned_0;\n    __local unsigned char *block_9;\n    \n    block_9 = (__local unsigned char *) block_9_backing_0;\n    \n    int32_t get_global_id_0_37;\n    \n    get_global_id_0_37 = get_global_id(0);\n    \n    int32_t get_local_id_0_38;\n    \n    get_local_id_0_38 = get_local_id(0);\n    \n    int32_t get_local_id_1_39;\n    \n    get_local_id_1_39 = get_local_id(1);\n    \n    int32_t get_group_id_0_40;\n    \n    get_group_id_0_40 = get_group_id(0);\n    \n    int32_t get_group_id_1_41;\n    \n    get_group_id_1_41 = get_group_id(1);\n    \n    int32_t get_group_id_2_42;\n    \n    get_group_id_2_42 = get_group_id(2);\n    \n    int32_t our_array_offset_30 = get_group_id_2_42 * x_elems_5 * y_elems_6;\n    int32_t odata_offset_33 = squot32(destoffset_1, 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_lo",
                   "cal_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    double val_44;\n    int32_t index_in_35 = y_index_32 * x_elems_5 + x_index_31;\n    \n    if (slt32(x_index_31, x_elems_5) && slt32(y_index_32, y_elems_6)) {\n        val_44 = ((__global double *) srcmem_2)[sext_i32_i64(idata_offset_34 +\n                                                index_in_35)];\n        ((__local double *) block_9)[sext_i32_i64(get_local_id_1_39 * 17 +\n                                     get_local_id_0_38)] = val_44;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    x_index_31 = get_group_id_1_41 * 16 + squot32(get_local_id_0_38, mulx_7);\n    y_index_32 = get_group_id_0_40 * 16 * mulx_7 + get_local_id_1_39 +\n        srem32(get_local_id_0_38, mulx_7) * 16;\n    \n    int32_t index_out_36 = y_index_32 * y_elems_6 + x_index_31;\n    \n    if (slt32(x_index_31, y_elems_6) && slt32(y_index_32, x_elems_5)) {\n        val_44 = ((__local double *) block_9)[sext_i32_i64(get_local_id_0_38 *\n                                              17 + get_local_id_1_39)];\n        ((__global double *) destmem_0)[sext_i32_i64(odata_offset_33 +\n                                        index_out_36)] = val_44;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void gpu_map_transpose_f64_low_width(__local volatile\n                                              int64_t *block_9_backing_aligned_0,\n                                              int32_t destoffset_1,\n                                              int32_t srcoffset_3,\n                                              int32_t num_arrays_4,\n                                              int32_t x_elems_5,\n                                              int32_t y_elems_6, int32_t mulx_7,\n                                              int32_t muly_8, __global\n                                              unsigned char *destmem_0, __global\n                                  ",
                   "            unsigned char *srcmem_2)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict block_9_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) block_9_backing_aligned_0;\n    __local unsigned char *block_9;\n    \n    block_9 = (__local unsigned char *) block_9_backing_0;\n    \n    int32_t get_global_id_0_37;\n    \n    get_global_id_0_37 = get_global_id(0);\n    \n    int32_t get_local_id_0_38;\n    \n    get_local_id_0_38 = get_local_id(0);\n    \n    int32_t get_local_id_1_39;\n    \n    get_local_id_1_39 = get_local_id(1);\n    \n    int32_t get_group_id_0_40;\n    \n    get_group_id_0_40 = get_group_id(0);\n    \n    int32_t get_group_id_1_41;\n    \n    get_group_id_1_41 = get_group_id(1);\n    \n    int32_t get_group_id_2_42;\n    \n    get_group_id_2_42 = get_group_id(2);\n    \n    int32_t our_array_offset_30 = get_group_id_2_42 * x_elems_5 * y_elems_6;\n    int32_t odata_offset_33 = squot32(destoffset_1, 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    double val_44;\n    int32_t index_in_35 = y_index_32 * x_elems_5 + x_index_31;\n    \n    if (slt32(x_index_31, x_elems_5) && slt32(y_index_32, y_elems_6)) {\n        val_44 = ((__global double *) srcmem_2)[sext_i32_i64(idata_offset_34 +\n                                                index_in_35)];\n        ((__local double *) block_9)[sext_i32_i64(get_local_id_1_39 * 17 +\n                                     get_local_id_0_38)] = val_44;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    x_index_31 = get_group_id_1_41 * 16 * muly_8 + get_local_id_0_38 +\n        srem",
                   "32(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        val_44 = ((__local double *) block_9)[sext_i32_i64(get_local_id_0_38 *\n                                              17 + get_local_id_1_39)];\n        ((__global double *) destmem_0)[sext_i32_i64(odata_offset_33 +\n                                        index_out_36)] = val_44;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void gpu_map_transpose_f64_small(__local volatile\n                                          int64_t *block_9_backing_aligned_0,\n                                          int32_t destoffset_1,\n                                          int32_t srcoffset_3,\n                                          int32_t num_arrays_4,\n                                          int32_t x_elems_5, int32_t y_elems_6,\n                                          int32_t mulx_7, int32_t muly_8,\n                                          __global unsigned char *destmem_0,\n                                          __global unsigned char *srcmem_2)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict block_9_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) block_9_backing_aligned_0;\n    __local unsigned char *block_9;\n    \n    block_9 = (__local unsigned char *) block_9_backing_0;\n    \n    int32_t get_global_id_0_37;\n    \n    get_global_id_0_37 = get_global_id(0);\n    \n    int32_t get_local_id_0_38;\n    \n    get_local_id_0_38 = get_local_id(0);\n    \n    int32_t get_local_id_1_39;\n    \n    get_local_id_1_39 = get_local_id(1);\n    \n    int32_t get_group_id_0_40;\n    \n    get_group_id_0_40 = get_group_id(0);\n    \n    int32_t get_group_id_1_41;\n    \n    get_group_id_1_4",
                   "1 = 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    double val_44;\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        val_44 = ((__global double *) srcmem_2)[sext_i32_i64(idata_offset_34 +\n                                                index_in_35)];\n        ((__global double *) destmem_0)[sext_i32_i64(odata_offset_33 +\n                                        index_out_36)] = val_44;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void gpu_map_transpose_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                                    int32_t y_elems_6, int32_t mulx_7,\n                                    int32_t muly_8, __global\n                                    unsigned char *destmem_0, __global\n                                    unsigned char *srcmem_2)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict block_9_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) block_9_backing_aligned_0;\n    __lo",
                   "cal unsigned char *block_9;\n    \n    block_9 = (__local unsigned char *) block_9_backing_0;\n    \n    int32_t get_global_id_0_37;\n    \n    get_global_id_0_37 = get_global_id(0);\n    \n    int32_t get_local_id_0_38;\n    \n    get_local_id_0_38 = get_local_id(0);\n    \n    int32_t get_local_id_1_39;\n    \n    get_local_id_1_39 = get_local_id(1);\n    \n    int32_t get_group_id_0_40;\n    \n    get_group_id_0_40 = get_group_id(0);\n    \n    int32_t get_group_id_1_41;\n    \n    get_group_id_1_41 = get_group_id(1);\n    \n    int32_t get_group_id_2_42;\n    \n    get_group_id_2_42 = get_group_id(2);\n    \n    int32_t our_array_offset_30 = get_group_id_2_42 * x_elems_5 * y_elems_6;\n    int32_t odata_offset_33 = squot32(destoffset_1, 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    int64_t val_44;\n    \n    if (slt32(x_index_31, x_elems_5)) {\n        for (int32_t j_43 = 0; j_43 < 4; j_43++) {\n            int32_t index_in_35 = (y_index_32 + j_43 * 8) * x_elems_5 +\n                    x_index_31;\n            \n            if (slt32(y_index_32 + j_43 * 8, y_elems_6)) {\n                val_44 = ((__global\n                           int64_t *) srcmem_2)[sext_i32_i64(idata_offset_34 +\n                                                index_in_35)];\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)] = val_44;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    x_index_31 = get_group_id_1_41 * 32 + get_local_id_0_38;\n    y_index_32 = get_group_id_0_40 * 32 + get_local_id_1_39;\n    if (slt32(x_index_31, y_elems_6)) {\n        for (int32_t j_43 = 0; j_43 < 4; j_43++) {\n            int32_t index_out_36 = (y_index_32 + j_43 * 8) * y_elems_6 +\n         ",
                   "           x_index_31;\n            \n            if (slt32(y_index_32 + j_43 * 8, x_elems_5)) {\n                val_44 = ((__local\n                           int64_t *) block_9)[sext_i32_i64(get_local_id_0_38 *\n                                               33 + get_local_id_1_39 + j_43 *\n                                               8)];\n                ((__global int64_t *) destmem_0)[sext_i32_i64(odata_offset_33 +\n                                                 index_out_36)] = val_44;\n            }\n        }\n    }\n    \n  error_0:\n    return;\n}\n__kernel void gpu_map_transpose_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                                               unsigned char *destmem_0,\n                                               __global unsigned char *srcmem_2)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict block_9_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) block_9_backing_aligned_0;\n    __local unsigned char *block_9;\n    \n    block_9 = (__local unsigned char *) block_9_backing_0;\n    \n    int32_t get_global_id_0_37;\n    \n    get_global_id_0_37 = get_global_id(0);\n    \n    int32_t get_local_id_0_38;\n    \n    get_local_id_0_38 = get_local_id(0);\n    \n    int32_t get_local_id_1_39;\n    \n    get_local_id_1_39 = get_local_id(1);\n    \n    int32_t get_group_id_0_",
                   "40;\n    \n    get_group_id_0_40 = get_group_id(0);\n    \n    int32_t get_group_id_1_41;\n    \n    get_group_id_1_41 = get_group_id(1);\n    \n    int32_t get_group_id_2_42;\n    \n    get_group_id_2_42 = get_group_id(2);\n    \n    int32_t our_array_offset_30 = get_group_id_2_42 * x_elems_5 * y_elems_6;\n    int32_t odata_offset_33 = squot32(destoffset_1, 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    int64_t val_44;\n    int32_t index_in_35 = y_index_32 * x_elems_5 + x_index_31;\n    \n    if (slt32(x_index_31, x_elems_5) && slt32(y_index_32, y_elems_6)) {\n        val_44 = ((__global int64_t *) srcmem_2)[sext_i32_i64(idata_offset_34 +\n                                                 index_in_35)];\n        ((__local int64_t *) block_9)[sext_i32_i64(get_local_id_1_39 * 17 +\n                                      get_local_id_0_38)] = val_44;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    x_index_31 = get_group_id_1_41 * 16 + squot32(get_local_id_0_38, mulx_7);\n    y_index_32 = get_group_id_0_40 * 16 * mulx_7 + get_local_id_1_39 +\n        srem32(get_local_id_0_38, mulx_7) * 16;\n    \n    int32_t index_out_36 = y_index_32 * y_elems_6 + x_index_31;\n    \n    if (slt32(x_index_31, y_elems_6) && slt32(y_index_32, x_elems_5)) {\n        val_44 = ((__local int64_t *) block_9)[sext_i32_i64(get_local_id_0_38 *\n                                               17 + get_local_id_1_39)];\n        ((__global int64_t *) destmem_0)[sext_i32_i64(odata_offset_33 +\n                                         index_out_36)] = val_44;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void gpu_map_transpose_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 unsigned char *restrict block_9_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) block_9_backing_aligned_0;\n    __local unsigned char *block_9;\n    \n    block_9 = (__local unsigned char *) block_9_backing_0;\n    \n    int32_t get_global_id_0_37;\n    \n    get_global_id_0_37 = get_global_id(0);\n    \n    int32_t get_local_id_0_38;\n    \n    get_local_id_0_38 = get_local_id(0);\n    \n    int32_t get_local_id_1_39;\n    \n    get_local_id_1_39 = get_local_id(1);\n    \n    int32_t get_group_id_0_40;\n    \n    get_group_id_0_40 = get_group_id(0);\n    \n    int32_t get_group_id_1_41;\n    \n    get_group_id_1_41 = get_group_id(1);\n    \n    int32_t get_group_id_2_42;\n    \n    get_group_id_2_42 = get_group_id(2);\n    \n    int32_t our_array_offset_30 = get_group_id_2_42 * x_elems_5 * y_elems_6;\n    int32_t odata_offset_33 = squot32(destoffset_1, 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  ",
                   "  int64_t val_44;\n    int32_t index_in_35 = y_index_32 * x_elems_5 + x_index_31;\n    \n    if (slt32(x_index_31, x_elems_5) && slt32(y_index_32, y_elems_6)) {\n        val_44 = ((__global int64_t *) srcmem_2)[sext_i32_i64(idata_offset_34 +\n                                                 index_in_35)];\n        ((__local int64_t *) block_9)[sext_i32_i64(get_local_id_1_39 * 17 +\n                                      get_local_id_0_38)] = val_44;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    x_index_31 = get_group_id_1_41 * 16 * muly_8 + get_local_id_0_38 +\n        srem32(get_local_id_1_39, muly_8) * 16;\n    y_index_32 = get_group_id_0_40 * 16 + squot32(get_local_id_1_39, muly_8);\n    \n    int32_t index_out_36 = y_index_32 * y_elems_6 + x_index_31;\n    \n    if (slt32(x_index_31, y_elems_6) && slt32(y_index_32, x_elems_5)) {\n        val_44 = ((__local int64_t *) block_9)[sext_i32_i64(get_local_id_0_38 *\n                                               17 + get_local_id_1_39)];\n        ((__global int64_t *) destmem_0)[sext_i32_i64(odata_offset_33 +\n                                         index_out_36)] = val_44;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void gpu_map_transpose_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 unsigned char *restrict block_9_backing_0 =\n                                   (__local volatile",
                   "\n                                    unsigned char *) block_9_backing_aligned_0;\n    __local unsigned char *block_9;\n    \n    block_9 = (__local unsigned char *) block_9_backing_0;\n    \n    int32_t get_global_id_0_37;\n    \n    get_global_id_0_37 = get_global_id(0);\n    \n    int32_t get_local_id_0_38;\n    \n    get_local_id_0_38 = get_local_id(0);\n    \n    int32_t get_local_id_1_39;\n    \n    get_local_id_1_39 = get_local_id(1);\n    \n    int32_t get_group_id_0_40;\n    \n    get_group_id_0_40 = get_group_id(0);\n    \n    int32_t get_group_id_1_41;\n    \n    get_group_id_1_41 = get_group_id(1);\n    \n    int32_t get_group_id_2_42;\n    \n    get_group_id_2_42 = get_group_id(2);\n    \n    int32_t our_array_offset_30 = squot32(get_global_id_0_37, y_elems_6 *\n                                          x_elems_5) * (y_elems_6 * x_elems_5);\n    int32_t x_index_31 = squot32(srem32(get_global_id_0_37, y_elems_6 *\n                                        x_elems_5), y_elems_6);\n    int32_t y_index_32 = srem32(get_global_id_0_37, y_elems_6);\n    int64_t val_44;\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        val_44 = ((__global int64_t *) srcmem_2)[sext_i32_i64(idata_offset_34 +\n                                                 index_in_35)];\n        ((__global int64_t *) destmem_0)[sext_i32_i64(odata_offset_33 +\n                                         index_out_36)] = val_44;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_232552(int64_t n_203572,\n                                int64_t partition_sizze_203667,\n                                int64_t i_203760, __global\n                                unsigned char *mem_229294, __global\n                        ",
                   "        unsigned char *mem_229302)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_232552;\n    int32_t copy_ltid_232553;\n    int32_t copy_gid_232554;\n    \n    copy_gtid_232552 = get_global_id(0);\n    copy_ltid_232553 = get_local_id(0);\n    copy_gid_232554 = get_group_id(0);\n    \n    int64_t slice_232558 = partition_sizze_203667;\n    int64_t copy_i_232557 = sext_i32_i64(copy_gtid_232552);\n    int64_t remnant_232559 = sext_i32_i64(copy_gtid_232552) - copy_i_232557;\n    \n    if (slt64(sext_i32_i64(copy_gtid_232552), partition_sizze_203667)) {\n        int64_t tmp_232560;\n        \n        tmp_232560 = ((__global int64_t *) mem_229294)[i_203760 +\n                                                       copy_i_232557 *\n                                                       n_203572];\n        ((__global int64_t *) mem_229302)[copy_i_232557] = tmp_232560;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_232711(int64_t n_p_203574,\n                                int64_t partition_sizze_203667,\n                                int64_t defunc_0_f_res_203721, int64_t i_203808,\n                                __global unsigned char *mem_229358, __global\n                                unsigned char *mem_229368)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_232711;\n    int32_t copy_ltid_232712;\n    int32_t copy_gid_232713;\n    \n    copy_gtid_232711 = get_global_id(0);\n    copy_ltid_232712 = get_local_id(0);\n    copy_gid_232713 = get_group_id(0);\n    \n    int64_t slice_232718 = n_p_203574;\n    int64_t slice_232719 = partition_sizze_203667 * slice_232718;\n    int64_t copy_i_232716 = squot64(sext_i32_i64(copy_gtid_232711),\n                                    slice_232718);\n    int64_t remnant_232720 = sext_i32_i64(copy_gtid_232711) - copy_i_232716 *\n            slice_232718;\n    int64_t copy_i_232717 = remnant_232720;\n    int64_t remnant_23272",
                   "1 = remnant_232720 - copy_i_232717;\n    \n    if (slt64(sext_i32_i64(copy_gtid_232711), partition_sizze_203667 *\n              n_p_203574)) {\n        int64_t tmp_232722;\n        \n        tmp_232722 = ((__global int64_t *) mem_229358)[i_203808 +\n                                                       (copy_i_232716 *\n                                                        (defunc_0_f_res_203721 *\n                                                         n_p_203574) +\n                                                        copy_i_232717 *\n                                                        defunc_0_f_res_203721)];\n        ((__global int64_t *) mem_229368)[copy_i_232716 * n_p_203574 +\n                                          copy_i_232717] = tmp_232722;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_234634(int64_t n_203572,\n                                int64_t partition_sizze_203667,\n                                int64_t ctx_param_ext_229596,\n                                int64_t ctx_param_ext_229597,\n                                int64_t ctx_param_ext_229599, __global\n                                unsigned char *mem_param_229601, __global\n                                unsigned char *mem_230672)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_234634;\n    int32_t copy_ltid_234635;\n    int32_t copy_gid_234636;\n    \n    copy_gtid_234634 = get_global_id(0);\n    copy_ltid_234635 = get_local_id(0);\n    copy_gid_234636 = get_group_id(0);\n    \n    int64_t slice_234641 = n_203572;\n    int64_t slice_234642 = partition_sizze_203667 * slice_234641;\n    int64_t copy_i_234639 = squot64(sext_i32_i64(copy_gtid_234634),\n                                    slice_234641);\n    int64_t remnant_234643 = sext_i32_i64(copy_gtid_234634) - copy_i_234639 *\n            slice_234641;\n    int64_t copy_i_234640 = remnant_234643;\n    int64_t remnant_234644 = remnant_234643 - copy_i_234640;\n    \n    if (slt6",
                   "4(sext_i32_i64(copy_gtid_234634), partition_sizze_203667 *\n              n_203572)) {\n        double tmp_234645;\n        \n        tmp_234645 = ((__global\n                       double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                   (copy_i_234639 *\n                                                    ctx_param_ext_229597 +\n                                                    copy_i_234640 *\n                                                    ctx_param_ext_229599)];\n        ((__global double *) mem_230672)[copy_i_234640 *\n                                         partition_sizze_203667 +\n                                         copy_i_234639] = tmp_234645;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_234833(int64_t n_203572,\n                                int64_t partition_sizze_203667,\n                                int64_t ctx_param_ext_229596,\n                                int64_t ctx_param_ext_229597,\n                                int64_t ctx_param_ext_229599, __global\n                                unsigned char *mem_param_229601, __global\n                                unsigned char *mem_230730)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_234833;\n    int32_t copy_ltid_234834;\n    int32_t copy_gid_234835;\n    \n    copy_gtid_234833 = get_global_id(0);\n    copy_ltid_234834 = get_local_id(0);\n    copy_gid_234835 = get_group_id(0);\n    \n    int64_t slice_234840 = n_203572;\n    int64_t slice_234841 = partition_sizze_203667 * slice_234840;\n    int64_t copy_i_234838 = squot64(sext_i32_i64(copy_gtid_234833),\n                                    slice_234840);\n    int64_t remnant_234842 = sext_i32_i64(copy_gtid_234833) - copy_i_234838 *\n            slice_234840;\n    int64_t copy_i_234839 = remnant_234842;\n    int64_t remnant_234843 = remnant_234842 - copy_i_234839;\n    \n    if (slt64(sext_i32_i64(copy_gtid_234833), partition_sizze_20366",
                   "7 *\n              n_203572)) {\n        double tmp_234844;\n        \n        tmp_234844 = ((__global\n                       double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                   (copy_i_234838 *\n                                                    ctx_param_ext_229597 +\n                                                    copy_i_234839 *\n                                                    ctx_param_ext_229599)];\n        ((__global double *) mem_230730)[copy_i_234839 *\n                                         partition_sizze_203667 +\n                                         copy_i_234838] = tmp_234844;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_235083(int64_t n_203572,\n                                int64_t partition_sizze_203667,\n                                int64_t ctx_param_ext_229596,\n                                int64_t ctx_param_ext_229597,\n                                int64_t ctx_param_ext_229599, __global\n                                unsigned char *mem_param_229601, __global\n                                unsigned char *mem_230837)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_235083;\n    int32_t copy_ltid_235084;\n    int32_t copy_gid_235085;\n    \n    copy_gtid_235083 = get_global_id(0);\n    copy_ltid_235084 = get_local_id(0);\n    copy_gid_235085 = get_group_id(0);\n    \n    int64_t slice_235090 = n_203572;\n    int64_t slice_235091 = partition_sizze_203667 * slice_235090;\n    int64_t copy_i_235088 = squot64(sext_i32_i64(copy_gtid_235083),\n                                    slice_235090);\n    int64_t remnant_235092 = sext_i32_i64(copy_gtid_235083) - copy_i_235088 *\n            slice_235090;\n    int64_t copy_i_235089 = remnant_235092;\n    int64_t remnant_235093 = remnant_235092 - copy_i_235089;\n    \n    if (slt64(sext_i32_i64(copy_gtid_235083), partition_sizze_203667 *\n              n_203572)) {\n        double tmp_23509",
                   "4;\n        \n        tmp_235094 = ((__global\n                       double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                   (copy_i_235088 *\n                                                    ctx_param_ext_229597 +\n                                                    copy_i_235089 *\n                                                    ctx_param_ext_229599)];\n        ((__global double *) mem_230837)[copy_i_235089 *\n                                         partition_sizze_203667 +\n                                         copy_i_235088] = tmp_235094;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_235461(int64_t n_203572,\n                                int64_t partition_sizze_203667,\n                                int64_t ctx_param_ext_229596,\n                                int64_t ctx_param_ext_229597,\n                                int64_t ctx_param_ext_229599, __global\n                                unsigned char *mem_param_229601, __global\n                                unsigned char *mem_231047)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_235461;\n    int32_t copy_ltid_235462;\n    int32_t copy_gid_235463;\n    \n    copy_gtid_235461 = get_global_id(0);\n    copy_ltid_235462 = get_local_id(0);\n    copy_gid_235463 = get_group_id(0);\n    \n    int64_t slice_235468 = n_203572;\n    int64_t slice_235469 = partition_sizze_203667 * slice_235468;\n    int64_t copy_i_235466 = squot64(sext_i32_i64(copy_gtid_235461),\n                                    slice_235468);\n    int64_t remnant_235470 = sext_i32_i64(copy_gtid_235461) - copy_i_235466 *\n            slice_235468;\n    int64_t copy_i_235467 = remnant_235470;\n    int64_t remnant_235471 = remnant_235470 - copy_i_235467;\n    \n    if (slt64(sext_i32_i64(copy_gtid_235461), partition_sizze_203667 *\n              n_203572)) {\n        double tmp_235472;\n        \n        tmp_235472 = ((__global\n           ",
                   "            double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                   (copy_i_235466 *\n                                                    ctx_param_ext_229597 +\n                                                    copy_i_235467 *\n                                                    ctx_param_ext_229599)];\n        ((__global double *) mem_231047)[copy_i_235467 *\n                                         partition_sizze_203667 +\n                                         copy_i_235466] = tmp_235472;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_235683(int64_t n_203572,\n                                int64_t partition_sizze_203667,\n                                int64_t ctx_param_ext_229596,\n                                int64_t ctx_param_ext_229597,\n                                int64_t ctx_param_ext_229599, __global\n                                unsigned char *mem_param_229601, __global\n                                unsigned char *mem_231167)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_235683;\n    int32_t copy_ltid_235684;\n    int32_t copy_gid_235685;\n    \n    copy_gtid_235683 = get_global_id(0);\n    copy_ltid_235684 = get_local_id(0);\n    copy_gid_235685 = get_group_id(0);\n    \n    int64_t slice_235690 = n_203572;\n    int64_t slice_235691 = partition_sizze_203667 * slice_235690;\n    int64_t copy_i_235688 = squot64(sext_i32_i64(copy_gtid_235683),\n                                    slice_235690);\n    int64_t remnant_235692 = sext_i32_i64(copy_gtid_235683) - copy_i_235688 *\n            slice_235690;\n    int64_t copy_i_235689 = remnant_235692;\n    int64_t remnant_235693 = remnant_235692 - copy_i_235689;\n    \n    if (slt64(sext_i32_i64(copy_gtid_235683), partition_sizze_203667 *\n              n_203572)) {\n        double tmp_235694;\n        \n        tmp_235694 = ((__global\n                       double *) mem_param_229601)[ctx_param_ext_2",
                   "29596 +\n                                                   (copy_i_235688 *\n                                                    ctx_param_ext_229597 +\n                                                    copy_i_235689 *\n                                                    ctx_param_ext_229599)];\n        ((__global double *) mem_231167)[copy_i_235689 *\n                                         partition_sizze_203667 +\n                                         copy_i_235688] = tmp_235694;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_235956(int64_t n_203572,\n                                int64_t partition_sizze_203667,\n                                int64_t ctx_param_ext_229596,\n                                int64_t ctx_param_ext_229597,\n                                int64_t ctx_param_ext_229599, __global\n                                unsigned char *mem_param_229601, __global\n                                unsigned char *mem_231336)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_235956;\n    int32_t copy_ltid_235957;\n    int32_t copy_gid_235958;\n    \n    copy_gtid_235956 = get_global_id(0);\n    copy_ltid_235957 = get_local_id(0);\n    copy_gid_235958 = get_group_id(0);\n    \n    int64_t slice_235963 = n_203572;\n    int64_t slice_235964 = partition_sizze_203667 * slice_235963;\n    int64_t copy_i_235961 = squot64(sext_i32_i64(copy_gtid_235956),\n                                    slice_235963);\n    int64_t remnant_235965 = sext_i32_i64(copy_gtid_235956) - copy_i_235961 *\n            slice_235963;\n    int64_t copy_i_235962 = remnant_235965;\n    int64_t remnant_235966 = remnant_235965 - copy_i_235962;\n    \n    if (slt64(sext_i32_i64(copy_gtid_235956), partition_sizze_203667 *\n              n_203572)) {\n        double tmp_235967;\n        \n        tmp_235967 = ((__global\n                       double *) mem_param_229601)[ctx_param_ext_229596 +\n                                               ",
                   "    (copy_i_235961 *\n                                                    ctx_param_ext_229597 +\n                                                    copy_i_235962 *\n                                                    ctx_param_ext_229599)];\n        ((__global double *) mem_231336)[copy_i_235962 *\n                                         partition_sizze_203667 +\n                                         copy_i_235961] = tmp_235967;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainziscan_stage1_206957(__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_232371_backing_aligned_0,\n                                       int64_t m_203571, int64_t n_203572,\n                                       int64_t n_p_203574,\n                                       int64_t defunc_0_f_res_203592,\n                                       int64_t num_threads_232195,\n                                       int32_t num_threads_232365, __global\n                                       unsigned char *mem_229242, __global\n                                       unsigned char *mem_229260, __global\n                                       unsigned char *mem_229263, __global\n                                       unsigned char *mem_229265, __global\n                                       unsigned char *color_232074)\n{\n    #define segscan_group_sizze_206952 (mainzisegscan_group_sizze_206951)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict scan_arr_mem_232371_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_232371_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_232366;\n    int32_t local_tid_232367;\n    int64_t group_sizze_232370;\n    int32_t wave_sizze_232369;\n    int32_t group_tid_232368;\n    \n    global_tid_232366 = get_global_id(0);\n    local_tid_232367 = get_local_id(0);\n    group_sizze_232370 = get_local_size(0);\n    wave_sizze_232369 = LOCKSTEP_WIDTH;\n    group_tid_232368 = get_group_id(0);\n    \n    int32_t phys_tid_206957 = global_tid_232366;\n    __local unsigned char *scan_arr_mem_232371;\n    \n    scan_arr_mem_232371 = (__local\n                           unsigned char *) scan_arr_mem_232371_backing_0;\n    \n    int64_t x_203630;\n    int64_t y_203631;\n    \n    x_203630 = (int64_t) 0;\n    for (int64_t j_232373 = 0; j_232373 < sdiv_up64(m_203571,\n                                                    sext_i32_i64(num_threads_232365));\n         j_232373++) {\n        int64_t chunk_offset_232374 = segscan_group_sizze_206952 * j_232373 +\n                sext_i32_i64(group_tid_232368) * (segscan_group_sizze_206952 *\n                                                  sdiv_up64(m_203571,\n                                                            sext_i32_i64(num_threads_232365)));\n        int64_t flat_idx_232375 = chunk_offset_232374 +\n                sext_i32_i64(local_tid_232367);\n        int64_t gtid_206956 = flat_idx_232375;\n        \n        // threads in bounds read input\n        {\n            if (slt64(gtid_206956, m_203571)) {\n                bool defunc_2_reduce_res_203634;\n                bool redout_228738 = 0;\n                \n                for (int64_t i_228739 = 0; i_228739 < n_p_203574; i_228739++) {\n                    for (int64_t i_229013 = 0; i_229013 < defunc_0_f_res_203592;\n                         i_229013++) {\n                        int64_t x_203641 = mul64(n_p_203574, i_229013);\n                        int64_t",
                   " idx_203642 = add64(x_203641, i_228739);\n                        bool cond_203643 = sle64(n_203572, idx_203642);\n                        bool defunc_0_f_res_203644;\n                        \n                        if (cond_203643) {\n                            defunc_0_f_res_203644 = 1;\n                        } else {\n                            bool x_203645 = sle64((int64_t) 0, idx_203642);\n                            bool y_203646 = slt64(idx_203642, n_203572);\n                            bool bounds_check_203647 = x_203645 && y_203646;\n                            bool index_certs_203648;\n                            \n                            if (!bounds_check_203647) {\n                                {\n                                    if (atomic_cmpxchg_i32_global(global_failure,\n                                                                  -1, 0) ==\n                                        -1) {\n                                        global_failure_args[0] =\n                                            (int64_t) idx_203642;\n                                        global_failure_args[1] =\n                                            (int64_t) n_203572;\n                                        ;\n                                    }\n                                    local_failure = true;\n                                    goto error_0;\n                                }\n                            }\n                            \n                            double isnan_arg_203649;\n                            \n                            isnan_arg_203649 = ((__global\n                                                 double *) mem_229242)[idx_203642 *\n                                                                       m_203571 +\n                                                                       gtid_206956];\n                            \n                            bool isnan_res_203650;\n                            \n                            isnan_re",
                   "s_203650 = futrts_isnan64(isnan_arg_203649);\n                            defunc_0_f_res_203644 = isnan_res_203650;\n                        }\n                        ((__global bool *) color_232074)[phys_tid_206957 +\n                                                         i_229013 *\n                                                         num_threads_232195] =\n                            defunc_0_f_res_203644;\n                    }\n                    \n                    bool defunc_2_reduce_res_203652;\n                    bool redout_229015 = 1;\n                    \n                    for (int64_t i_229016 = 0; i_229016 < defunc_0_f_res_203592;\n                         i_229016++) {\n                        bool x_203656;\n                        \n                        x_203656 = ((__global\n                                     bool *) color_232074)[phys_tid_206957 +\n                                                           i_229016 *\n                                                           num_threads_232195];\n                        \n                        bool x_203655 = x_203656 && redout_229015;\n                        bool redout_tmp_232378 = x_203655;\n                        \n                        redout_229015 = redout_tmp_232378;\n                    }\n                    defunc_2_reduce_res_203652 = redout_229015;\n                    \n                    bool defunc_1_op_res_203637 = defunc_2_reduce_res_203652 ||\n                         redout_228738;\n                    bool redout_tmp_232376 = defunc_1_op_res_203637;\n                    \n                    redout_228738 = redout_tmp_232376;\n                }\n                defunc_2_reduce_res_203634 = redout_228738;\n                \n                int64_t defunc_2_lifted_lambda_res_203657 =\n                        btoi_bool_i64(defunc_2_reduce_res_203634);\n                bool is_i_203658 = defunc_2_lifted_lambda_res_203657 ==\n                     (int64_t) 0;\n                bool cond_neg_203",
                   "659 = !is_i_203658;\n                int64_t part_res_203660 = btoi_bool_i64(cond_neg_203659);\n                int64_t part_res_203661 = btoi_bool_i64(is_i_203658);\n                \n                // write to-scan values to parameters\n                {\n                    y_203631 = part_res_203661;\n                }\n                // write mapped values results to global memory\n                {\n                    ((__global int64_t *) mem_229263)[gtid_206956] =\n                        part_res_203660;\n                    ((__global bool *) mem_229265)[gtid_206956] =\n                        defunc_2_reduce_res_203634;\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_206956, m_203571)) {\n                    y_203631 = (int64_t) 0;\n                }\n            }\n            // combine with carry and write to local memory\n            {\n                int64_t zz_203632 = x_203630 + y_203631;\n                \n                ((__local\n                  int64_t *) scan_arr_mem_232371)[sext_i32_i64(local_tid_232367)] =\n                    zz_203632;\n            }\n            \n          error_0:\n            barrier(CLK_LOCAL_MEM_FENCE);\n            if (local_failure)\n                return;\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            int64_t x_232379;\n            int64_t y_232380;\n            int64_t x_232382;\n            int64_t y_232383;\n            bool ltid_in_bounds_232385 = slt64(sext_i32_i64(local_tid_232367),\n                                               segscan_group_sizze_206952);\n            int32_t skip_threads_232386;\n            \n            // read input for in-block scan\n            {\n                if (ltid_in_bounds_232385) {\n                    y_232380 = ((volatile __local\n                                 int64_t *) scan_arr_mem_232371)[sext_i32_i64(loca",
                   "l_tid_232367)];\n                    if ((local_tid_232367 - squot32(local_tid_232367, 32) *\n                         32) == 0) {\n                        x_232379 = y_232380;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_232386 = 1;\n                while (slt32(skip_threads_232386, 32)) {\n                    bool thread_active_232387 = sle32(skip_threads_232386,\n                                                      local_tid_232367 -\n                                                      squot32(local_tid_232367,\n                                                              32) * 32) &&\n                         ltid_in_bounds_232385;\n                    \n                    if (thread_active_232387) {\n                        // read operands\n                        {\n                            x_232379 = ((volatile __local\n                                         int64_t *) scan_arr_mem_232371)[sext_i32_i64(local_tid_232367) -\n                                                                         sext_i32_i64(skip_threads_232386)];\n                        }\n                    }\n                    // perform operation\n                    {\n                        if (thread_active_232387) {\n                            int64_t zz_232381 = x_232379 + y_232380;\n                            \n                            x_232379 = zz_232381;\n                        }\n                    }\n                    if (sle32(wave_sizze_232369, skip_threads_232386)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_232387) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) scan_arr_mem_232371)[sext_i32_i64(local_tid_232367)] =\n                                x_232379;\n                            y_232",
                   "380 = x_232379;\n                        }\n                    }\n                    if (sle32(wave_sizze_232369, skip_threads_232386)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_232386 *= 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_232367 - squot32(local_tid_232367, 32) * 32) ==\n                    31 && ltid_in_bounds_232385) {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_232371)[sext_i32_i64(squot32(local_tid_232367,\n                                                                           32))] =\n                        x_232379;\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_232388;\n                \n                // read input for in-block scan\n                {\n                    if (squot32(local_tid_232367, 32) == 0 &&\n                        ltid_in_bounds_232385) {\n                        y_232383 = ((volatile __local\n                                     int64_t *) scan_arr_mem_232371)[sext_i32_i64(local_tid_232367)];\n                        if ((local_tid_232367 - squot32(local_tid_232367, 32) *\n                             32) == 0) {\n                            x_232382 = y_232383;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_232388 = 1;\n                    while (slt32(skip_threads_232388, 32)) {\n                        bool thread_active_232389 = sle32(skip_threads_232388,\n                                                          local_tid_232367 -\n                                             ",
                   "             squot32(local_tid_232367,\n                                                                  32) * 32) &&\n                             (squot32(local_tid_232367, 32) == 0 &&\n                              ltid_in_bounds_232385);\n                        \n                        if (thread_active_232389) {\n                            // read operands\n                            {\n                                x_232382 = ((volatile __local\n                                             int64_t *) scan_arr_mem_232371)[sext_i32_i64(local_tid_232367) -\n                                                                             sext_i32_i64(skip_threads_232388)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            if (thread_active_232389) {\n                                int64_t zz_232384 = x_232382 + y_232383;\n                                \n                                x_232382 = zz_232384;\n                            }\n                        }\n                        if (sle32(wave_sizze_232369, skip_threads_232388)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_232389) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  int64_t *) scan_arr_mem_232371)[sext_i32_i64(local_tid_232367)] =\n                                    x_232382;\n                                y_232383 = x_232382;\n                            }\n                        }\n                        if (sle32(wave_sizze_232369, skip_threads_232388)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_232388 *= 2;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n           ",
                   " bool no_carry_in_232390 = squot32(local_tid_232367, 32) == 0 ||\n                 !ltid_in_bounds_232385;\n            \n            // carry-in for every block except the first\n            {\n                // read operands\n                {\n                    if (!no_carry_in_232390) {\n                        y_232380 = x_232379;\n                        x_232379 = ((__local\n                                     int64_t *) scan_arr_mem_232371)[sext_i32_i64(squot32(local_tid_232367,\n                                                                                          32)) -\n                                                                     (int64_t) 1];\n                    }\n                }\n                // perform operation\n                {\n                    if (!no_carry_in_232390) {\n                        int64_t zz_232381 = x_232379 + y_232380;\n                        \n                        x_232379 = zz_232381;\n                    }\n                }\n                // write final result\n                {\n                    if (!no_carry_in_232390) {\n                        ((__local\n                          int64_t *) scan_arr_mem_232371)[sext_i32_i64(local_tid_232367)] =\n                            x_232379;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // restore correct values for first block\n            {\n                if (squot32(local_tid_232367, 32) == 0 &&\n                    ltid_in_bounds_232385) {\n                    ((__local\n                      int64_t *) scan_arr_mem_232371)[sext_i32_i64(local_tid_232367)] =\n                        y_232380;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // threads in bounds write partial scan result\n            {\n                if (slt64(gtid_206956, m_203571)) {\n                    int64_t tmp_232391;\n                    \n                    tmp_232391 = ((__local\n                           ",
                   "        int64_t *) scan_arr_mem_232371)[sext_i32_i64(local_tid_232367)];\n                    ((__global int64_t *) mem_229260)[gtid_206956] = tmp_232391;\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_232392 = 0;\n                bool should_load_carry_232393 = local_tid_232367 == 0 &&\n                     !crosses_segment_232392;\n                \n                if (should_load_carry_232393) {\n                    x_203630 = ((__local\n                                 int64_t *) scan_arr_mem_232371)[segscan_group_sizze_206952 -\n                                                                 (int64_t) 1];\n                }\n                if (!should_load_carry_232393) {\n                    x_203630 = (int64_t) 0;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    \n  error_1:\n    return;\n    #undef segscan_group_sizze_206952\n}\n__kernel void mainziscan_stage1_207097(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_232473_backing_aligned_0,\n                                       int64_t n_203572,\n                                       int64_t partition_sizze_203667,\n                                       int32_t num_threads_232467, __global\n                                       unsigned char *mem_229269, __global\n                                       unsigned char *mem_229294)\n{\n    #define segscan_group_sizze_207091 (mainzisegscan_group_sizze_207071)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict scan_arr_mem_232473_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_232473_backing_aligned_0;\n    \n    if (*",
                   "global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232468;\n    int32_t local_tid_232469;\n    int64_t group_sizze_232472;\n    int32_t wave_sizze_232471;\n    int32_t group_tid_232470;\n    \n    global_tid_232468 = get_global_id(0);\n    local_tid_232469 = get_local_id(0);\n    group_sizze_232472 = get_local_size(0);\n    wave_sizze_232471 = LOCKSTEP_WIDTH;\n    group_tid_232470 = get_group_id(0);\n    \n    int32_t phys_tid_207097 = global_tid_232468;\n    __local unsigned char *scan_arr_mem_232473;\n    \n    scan_arr_mem_232473 = (__local\n                           unsigned char *) scan_arr_mem_232473_backing_0;\n    \n    int64_t x_207098;\n    int64_t x_207099;\n    \n    x_207098 = (int64_t) 0;\n    for (int64_t j_232475 = 0; j_232475 < sdiv_up64(partition_sizze_203667 *\n                                                    n_203572,\n                                                    sext_i32_i64(num_threads_232467));\n         j_232475++) {\n        int64_t chunk_offset_232476 = segscan_group_sizze_207091 * j_232475 +\n                sext_i32_i64(group_tid_232470) * (segscan_group_sizze_207091 *\n                                                  sdiv_up64(partition_sizze_203667 *\n                                                            n_203572,\n                                                            sext_i32_i64(num_threads_232467)));\n        int64_t flat_idx_232477 = chunk_offset_232476 +\n                sext_i32_i64(local_tid_232469);\n        int64_t gtid_207095 = squot64(flat_idx_232477, n_203572);\n        int64_t gtid_207096 = flat_idx_232477 - squot64(flat_idx_232477,\n                                                        n_203572) * n_203572;\n        \n        // threads in bounds read input\n        {\n            if (slt64(gtid_207095, partition_sizze_203667) && slt64(gtid_207096,\n                                                                    n_203572)) {\n                double x_207102;\n                \n                x_207102 = ((__global double ",
                   "*) mem_229269)[gtid_207095 *\n                                                            n_203572 +\n                                                            gtid_207096];\n                \n                bool isnan_res_207103;\n                \n                isnan_res_207103 = futrts_isnan64(x_207102);\n                \n                bool defunc_0_p_res_207104 = !isnan_res_207103;\n                int64_t defunc_0_f_res_207105 =\n                        btoi_bool_i64(defunc_0_p_res_207104);\n                \n                // write to-scan values to parameters\n                {\n                    x_207099 = defunc_0_f_res_207105;\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_207095, partition_sizze_203667) &&\n                      slt64(gtid_207096, n_203572))) {\n                    x_207099 = (int64_t) 0;\n                }\n            }\n            // combine with carry and write to local memory\n            {\n                int64_t defunc_1_op_res_207100 = add64(x_207098, x_207099);\n                \n                ((__local\n                  int64_t *) scan_arr_mem_232473)[sext_i32_i64(local_tid_232469)] =\n                    defunc_1_op_res_207100;\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            int64_t x_232478;\n            int64_t x_232479;\n            int64_t x_232481;\n            int64_t x_232482;\n            bool ltid_in_bounds_232484 = slt64(sext_i32_i64(local_tid_232469),\n                                               segscan_group_sizze_207091);\n            int32_t skip_threads_232485;\n            \n            // read input for in-block scan\n            {\n                if (ltid_in_bounds_232484) {\n                    x_232479 = ((volatile __local\n            ",
                   "                     int64_t *) scan_arr_mem_232473)[sext_i32_i64(local_tid_232469)];\n                    if ((local_tid_232469 - squot32(local_tid_232469, 32) *\n                         32) == 0) {\n                        x_232478 = x_232479;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_232485 = 1;\n                while (slt32(skip_threads_232485, 32)) {\n                    bool thread_active_232486 = sle32(skip_threads_232485,\n                                                      local_tid_232469 -\n                                                      squot32(local_tid_232469,\n                                                              32) * 32) &&\n                         ltid_in_bounds_232484;\n                    \n                    if (thread_active_232486) {\n                        // read operands\n                        {\n                            x_232478 = ((volatile __local\n                                         int64_t *) scan_arr_mem_232473)[sext_i32_i64(local_tid_232469) -\n                                                                         sext_i32_i64(skip_threads_232485)];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_232487 =\n                             slt64(srem64(sext_i32_i64(local_tid_232469) +\n                                          chunk_offset_232476, n_203572),\n                                   sext_i32_i64(local_tid_232469) +\n                                   chunk_offset_232476 -\n                                   (sext_i32_i64(local_tid_232469 -\n                                    skip_threads_232485) +\n                                    chunk_offset_232476));\n                        \n                        if (thread_active_232486 && inactive_232487) {\n                            x_232478 = x_232479;\n       ",
                   "                 }\n                        if (thread_active_232486) {\n                            if (!inactive_232487) {\n                                int64_t defunc_1_op_res_232480 = add64(x_232478,\n                                                                       x_232479);\n                                \n                                x_232478 = defunc_1_op_res_232480;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_232471, skip_threads_232485)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_232486) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) scan_arr_mem_232473)[sext_i32_i64(local_tid_232469)] =\n                                x_232478;\n                            x_232479 = x_232478;\n                        }\n                    }\n                    if (sle32(wave_sizze_232471, skip_threads_232485)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_232485 *= 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_232469 - squot32(local_tid_232469, 32) * 32) ==\n                    31 && ltid_in_bounds_232484) {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_232473)[sext_i32_i64(squot32(local_tid_232469,\n                                                                           32))] =\n                        x_232478;\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_232488;\n                \n             ",
                   "   // read input for in-block scan\n                {\n                    if (squot32(local_tid_232469, 32) == 0 &&\n                        ltid_in_bounds_232484) {\n                        x_232482 = ((volatile __local\n                                     int64_t *) scan_arr_mem_232473)[sext_i32_i64(local_tid_232469)];\n                        if ((local_tid_232469 - squot32(local_tid_232469, 32) *\n                             32) == 0) {\n                            x_232481 = x_232482;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_232488 = 1;\n                    while (slt32(skip_threads_232488, 32)) {\n                        bool thread_active_232489 = sle32(skip_threads_232488,\n                                                          local_tid_232469 -\n                                                          squot32(local_tid_232469,\n                                                                  32) * 32) &&\n                             (squot32(local_tid_232469, 32) == 0 &&\n                              ltid_in_bounds_232484);\n                        \n                        if (thread_active_232489) {\n                            // read operands\n                            {\n                                x_232481 = ((volatile __local\n                                             int64_t *) scan_arr_mem_232473)[sext_i32_i64(local_tid_232469) -\n                                                                             sext_i32_i64(skip_threads_232488)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_232490 =\n                                 slt64(srem64(sext_i32_i64(local_tid_232469 *\n                                              32 + 32 - 1) +\n                                              chunk_offset_23",
                   "2476, n_203572),\n                                       sext_i32_i64(local_tid_232469 * 32 + 32 -\n                                       1) + chunk_offset_232476 -\n                                       (sext_i32_i64((local_tid_232469 -\n                                                      skip_threads_232488) *\n                                        32 + 32 - 1) + chunk_offset_232476));\n                            \n                            if (thread_active_232489 && inactive_232490) {\n                                x_232481 = x_232482;\n                            }\n                            if (thread_active_232489) {\n                                if (!inactive_232490) {\n                                    int64_t defunc_1_op_res_232483 =\n                                            add64(x_232481, x_232482);\n                                    \n                                    x_232481 = defunc_1_op_res_232483;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_232471, skip_threads_232488)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_232489) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  int64_t *) scan_arr_mem_232473)[sext_i32_i64(local_tid_232469)] =\n                                    x_232481;\n                                x_232482 = x_232481;\n                            }\n                        }\n                        if (sle32(wave_sizze_232471, skip_threads_232488)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_232488 *= 2;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            bool no_carry_in_232491 = squot32(local_tid_23",
                   "2469, 32) == 0 ||\n                 !ltid_in_bounds_232484;\n            \n            // carry-in for every block except the first\n            {\n                // read operands\n                {\n                    if (!no_carry_in_232491) {\n                        x_232479 = x_232478;\n                        x_232478 = ((__local\n                                     int64_t *) scan_arr_mem_232473)[sext_i32_i64(squot32(local_tid_232469,\n                                                                                          32)) -\n                                                                     (int64_t) 1];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_232492 =\n                         slt64(srem64(sext_i32_i64(local_tid_232469) +\n                                      chunk_offset_232476, n_203572),\n                               sext_i32_i64(local_tid_232469) +\n                               chunk_offset_232476 -\n                               (sext_i32_i64(squot32(local_tid_232469, 32) *\n                                32 - 1) + chunk_offset_232476));\n                    \n                    if (!no_carry_in_232491) {\n                        if (inactive_232492) {\n                            x_232478 = x_232479;\n                        }\n                    }\n                    if (!no_carry_in_232491) {\n                        if (!inactive_232492) {\n                            int64_t defunc_1_op_res_232480 = add64(x_232478,\n                                                                   x_232479);\n                            \n                            x_232478 = defunc_1_op_res_232480;\n                        }\n                    }\n                }\n                // write final result\n                {\n                    if (!no_carry_in_232491) {\n                        ((__local\n                          int64_t *) scan_arr_mem_232473)[sext_i32_i64(local_tid_23246",
                   "9)] =\n                            x_232478;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // restore correct values for first block\n            {\n                if (squot32(local_tid_232469, 32) == 0 &&\n                    ltid_in_bounds_232484) {\n                    ((__local\n                      int64_t *) scan_arr_mem_232473)[sext_i32_i64(local_tid_232469)] =\n                        x_232479;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // threads in bounds write partial scan result\n            {\n                if (slt64(gtid_207095, partition_sizze_203667) &&\n                    slt64(gtid_207096, n_203572)) {\n                    int64_t tmp_232493;\n                    \n                    tmp_232493 = ((__local\n                                   int64_t *) scan_arr_mem_232473)[sext_i32_i64(local_tid_232469)];\n                    ((__global int64_t *) mem_229294)[gtid_207095 * n_203572 +\n                                                      gtid_207096] = tmp_232493;\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_232494 = slt64(srem64(chunk_offset_232476 +\n                                                           segscan_group_sizze_207091,\n                                                           n_203572),\n                                                    chunk_offset_232476 +\n                                                    segscan_group_sizze_207091 -\n                                                    (chunk_offset_232476 +\n                                                     segscan_group_sizze_207091 -\n                                                     (int64_t) 1));\n                bool should_load_carry_232495 = local_tid_232469 == 0 &&\n                     !crosses_segment_232494;\n     ",
                   "           \n                if (should_load_carry_232495) {\n                    x_207098 = ((__local\n                                 int64_t *) scan_arr_mem_232473)[segscan_group_sizze_207091 -\n                                                                 (int64_t) 1];\n                }\n                if (!should_load_carry_232495) {\n                    x_207098 = (int64_t) 0;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    \n  error_1:\n    return;\n    #undef segscan_group_sizze_207091\n}\n__kernel void mainziscan_stage1_207649(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_232642_backing_aligned_0,\n                                       int64_t n_p_203574,\n                                       int64_t partition_sizze_203667,\n                                       int64_t defunc_0_f_res_203721,\n                                       int32_t num_threads_232636, __global\n                                       unsigned char *mem_229314, __global\n                                       unsigned char *mem_229358)\n{\n    #define segscan_group_sizze_207642 (mainzisegscan_group_sizze_207509)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict scan_arr_mem_232642_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_232642_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232637;\n    int32_t local_tid_232638;\n    int64_t group_sizze_232641;\n    int32_t wave_sizze_232640;\n    int32_t group_tid_232639;\n    \n    global_tid_232637 = get_global_id(0);\n    local_tid_232638 = get_local_id(0);\n    group_sizze_232641 = get_local_size(0);\n    wave_sizze_232640 = LOCKSTEP_WIDTH;\n    group_tid_232639 = get_group_id(0);\n    \n    int32",
                   "_t phys_tid_207649 = global_tid_232637;\n    __local unsigned char *scan_arr_mem_232642;\n    \n    scan_arr_mem_232642 = (__local\n                           unsigned char *) scan_arr_mem_232642_backing_0;\n    \n    int64_t x_207650;\n    int64_t x_207651;\n    \n    x_207650 = (int64_t) 0;\n    for (int64_t j_232644 = 0; j_232644 < sdiv_up64(partition_sizze_203667 *\n                                                    n_p_203574 *\n                                                    defunc_0_f_res_203721,\n                                                    sext_i32_i64(num_threads_232636));\n         j_232644++) {\n        int64_t chunk_offset_232645 = segscan_group_sizze_207642 * j_232644 +\n                sext_i32_i64(group_tid_232639) * (segscan_group_sizze_207642 *\n                                                  sdiv_up64(partition_sizze_203667 *\n                                                            n_p_203574 *\n                                                            defunc_0_f_res_203721,\n                                                            sext_i32_i64(num_threads_232636)));\n        int64_t flat_idx_232646 = chunk_offset_232645 +\n                sext_i32_i64(local_tid_232638);\n        int64_t gtid_207646 = squot64(flat_idx_232646, n_p_203574 *\n                                      defunc_0_f_res_203721);\n        int64_t gtid_207647 = squot64(flat_idx_232646 - squot64(flat_idx_232646,\n                                                                n_p_203574 *\n                                                                defunc_0_f_res_203721) *\n                                      (n_p_203574 * defunc_0_f_res_203721),\n                                      defunc_0_f_res_203721);\n        int64_t gtid_207648 = flat_idx_232646 - squot64(flat_idx_232646,\n                                                        n_p_203574 *\n                                                        defunc_0_f_res_203721) *\n                (n_p_203574 * defunc_0_f_res_203721)",
                   " - squot64(flat_idx_232646 -\n                                                               squot64(flat_idx_232646,\n                                                                       n_p_203574 *\n                                                                       defunc_0_f_res_203721) *\n                                                               (n_p_203574 *\n                                                                defunc_0_f_res_203721),\n                                                               defunc_0_f_res_203721) *\n                defunc_0_f_res_203721;\n        \n        // threads in bounds read input\n        {\n            if ((slt64(gtid_207646, partition_sizze_203667) &&\n                 slt64(gtid_207647, n_p_203574)) && slt64(gtid_207648,\n                                                          defunc_0_f_res_203721)) {\n                double x_207655;\n                \n                x_207655 = ((__global double *) mem_229314)[gtid_207646 *\n                                                            (defunc_0_f_res_203721 *\n                                                             n_p_203574) +\n                                                            gtid_207647 *\n                                                            defunc_0_f_res_203721 +\n                                                            gtid_207648];\n                \n                bool isnan_res_207656;\n                \n                isnan_res_207656 = futrts_isnan64(x_207655);\n                \n                bool defunc_0_p_res_207657 = !isnan_res_207656;\n                int64_t defunc_0_f_res_207658 =\n                        btoi_bool_i64(defunc_0_p_res_207657);\n                \n                // write to-scan values to parameters\n                {\n                    x_207651 = defunc_0_f_res_207658;\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_207646, partition_sizze_203667) &&\n                       slt64(gtid_207647, n_p_203574)) && slt64(gtid_207648,\n                                                                defunc_0_f_res_203721))) {\n                    x_207651 = (int64_t) 0;\n                }\n            }\n            // combine with carry and write to local memory\n            {\n                int64_t defunc_1_op_res_207652 = add64(x_207650, x_207651);\n                \n                ((__local\n                  int64_t *) scan_arr_mem_232642)[sext_i32_i64(local_tid_232638)] =\n                    defunc_1_op_res_207652;\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            int64_t x_232647;\n            int64_t x_232648;\n            int64_t x_232650;\n            int64_t x_232651;\n            bool ltid_in_bounds_232653 = slt64(sext_i32_i64(local_tid_232638),\n                                               segscan_group_sizze_207642);\n            int32_t skip_threads_232654;\n            \n            // read input for in-block scan\n            {\n                if (ltid_in_bounds_232653) {\n                    x_232648 = ((volatile __local\n                                 int64_t *) scan_arr_mem_232642)[sext_i32_i64(local_tid_232638)];\n                    if ((local_tid_232638 - squot32(local_tid_232638, 32) *\n                         32) == 0) {\n                        x_232647 = x_232648;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_232654 = 1;\n                while (slt32(skip_threads_232654, 32)) {\n                    bool thread_active_232655 = sle32(skip_threads_232654,\n                                                      local_tid_232638 -\n                                                      squot3",
                   "2(local_tid_232638,\n                                                              32) * 32) &&\n                         ltid_in_bounds_232653;\n                    \n                    if (thread_active_232655) {\n                        // read operands\n                        {\n                            x_232647 = ((volatile __local\n                                         int64_t *) scan_arr_mem_232642)[sext_i32_i64(local_tid_232638) -\n                                                                         sext_i32_i64(skip_threads_232654)];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_232656 =\n                             slt64(srem64(sext_i32_i64(local_tid_232638) +\n                                          chunk_offset_232645,\n                                          defunc_0_f_res_203721),\n                                   sext_i32_i64(local_tid_232638) +\n                                   chunk_offset_232645 -\n                                   (sext_i32_i64(local_tid_232638 -\n                                    skip_threads_232654) +\n                                    chunk_offset_232645));\n                        \n                        if (thread_active_232655 && inactive_232656) {\n                            x_232647 = x_232648;\n                        }\n                        if (thread_active_232655) {\n                            if (!inactive_232656) {\n                                int64_t defunc_1_op_res_232649 = add64(x_232647,\n                                                                       x_232648);\n                                \n                                x_232647 = defunc_1_op_res_232649;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_232640, skip_threads_232654)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n          ",
                   "          if (thread_active_232655) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) scan_arr_mem_232642)[sext_i32_i64(local_tid_232638)] =\n                                x_232647;\n                            x_232648 = x_232647;\n                        }\n                    }\n                    if (sle32(wave_sizze_232640, skip_threads_232654)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_232654 *= 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_232638 - squot32(local_tid_232638, 32) * 32) ==\n                    31 && ltid_in_bounds_232653) {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_232642)[sext_i32_i64(squot32(local_tid_232638,\n                                                                           32))] =\n                        x_232647;\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_232657;\n                \n                // read input for in-block scan\n                {\n                    if (squot32(local_tid_232638, 32) == 0 &&\n                        ltid_in_bounds_232653) {\n                        x_232651 = ((volatile __local\n                                     int64_t *) scan_arr_mem_232642)[sext_i32_i64(local_tid_232638)];\n                        if ((local_tid_232638 - squot32(local_tid_232638, 32) *\n                             32) == 0) {\n                            x_232650 = x_232651;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n   ",
                   "             {\n                    skip_threads_232657 = 1;\n                    while (slt32(skip_threads_232657, 32)) {\n                        bool thread_active_232658 = sle32(skip_threads_232657,\n                                                          local_tid_232638 -\n                                                          squot32(local_tid_232638,\n                                                                  32) * 32) &&\n                             (squot32(local_tid_232638, 32) == 0 &&\n                              ltid_in_bounds_232653);\n                        \n                        if (thread_active_232658) {\n                            // read operands\n                            {\n                                x_232650 = ((volatile __local\n                                             int64_t *) scan_arr_mem_232642)[sext_i32_i64(local_tid_232638) -\n                                                                             sext_i32_i64(skip_threads_232657)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_232659 =\n                                 slt64(srem64(sext_i32_i64(local_tid_232638 *\n                                              32 + 32 - 1) +\n                                              chunk_offset_232645,\n                                              defunc_0_f_res_203721),\n                                       sext_i32_i64(local_tid_232638 * 32 + 32 -\n                                       1) + chunk_offset_232645 -\n                                       (sext_i32_i64((local_tid_232638 -\n                                                      skip_threads_232657) *\n                                        32 + 32 - 1) + chunk_offset_232645));\n                            \n                            if (thread_active_232658 && inactive_232659) {\n                                x_232650 = x_232651;\n               ",
                   "             }\n                            if (thread_active_232658) {\n                                if (!inactive_232659) {\n                                    int64_t defunc_1_op_res_232652 =\n                                            add64(x_232650, x_232651);\n                                    \n                                    x_232650 = defunc_1_op_res_232652;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_232640, skip_threads_232657)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_232658) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  int64_t *) scan_arr_mem_232642)[sext_i32_i64(local_tid_232638)] =\n                                    x_232650;\n                                x_232651 = x_232650;\n                            }\n                        }\n                        if (sle32(wave_sizze_232640, skip_threads_232657)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_232657 *= 2;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            bool no_carry_in_232660 = squot32(local_tid_232638, 32) == 0 ||\n                 !ltid_in_bounds_232653;\n            \n            // carry-in for every block except the first\n            {\n                // read operands\n                {\n                    if (!no_carry_in_232660) {\n                        x_232648 = x_232647;\n                        x_232647 = ((__local\n                                     int64_t *) scan_arr_mem_232642)[sext_i32_i64(squot32(local_tid_232638,\n                                                                                          32)) -\n                            ",
                   "                                         (int64_t) 1];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_232661 =\n                         slt64(srem64(sext_i32_i64(local_tid_232638) +\n                                      chunk_offset_232645,\n                                      defunc_0_f_res_203721),\n                               sext_i32_i64(local_tid_232638) +\n                               chunk_offset_232645 -\n                               (sext_i32_i64(squot32(local_tid_232638, 32) *\n                                32 - 1) + chunk_offset_232645));\n                    \n                    if (!no_carry_in_232660) {\n                        if (inactive_232661) {\n                            x_232647 = x_232648;\n                        }\n                    }\n                    if (!no_carry_in_232660) {\n                        if (!inactive_232661) {\n                            int64_t defunc_1_op_res_232649 = add64(x_232647,\n                                                                   x_232648);\n                            \n                            x_232647 = defunc_1_op_res_232649;\n                        }\n                    }\n                }\n                // write final result\n                {\n                    if (!no_carry_in_232660) {\n                        ((__local\n                          int64_t *) scan_arr_mem_232642)[sext_i32_i64(local_tid_232638)] =\n                            x_232647;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // restore correct values for first block\n            {\n                if (squot32(local_tid_232638, 32) == 0 &&\n                    ltid_in_bounds_232653) {\n                    ((__local\n                      int64_t *) scan_arr_mem_232642)[sext_i32_i64(local_tid_232638)] =\n                        x_232648;\n                }\n            }\n            barrie",
                   "r(CLK_LOCAL_MEM_FENCE);\n            // threads in bounds write partial scan result\n            {\n                if ((slt64(gtid_207646, partition_sizze_203667) &&\n                     slt64(gtid_207647, n_p_203574)) && slt64(gtid_207648,\n                                                              defunc_0_f_res_203721)) {\n                    int64_t tmp_232662;\n                    \n                    tmp_232662 = ((__local\n                                   int64_t *) scan_arr_mem_232642)[sext_i32_i64(local_tid_232638)];\n                    ((__global int64_t *) mem_229358)[gtid_207646 *\n                                                      (defunc_0_f_res_203721 *\n                                                       n_p_203574) +\n                                                      gtid_207647 *\n                                                      defunc_0_f_res_203721 +\n                                                      gtid_207648] = tmp_232662;\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_232663 = slt64(srem64(chunk_offset_232645 +\n                                                           segscan_group_sizze_207642,\n                                                           defunc_0_f_res_203721),\n                                                    chunk_offset_232645 +\n                                                    segscan_group_sizze_207642 -\n                                                    (chunk_offset_232645 +\n                                                     segscan_group_sizze_207642 -\n                                                     (int64_t) 1));\n                bool should_load_carry_232664 = local_tid_232638 == 0 &&\n                     !crosses_segment_232663;\n                \n                if (should_load_carry_232664) {\n                    x_207650 = ((__local\n    ",
                   "                             int64_t *) scan_arr_mem_232642)[segscan_group_sizze_207642 -\n                                                                 (int64_t) 1];\n                }\n                if (!should_load_carry_232664) {\n                    x_207650 = (int64_t) 0;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    \n  error_1:\n    return;\n    #undef segscan_group_sizze_207642\n}\n__kernel void mainziscan_stage1_218773(__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_234288_backing_aligned_0,\n                                       int64_t n_p_203574,\n                                       double i64_res_203589,\n                                       int64_t partition_sizze_203667,\n                                       int64_t C_len_203724,\n                                       int64_t lifted_single_ma_l_arg_204224,\n                                       int32_t num_threads_234282, __global\n                                       unsigned char *mem_230608, __global\n                                       unsigned char *ext_mem_230620, __global\n                                       unsigned char *mem_230625)\n{\n    #define segscan_group_sizze_218767 (mainzisegscan_group_sizze_218731)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict scan_arr_mem_234288_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_234288_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_f",
                   "ailure = false;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t global_tid_234283;\n    int32_t local_tid_234284;\n    int64_t group_sizze_234287;\n    int32_t wave_sizze_234286;\n    int32_t group_tid_234285;\n    \n    global_tid_234283 = get_global_id(0);\n    local_tid_234284 = get_local_id(0);\n    group_sizze_234287 = get_local_size(0);\n    wave_sizze_234286 = LOCKSTEP_WIDTH;\n    group_tid_234285 = get_group_id(0);\n    \n    int32_t phys_tid_218773 = global_tid_234283;\n    __local unsigned char *scan_arr_mem_234288;\n    \n    scan_arr_mem_234288 = (__local\n                           unsigned char *) scan_arr_mem_234288_backing_0;\n    \n    double x_218774;\n    double x_218775;\n    \n    x_218774 = 0.0;\n    for (int64_t j_234290 = 0; j_234290 < sdiv_up64(partition_sizze_203667 *\n                                                    lifted_single_ma_l_arg_204224,\n                                                    sext_i32_i64(num_threads_234282));\n         j_234290++) {\n        int64_t chunk_offset_234291 = segscan_group_sizze_218767 * j_234290 +\n                sext_i32_i64(group_tid_234285) * (segscan_group_sizze_218767 *\n                                                  sdiv_up64(partition_sizze_203667 *\n                                                            lifted_single_ma_l_arg_204224,\n                                                            sext_i32_i64(num_threads_234282)));\n        int64_t flat_idx_234292 = chunk_offset_234291 +\n                sext_i32_i64(local_tid_234284);\n        int64_t gtid_218771 = squot64(flat_idx_234292,\n                                      lifted_single_ma_l_arg_204224);\n        int64_t gtid_218772 = flat_idx_234292 - squot64(flat_idx_234292,\n                                                        lifted_single_ma_l_arg_204224) *\n                lifted_single_ma_l_arg_204224;\n        \n        // threads in bounds read input\n        {\n            if (slt64(gtid_218771, partition_sizze_203667) && slt64(gtid_218772,\n              ",
                   "                                                      lifted_single_ma_l_arg_204224)) {\n                bool cond_218780 = gtid_218772 == (int64_t) 0;\n                double defunc_0_f_res_218781;\n                \n                if (cond_218780) {\n                    double x_218778;\n                    \n                    x_218778 = ((__global\n                                 double *) ext_mem_230620)[gtid_218771];\n                    \n                    double defunc_0_f_res_t_res_218782 = x_218778 /\n                           i64_res_203589;\n                    \n                    defunc_0_f_res_218781 = defunc_0_f_res_t_res_218782;\n                } else {\n                    int64_t x_218783 = add64(n_p_203574, gtid_218772);\n                    int64_t i_218784 = sub64(x_218783, (int64_t) 1);\n                    bool x_218785 = sle64((int64_t) 0, i_218784);\n                    bool y_218786 = slt64(i_218784, C_len_203724);\n                    bool bounds_check_218787 = x_218785 && y_218786;\n                    bool index_certs_218788;\n                    \n                    if (!bounds_check_218787) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          44) == -1) {\n                                global_failure_args[0] = (int64_t) i_218784;\n                                global_failure_args[1] = (int64_t) C_len_203724;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double x_218789;\n                    \n                    x_218789 = ((__global double *) mem_230608)[gtid_218771 *\n                                                                C_len_203724 +\n                                                                i_218784];\n                    \n  ",
                   "                  int64_t i_218790 = sub64(gtid_218772, (int64_t) 1);\n                    bool x_218791 = sle64((int64_t) 0, i_218790);\n                    bool y_218792 = slt64(i_218790, C_len_203724);\n                    bool bounds_check_218793 = x_218791 && y_218792;\n                    bool index_certs_218794;\n                    \n                    if (!bounds_check_218793) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          45) == -1) {\n                                global_failure_args[0] = (int64_t) i_218790;\n                                global_failure_args[1] = (int64_t) C_len_203724;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double y_218795;\n                    \n                    y_218795 = ((__global double *) mem_230608)[gtid_218771 *\n                                                                C_len_203724 +\n                                                                i_218790];\n                    \n                    double x_218796 = x_218789 - y_218795;\n                    double defunc_0_f_res_f_res_218797 = x_218796 /\n                           i64_res_203589;\n                    \n                    defunc_0_f_res_218781 = defunc_0_f_res_f_res_218797;\n                }\n                // write to-scan values to parameters\n                {\n                    x_218775 = defunc_0_f_res_218781;\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_218771, partition_sizze_20366",
                   "7) &&\n                      slt64(gtid_218772, lifted_single_ma_l_arg_204224))) {\n                    x_218775 = 0.0;\n                }\n            }\n            // combine with carry and write to local memory\n            {\n                double defunc_1_op_res_218776 = x_218774 + x_218775;\n                \n                ((__local\n                  double *) scan_arr_mem_234288)[sext_i32_i64(local_tid_234284)] =\n                    defunc_1_op_res_218776;\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            double x_234293;\n            double x_234294;\n            double x_234296;\n            double x_234297;\n            bool ltid_in_bounds_234299 = slt64(sext_i32_i64(local_tid_234284),\n                                               segscan_group_sizze_218767);\n            int32_t skip_threads_234300;\n            \n            // read input for in-block scan\n            {\n                if (ltid_in_bounds_234299) {\n                    x_234294 = ((volatile __local\n                                 double *) scan_arr_mem_234288)[sext_i32_i64(local_tid_234284)];\n                    if ((local_tid_234284 - squot32(local_tid_234284, 32) *\n                         32) == 0) {\n                        x_234293 = x_234294;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_234300 = 1;\n                while (slt32(skip_threads_234300, 32)) {\n                    bool thread_active_234301 = sle32(skip_threads_234300,\n                                                      local_tid_234284 -\n                                                      squot32(local_tid_234284,\n                                                              32) * 32) &&\n                         ltid_in_bounds_234299;\n                    \n        ",
                   "            if (thread_active_234301) {\n                        // read operands\n                        {\n                            x_234293 = ((volatile __local\n                                         double *) scan_arr_mem_234288)[sext_i32_i64(local_tid_234284) -\n                                                                        sext_i32_i64(skip_threads_234300)];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234302 =\n                             slt64(srem64(sext_i32_i64(local_tid_234284) +\n                                          chunk_offset_234291,\n                                          lifted_single_ma_l_arg_204224),\n                                   sext_i32_i64(local_tid_234284) +\n                                   chunk_offset_234291 -\n                                   (sext_i32_i64(local_tid_234284 -\n                                    skip_threads_234300) +\n                                    chunk_offset_234291));\n                        \n                        if (thread_active_234301 && inactive_234302) {\n                            x_234293 = x_234294;\n                        }\n                        if (thread_active_234301) {\n                            if (!inactive_234302) {\n                                double defunc_1_op_res_234295 = x_234293 +\n                                       x_234294;\n                                \n                                x_234293 = defunc_1_op_res_234295;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_234286, skip_threads_234300)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_234301) {\n                        // write result\n                        {\n                            ((volatile __local\n                              double *) scan_arr_mem_2",
                   "34288)[sext_i32_i64(local_tid_234284)] =\n                                x_234293;\n                            x_234294 = x_234293;\n                        }\n                    }\n                    if (sle32(wave_sizze_234286, skip_threads_234300)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_234300 *= 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_234284 - squot32(local_tid_234284, 32) * 32) ==\n                    31 && ltid_in_bounds_234299) {\n                    ((volatile __local\n                      double *) scan_arr_mem_234288)[sext_i32_i64(squot32(local_tid_234284,\n                                                                          32))] =\n                        x_234293;\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_234303;\n                \n                // read input for in-block scan\n                {\n                    if (squot32(local_tid_234284, 32) == 0 &&\n                        ltid_in_bounds_234299) {\n                        x_234297 = ((volatile __local\n                                     double *) scan_arr_mem_234288)[sext_i32_i64(local_tid_234284)];\n                        if ((local_tid_234284 - squot32(local_tid_234284, 32) *\n                             32) == 0) {\n                            x_234296 = x_234297;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_234303 = 1;\n                    while (slt32(skip_threads_234303, 32)) {\n                        bool thread_active_234304 = sle32(skip_threads_234303,\n         ",
                   "                                                 local_tid_234284 -\n                                                          squot32(local_tid_234284,\n                                                                  32) * 32) &&\n                             (squot32(local_tid_234284, 32) == 0 &&\n                              ltid_in_bounds_234299);\n                        \n                        if (thread_active_234304) {\n                            // read operands\n                            {\n                                x_234296 = ((volatile __local\n                                             double *) scan_arr_mem_234288)[sext_i32_i64(local_tid_234284) -\n                                                                            sext_i32_i64(skip_threads_234303)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234305 =\n                                 slt64(srem64(sext_i32_i64(local_tid_234284 *\n                                              32 + 32 - 1) +\n                                              chunk_offset_234291,\n                                              lifted_single_ma_l_arg_204224),\n                                       sext_i32_i64(local_tid_234284 * 32 + 32 -\n                                       1) + chunk_offset_234291 -\n                                       (sext_i32_i64((local_tid_234284 -\n                                                      skip_threads_234303) *\n                                        32 + 32 - 1) + chunk_offset_234291));\n                            \n                            if (thread_active_234304 && inactive_234305) {\n                                x_234296 = x_234297;\n                            }\n                            if (thread_active_234304) {\n                                if (!inactive_234305) {\n                                    double defunc_1_op_res_234298 = x_234296",
                   " +\n                                           x_234297;\n                                    \n                                    x_234296 = defunc_1_op_res_234298;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_234286, skip_threads_234303)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234304) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) scan_arr_mem_234288)[sext_i32_i64(local_tid_234284)] =\n                                    x_234296;\n                                x_234297 = x_234296;\n                            }\n                        }\n                        if (sle32(wave_sizze_234286, skip_threads_234303)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_234303 *= 2;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            bool no_carry_in_234306 = squot32(local_tid_234284, 32) == 0 ||\n                 !ltid_in_bounds_234299;\n            \n            // carry-in for every block except the first\n            {\n                // read operands\n                {\n                    if (!no_carry_in_234306) {\n                        x_234294 = x_234293;\n                        x_234293 = ((__local\n                                     double *) scan_arr_mem_234288)[sext_i32_i64(squot32(local_tid_234284,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_234307 =\n                      ",
                   "   slt64(srem64(sext_i32_i64(local_tid_234284) +\n                                      chunk_offset_234291,\n                                      lifted_single_ma_l_arg_204224),\n                               sext_i32_i64(local_tid_234284) +\n                               chunk_offset_234291 -\n                               (sext_i32_i64(squot32(local_tid_234284, 32) *\n                                32 - 1) + chunk_offset_234291));\n                    \n                    if (!no_carry_in_234306) {\n                        if (inactive_234307) {\n                            x_234293 = x_234294;\n                        }\n                    }\n                    if (!no_carry_in_234306) {\n                        if (!inactive_234307) {\n                            double defunc_1_op_res_234295 = x_234293 + x_234294;\n                            \n                            x_234293 = defunc_1_op_res_234295;\n                        }\n                    }\n                }\n                // write final result\n                {\n                    if (!no_carry_in_234306) {\n                        ((__local\n                          double *) scan_arr_mem_234288)[sext_i32_i64(local_tid_234284)] =\n                            x_234293;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // restore correct values for first block\n            {\n                if (squot32(local_tid_234284, 32) == 0 &&\n                    ltid_in_bounds_234299) {\n                    ((__local\n                      double *) scan_arr_mem_234288)[sext_i32_i64(local_tid_234284)] =\n                        x_234294;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // threads in bounds write partial scan result\n            {\n                if (slt64(gtid_218771, partition_sizze_203667) &&\n                    slt64(gtid_218772, lifted_single_ma_l_arg_204224)) {\n                    double tmp_234308;\n        ",
                   "            \n                    tmp_234308 = ((__local\n                                   double *) scan_arr_mem_234288)[sext_i32_i64(local_tid_234284)];\n                    ((__global double *) mem_230625)[gtid_218771 *\n                                                     lifted_single_ma_l_arg_204224 +\n                                                     gtid_218772] = tmp_234308;\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_234309 = slt64(srem64(chunk_offset_234291 +\n                                                           segscan_group_sizze_218767,\n                                                           lifted_single_ma_l_arg_204224),\n                                                    chunk_offset_234291 +\n                                                    segscan_group_sizze_218767 -\n                                                    (chunk_offset_234291 +\n                                                     segscan_group_sizze_218767 -\n                                                     (int64_t) 1));\n                bool should_load_carry_234310 = local_tid_234284 == 0 &&\n                     !crosses_segment_234309;\n                \n                if (should_load_carry_234310) {\n                    x_218774 = ((__local\n                                 double *) scan_arr_mem_234288)[segscan_group_sizze_218767 -\n                                                                (int64_t) 1];\n                }\n                if (!should_load_carry_234310) {\n                    x_218774 = 0.0;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    \n  error_1:\n    return;\n    #undef segscan_group_sizze_218767\n}\n__kernel void mainziscan_stage1_218904(__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_234431_backing_aligned_0,\n                                       int64_t n_p_203574,\n                                       double i64_res_203589,\n                                       int64_t partition_sizze_203667,\n                                       int64_t lifted_single_ma_l_arg_204224,\n                                       int64_t dyn_lifted_single_ma_l_arg_204234,\n                                       int32_t num_threads_234425, __global\n                                       unsigned char *mem_230625, __global\n                                       unsigned char *ext_mem_230637, __global\n                                       unsigned char *mem_230642)\n{\n    #define segscan_group_sizze_218898 (mainzisegscan_group_sizze_218862)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict scan_arr_mem_234431_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_234431_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_234426;\n    int32_t local_tid_234427;\n    int64_t group_sizze_234430;\n    int32_t wave_sizze_234429;\n    int32_t group_tid_234428;\n    \n    global_tid_234426 = get_global_id(0);\n    local_tid_234427 = get_local_id(0);\n    group_sizze_234430 = get_local_size(0);\n    wave_sizze_234429 = LOCKSTEP_WIDTH;\n    group_tid_234428 = get_group_id(0);\n    \n    int32_t phys_tid_218904 = global_tid_234426;\n    __local unsigned char *scan_arr_mem_234431;\n    \n    scan_arr_mem_234431 = (__local\n      ",
                   "                     unsigned char *) scan_arr_mem_234431_backing_0;\n    \n    double x_218905;\n    double x_218906;\n    \n    x_218905 = 0.0;\n    for (int64_t j_234433 = 0; j_234433 < sdiv_up64(partition_sizze_203667 *\n                                                    dyn_lifted_single_ma_l_arg_204234,\n                                                    sext_i32_i64(num_threads_234425));\n         j_234433++) {\n        int64_t chunk_offset_234434 = segscan_group_sizze_218898 * j_234433 +\n                sext_i32_i64(group_tid_234428) * (segscan_group_sizze_218898 *\n                                                  sdiv_up64(partition_sizze_203667 *\n                                                            dyn_lifted_single_ma_l_arg_204234,\n                                                            sext_i32_i64(num_threads_234425)));\n        int64_t flat_idx_234435 = chunk_offset_234434 +\n                sext_i32_i64(local_tid_234427);\n        int64_t gtid_218902 = squot64(flat_idx_234435,\n                                      dyn_lifted_single_ma_l_arg_204234);\n        int64_t gtid_218903 = flat_idx_234435 - squot64(flat_idx_234435,\n                                                        dyn_lifted_single_ma_l_arg_204234) *\n                dyn_lifted_single_ma_l_arg_204234;\n        \n        // threads in bounds read input\n        {\n            if (slt64(gtid_218902, partition_sizze_203667) && slt64(gtid_218903,\n                                                                    dyn_lifted_single_ma_l_arg_204234)) {\n                bool cond_218911 = gtid_218903 == (int64_t) 0;\n                double defunc_0_f_res_218912;\n                \n                if (cond_218911) {\n                    double x_218909;\n                    \n                    x_218909 = ((__global\n                                 double *) ext_mem_230637)[gtid_218902];\n                    \n                    double defunc_0_f_res_t_res_218913 = x_218909 /\n                           i64_re",
                   "s_203589;\n                    \n                    defunc_0_f_res_218912 = defunc_0_f_res_t_res_218913;\n                } else {\n                    int64_t x_218914 = add64(n_p_203574, gtid_218903);\n                    int64_t i_218915 = sub64(x_218914, (int64_t) 1);\n                    bool x_218916 = sle64((int64_t) 0, i_218915);\n                    bool y_218917 = slt64(i_218915,\n                                          lifted_single_ma_l_arg_204224);\n                    bool bounds_check_218918 = x_218916 && y_218917;\n                    bool index_certs_218919;\n                    \n                    if (!bounds_check_218918) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          46) == -1) {\n                                global_failure_args[0] = (int64_t) i_218915;\n                                global_failure_args[1] =\n                                    (int64_t) lifted_single_ma_l_arg_204224;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double x_218920;\n                    \n                    x_218920 = ((__global double *) mem_230625)[gtid_218902 *\n                                                                lifted_single_ma_l_arg_204224 +\n                                                                i_218915];\n                    \n                    int64_t i_218921 = sub64(gtid_218903, (int64_t) 1);\n                    bool x_218922 = sle64((int64_t) 0, i_218921);\n                    bool y_218923 = slt64(i_218921,\n                                          lifted_single_ma_l_arg_204224);\n                    bool bounds_check_218924 = x_218922 && y_218923;\n                    bool index_certs_218925;\n                    \n                  ",
                   "  if (!bounds_check_218924) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          47) == -1) {\n                                global_failure_args[0] = (int64_t) i_218921;\n                                global_failure_args[1] =\n                                    (int64_t) lifted_single_ma_l_arg_204224;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double y_218926;\n                    \n                    y_218926 = ((__global double *) mem_230625)[gtid_218902 *\n                                                                lifted_single_ma_l_arg_204224 +\n                                                                i_218921];\n                    \n                    double x_218927 = x_218920 - y_218926;\n                    double defunc_0_f_res_f_res_218928 = x_218927 /\n                           i64_res_203589;\n                    \n                    defunc_0_f_res_218912 = defunc_0_f_res_f_res_218928;\n                }\n                // write to-scan values to parameters\n                {\n                    x_218906 = defunc_0_f_res_218912;\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_218902, partition_sizze_203667) &&\n                      slt64(gtid_218903, dyn_lifted_single_ma_l_arg_204234))) {\n                    x_218906 = 0.0;\n                }\n            }\n            // combine with carry and write to local memory\n            {\n                double defunc_1_op_res_218907 = x_218905 +",
                   " x_218906;\n                \n                ((__local\n                  double *) scan_arr_mem_234431)[sext_i32_i64(local_tid_234427)] =\n                    defunc_1_op_res_218907;\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            double x_234436;\n            double x_234437;\n            double x_234439;\n            double x_234440;\n            bool ltid_in_bounds_234442 = slt64(sext_i32_i64(local_tid_234427),\n                                               segscan_group_sizze_218898);\n            int32_t skip_threads_234443;\n            \n            // read input for in-block scan\n            {\n                if (ltid_in_bounds_234442) {\n                    x_234437 = ((volatile __local\n                                 double *) scan_arr_mem_234431)[sext_i32_i64(local_tid_234427)];\n                    if ((local_tid_234427 - squot32(local_tid_234427, 32) *\n                         32) == 0) {\n                        x_234436 = x_234437;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_234443 = 1;\n                while (slt32(skip_threads_234443, 32)) {\n                    bool thread_active_234444 = sle32(skip_threads_234443,\n                                                      local_tid_234427 -\n                                                      squot32(local_tid_234427,\n                                                              32) * 32) &&\n                         ltid_in_bounds_234442;\n                    \n                    if (thread_active_234444) {\n                        // read operands\n                        {\n                            x_234436 = ((volatile __local\n                                         double *) scan_arr_mem_234431)[sext_i32_i64(local_tid_234427) -\n            ",
                   "                                                            sext_i32_i64(skip_threads_234443)];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234445 =\n                             slt64(srem64(sext_i32_i64(local_tid_234427) +\n                                          chunk_offset_234434,\n                                          dyn_lifted_single_ma_l_arg_204234),\n                                   sext_i32_i64(local_tid_234427) +\n                                   chunk_offset_234434 -\n                                   (sext_i32_i64(local_tid_234427 -\n                                    skip_threads_234443) +\n                                    chunk_offset_234434));\n                        \n                        if (thread_active_234444 && inactive_234445) {\n                            x_234436 = x_234437;\n                        }\n                        if (thread_active_234444) {\n                            if (!inactive_234445) {\n                                double defunc_1_op_res_234438 = x_234436 +\n                                       x_234437;\n                                \n                                x_234436 = defunc_1_op_res_234438;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_234429, skip_threads_234443)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_234444) {\n                        // write result\n                        {\n                            ((volatile __local\n                              double *) scan_arr_mem_234431)[sext_i32_i64(local_tid_234427)] =\n                                x_234436;\n                            x_234437 = x_234436;\n                        }\n                    }\n                    if (sle32(wave_sizze_234429, skip_threads_234443)) {\n                        b",
                   "arrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_234443 *= 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_234427 - squot32(local_tid_234427, 32) * 32) ==\n                    31 && ltid_in_bounds_234442) {\n                    ((volatile __local\n                      double *) scan_arr_mem_234431)[sext_i32_i64(squot32(local_tid_234427,\n                                                                          32))] =\n                        x_234436;\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_234446;\n                \n                // read input for in-block scan\n                {\n                    if (squot32(local_tid_234427, 32) == 0 &&\n                        ltid_in_bounds_234442) {\n                        x_234440 = ((volatile __local\n                                     double *) scan_arr_mem_234431)[sext_i32_i64(local_tid_234427)];\n                        if ((local_tid_234427 - squot32(local_tid_234427, 32) *\n                             32) == 0) {\n                            x_234439 = x_234440;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_234446 = 1;\n                    while (slt32(skip_threads_234446, 32)) {\n                        bool thread_active_234447 = sle32(skip_threads_234446,\n                                                          local_tid_234427 -\n                                                          squot32(local_tid_234427,\n                                                                  32) * 32) &&\n                             (squot32(local_tid",
                   "_234427, 32) == 0 &&\n                              ltid_in_bounds_234442);\n                        \n                        if (thread_active_234447) {\n                            // read operands\n                            {\n                                x_234439 = ((volatile __local\n                                             double *) scan_arr_mem_234431)[sext_i32_i64(local_tid_234427) -\n                                                                            sext_i32_i64(skip_threads_234446)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234448 =\n                                 slt64(srem64(sext_i32_i64(local_tid_234427 *\n                                              32 + 32 - 1) +\n                                              chunk_offset_234434,\n                                              dyn_lifted_single_ma_l_arg_204234),\n                                       sext_i32_i64(local_tid_234427 * 32 + 32 -\n                                       1) + chunk_offset_234434 -\n                                       (sext_i32_i64((local_tid_234427 -\n                                                      skip_threads_234446) *\n                                        32 + 32 - 1) + chunk_offset_234434));\n                            \n                            if (thread_active_234447 && inactive_234448) {\n                                x_234439 = x_234440;\n                            }\n                            if (thread_active_234447) {\n                                if (!inactive_234448) {\n                                    double defunc_1_op_res_234441 = x_234439 +\n                                           x_234440;\n                                    \n                                    x_234439 = defunc_1_op_res_234441;\n                                }\n                            }\n                        }\n                    ",
                   "    if (sle32(wave_sizze_234429, skip_threads_234446)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234447) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) scan_arr_mem_234431)[sext_i32_i64(local_tid_234427)] =\n                                    x_234439;\n                                x_234440 = x_234439;\n                            }\n                        }\n                        if (sle32(wave_sizze_234429, skip_threads_234446)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_234446 *= 2;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            bool no_carry_in_234449 = squot32(local_tid_234427, 32) == 0 ||\n                 !ltid_in_bounds_234442;\n            \n            // carry-in for every block except the first\n            {\n                // read operands\n                {\n                    if (!no_carry_in_234449) {\n                        x_234437 = x_234436;\n                        x_234436 = ((__local\n                                     double *) scan_arr_mem_234431)[sext_i32_i64(squot32(local_tid_234427,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_234450 =\n                         slt64(srem64(sext_i32_i64(local_tid_234427) +\n                                      chunk_offset_234434,\n                                      dyn_lifted_single_ma_l_arg_204234),\n                               sext_i32_i64(local_tid_234427) +\n                            ",
                   "   chunk_offset_234434 -\n                               (sext_i32_i64(squot32(local_tid_234427, 32) *\n                                32 - 1) + chunk_offset_234434));\n                    \n                    if (!no_carry_in_234449) {\n                        if (inactive_234450) {\n                            x_234436 = x_234437;\n                        }\n                    }\n                    if (!no_carry_in_234449) {\n                        if (!inactive_234450) {\n                            double defunc_1_op_res_234438 = x_234436 + x_234437;\n                            \n                            x_234436 = defunc_1_op_res_234438;\n                        }\n                    }\n                }\n                // write final result\n                {\n                    if (!no_carry_in_234449) {\n                        ((__local\n                          double *) scan_arr_mem_234431)[sext_i32_i64(local_tid_234427)] =\n                            x_234436;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // restore correct values for first block\n            {\n                if (squot32(local_tid_234427, 32) == 0 &&\n                    ltid_in_bounds_234442) {\n                    ((__local\n                      double *) scan_arr_mem_234431)[sext_i32_i64(local_tid_234427)] =\n                        x_234437;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // threads in bounds write partial scan result\n            {\n                if (slt64(gtid_218902, partition_sizze_203667) &&\n                    slt64(gtid_218903, dyn_lifted_single_ma_l_arg_204234)) {\n                    double tmp_234451;\n                    \n                    tmp_234451 = ((__local\n                                   double *) scan_arr_mem_234431)[sext_i32_i64(local_tid_234427)];\n                    ((__global double *) mem_230642)[gtid_218902 *\n                                            ",
                   "         dyn_lifted_single_ma_l_arg_204234 +\n                                                     gtid_218903] = tmp_234451;\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_234452 = slt64(srem64(chunk_offset_234434 +\n                                                           segscan_group_sizze_218898,\n                                                           dyn_lifted_single_ma_l_arg_204234),\n                                                    chunk_offset_234434 +\n                                                    segscan_group_sizze_218898 -\n                                                    (chunk_offset_234434 +\n                                                     segscan_group_sizze_218898 -\n                                                     (int64_t) 1));\n                bool should_load_carry_234453 = local_tid_234427 == 0 &&\n                     !crosses_segment_234452;\n                \n                if (should_load_carry_234453) {\n                    x_218905 = ((__local\n                                 double *) scan_arr_mem_234431)[segscan_group_sizze_218898 -\n                                                                (int64_t) 1];\n                }\n                if (!should_load_carry_234453) {\n                    x_218905 = 0.0;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    \n  error_1:\n    return;\n    #undef segscan_group_sizze_218898\n}\n__kernel void mainziscan_stage1_219035(__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_234574_backing_aligned_0,\n                                       int64_t n_20357",
                   "2,\n                                       int64_t partition_sizze_203667,\n                                       int64_t dyn_lifted_single_ma_l_arg_204234,\n                                       int32_t num_threads_234568, __global\n                                       unsigned char *mem_230642, __global\n                                       unsigned char *ext_mem_230654, __global\n                                       unsigned char *mem_230659)\n{\n    #define segscan_group_sizze_219029 (mainzisegscan_group_sizze_218993)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict scan_arr_mem_234574_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_234574_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_234569;\n    int32_t local_tid_234570;\n    int64_t group_sizze_234573;\n    int32_t wave_sizze_234572;\n    int32_t group_tid_234571;\n    \n    global_tid_234569 = get_global_id(0);\n    local_tid_234570 = get_local_id(0);\n    group_sizze_234573 = get_local_size(0);\n    wave_sizze_234572 = LOCKSTEP_WIDTH;\n    group_tid_234571 = get_group_id(0);\n    \n    int32_t phys_tid_219035 = global_tid_234569;\n    __local unsigned char *scan_arr_mem_234574;\n    \n    scan_arr_mem_234574 = (__local\n                           unsigned char *) scan_arr_mem_234574_backing_0;\n    \n    double x_219036;\n    double x_219037;\n    \n    x_219036 = 0.0;\n    for (int64_t j_234576 = 0; j_234576 < sdiv_up64(partition_sizze_203667 *\n                                                    n_203572,\n                                                    sext_i32_i64(num_threads_234568));\n         j_234576++) {\n        in",
                   "t64_t chunk_offset_234577 = segscan_group_sizze_219029 * j_234576 +\n                sext_i32_i64(group_tid_234571) * (segscan_group_sizze_219029 *\n                                                  sdiv_up64(partition_sizze_203667 *\n                                                            n_203572,\n                                                            sext_i32_i64(num_threads_234568)));\n        int64_t flat_idx_234578 = chunk_offset_234577 +\n                sext_i32_i64(local_tid_234570);\n        int64_t gtid_219033 = squot64(flat_idx_234578, n_203572);\n        int64_t gtid_219034 = flat_idx_234578 - squot64(flat_idx_234578,\n                                                        n_203572) * n_203572;\n        \n        // threads in bounds read input\n        {\n            if (slt64(gtid_219033, partition_sizze_203667) && slt64(gtid_219034,\n                                                                    n_203572)) {\n                bool cond_219042 = gtid_219034 == (int64_t) 0;\n                double defunc_0_f_res_219043;\n                \n                if (cond_219042) {\n                    double x_219040;\n                    \n                    x_219040 = ((__global\n                                 double *) ext_mem_230654)[gtid_219033];\n                    \n                    double defunc_0_f_res_t_res_219044 = x_219040 / 3.0;\n                    \n                    defunc_0_f_res_219043 = defunc_0_f_res_t_res_219044;\n                } else {\n                    int64_t x_219045 = add64((int64_t) 3, gtid_219034);\n                    int64_t i_219046 = sub64(x_219045, (int64_t) 1);\n                    bool x_219047 = sle64((int64_t) 0, i_219046);\n                    bool y_219048 = slt64(i_219046,\n                                          dyn_lifted_single_ma_l_arg_204234);\n                    bool bounds_check_219049 = x_219047 && y_219048;\n                    bool index_certs_219050;\n                    \n                    if (!bounds_check_219",
                   "049) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          48) == -1) {\n                                global_failure_args[0] = (int64_t) i_219046;\n                                global_failure_args[1] =\n                                    (int64_t) dyn_lifted_single_ma_l_arg_204234;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double x_219051;\n                    \n                    x_219051 = ((__global double *) mem_230642)[gtid_219033 *\n                                                                dyn_lifted_single_ma_l_arg_204234 +\n                                                                i_219046];\n                    \n                    int64_t i_219052 = sub64(gtid_219034, (int64_t) 1);\n                    bool x_219053 = sle64((int64_t) 0, i_219052);\n                    bool y_219054 = slt64(i_219052,\n                                          dyn_lifted_single_ma_l_arg_204234);\n                    bool bounds_check_219055 = x_219053 && y_219054;\n                    bool index_certs_219056;\n                    \n                    if (!bounds_check_219055) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          49) == -1) {\n                                global_failure_args[0] = (int64_t) i_219052;\n                                global_failure_args[1] =\n                                    (int64_t) dyn_lifted_single_ma_l_arg_204234;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n ",
                   "                   \n                    double y_219057;\n                    \n                    y_219057 = ((__global double *) mem_230642)[gtid_219033 *\n                                                                dyn_lifted_single_ma_l_arg_204234 +\n                                                                i_219052];\n                    \n                    double x_219058 = x_219051 - y_219057;\n                    double defunc_0_f_res_f_res_219059 = x_219058 / 3.0;\n                    \n                    defunc_0_f_res_219043 = defunc_0_f_res_f_res_219059;\n                }\n                // write to-scan values to parameters\n                {\n                    x_219037 = defunc_0_f_res_219043;\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_219033, partition_sizze_203667) &&\n                      slt64(gtid_219034, n_203572))) {\n                    x_219037 = 0.0;\n                }\n            }\n            // combine with carry and write to local memory\n            {\n                double defunc_1_op_res_219038 = x_219036 + x_219037;\n                \n                ((__local\n                  double *) scan_arr_mem_234574)[sext_i32_i64(local_tid_234570)] =\n                    defunc_1_op_res_219038;\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            double x_234579;\n            double x_234580;\n            double x_234582;\n            double x_234583;\n            bool ltid_in_bounds_234585 = slt64(sext_i32_i64(local_tid_234570),\n                                               segscan_group_sizze_219029);\n            int32_t skip_threa",
                   "ds_234586;\n            \n            // read input for in-block scan\n            {\n                if (ltid_in_bounds_234585) {\n                    x_234580 = ((volatile __local\n                                 double *) scan_arr_mem_234574)[sext_i32_i64(local_tid_234570)];\n                    if ((local_tid_234570 - squot32(local_tid_234570, 32) *\n                         32) == 0) {\n                        x_234579 = x_234580;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_234586 = 1;\n                while (slt32(skip_threads_234586, 32)) {\n                    bool thread_active_234587 = sle32(skip_threads_234586,\n                                                      local_tid_234570 -\n                                                      squot32(local_tid_234570,\n                                                              32) * 32) &&\n                         ltid_in_bounds_234585;\n                    \n                    if (thread_active_234587) {\n                        // read operands\n                        {\n                            x_234579 = ((volatile __local\n                                         double *) scan_arr_mem_234574)[sext_i32_i64(local_tid_234570) -\n                                                                        sext_i32_i64(skip_threads_234586)];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234588 =\n                             slt64(srem64(sext_i32_i64(local_tid_234570) +\n                                          chunk_offset_234577, n_203572),\n                                   sext_i32_i64(local_tid_234570) +\n                                   chunk_offset_234577 -\n                                   (sext_i32_i64(local_tid_234570 -\n                                    skip_threads_234586) +\n                         ",
                   "           chunk_offset_234577));\n                        \n                        if (thread_active_234587 && inactive_234588) {\n                            x_234579 = x_234580;\n                        }\n                        if (thread_active_234587) {\n                            if (!inactive_234588) {\n                                double defunc_1_op_res_234581 = x_234579 +\n                                       x_234580;\n                                \n                                x_234579 = defunc_1_op_res_234581;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_234572, skip_threads_234586)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_234587) {\n                        // write result\n                        {\n                            ((volatile __local\n                              double *) scan_arr_mem_234574)[sext_i32_i64(local_tid_234570)] =\n                                x_234579;\n                            x_234580 = x_234579;\n                        }\n                    }\n                    if (sle32(wave_sizze_234572, skip_threads_234586)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_234586 *= 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_234570 - squot32(local_tid_234570, 32) * 32) ==\n                    31 && ltid_in_bounds_234585) {\n                    ((volatile __local\n                      double *) scan_arr_mem_234574)[sext_i32_i64(squot32(local_tid_234570,\n                                                                          32))] =\n                        x_234579;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // scan the first block, af",
                   "ter which offset 'i' contains carry-in for block 'i+1'\n            {\n                int32_t skip_threads_234589;\n                \n                // read input for in-block scan\n                {\n                    if (squot32(local_tid_234570, 32) == 0 &&\n                        ltid_in_bounds_234585) {\n                        x_234583 = ((volatile __local\n                                     double *) scan_arr_mem_234574)[sext_i32_i64(local_tid_234570)];\n                        if ((local_tid_234570 - squot32(local_tid_234570, 32) *\n                             32) == 0) {\n                            x_234582 = x_234583;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_234589 = 1;\n                    while (slt32(skip_threads_234589, 32)) {\n                        bool thread_active_234590 = sle32(skip_threads_234589,\n                                                          local_tid_234570 -\n                                                          squot32(local_tid_234570,\n                                                                  32) * 32) &&\n                             (squot32(local_tid_234570, 32) == 0 &&\n                              ltid_in_bounds_234585);\n                        \n                        if (thread_active_234590) {\n                            // read operands\n                            {\n                                x_234582 = ((volatile __local\n                                             double *) scan_arr_mem_234574)[sext_i32_i64(local_tid_234570) -\n                                                                            sext_i32_i64(skip_threads_234589)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234591 =\n                                 slt64(srem64(sext_i32_i64(",
                   "local_tid_234570 *\n                                              32 + 32 - 1) +\n                                              chunk_offset_234577, n_203572),\n                                       sext_i32_i64(local_tid_234570 * 32 + 32 -\n                                       1) + chunk_offset_234577 -\n                                       (sext_i32_i64((local_tid_234570 -\n                                                      skip_threads_234589) *\n                                        32 + 32 - 1) + chunk_offset_234577));\n                            \n                            if (thread_active_234590 && inactive_234591) {\n                                x_234582 = x_234583;\n                            }\n                            if (thread_active_234590) {\n                                if (!inactive_234591) {\n                                    double defunc_1_op_res_234584 = x_234582 +\n                                           x_234583;\n                                    \n                                    x_234582 = defunc_1_op_res_234584;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_234572, skip_threads_234589)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234590) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) scan_arr_mem_234574)[sext_i32_i64(local_tid_234570)] =\n                                    x_234582;\n                                x_234583 = x_234582;\n                            }\n                        }\n                        if (sle32(wave_sizze_234572, skip_threads_234589)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_234589 *= 2;\n                    }\n             ",
                   "   }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            bool no_carry_in_234592 = squot32(local_tid_234570, 32) == 0 ||\n                 !ltid_in_bounds_234585;\n            \n            // carry-in for every block except the first\n            {\n                // read operands\n                {\n                    if (!no_carry_in_234592) {\n                        x_234580 = x_234579;\n                        x_234579 = ((__local\n                                     double *) scan_arr_mem_234574)[sext_i32_i64(squot32(local_tid_234570,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_234593 =\n                         slt64(srem64(sext_i32_i64(local_tid_234570) +\n                                      chunk_offset_234577, n_203572),\n                               sext_i32_i64(local_tid_234570) +\n                               chunk_offset_234577 -\n                               (sext_i32_i64(squot32(local_tid_234570, 32) *\n                                32 - 1) + chunk_offset_234577));\n                    \n                    if (!no_carry_in_234592) {\n                        if (inactive_234593) {\n                            x_234579 = x_234580;\n                        }\n                    }\n                    if (!no_carry_in_234592) {\n                        if (!inactive_234593) {\n                            double defunc_1_op_res_234581 = x_234579 + x_234580;\n                            \n                            x_234579 = defunc_1_op_res_234581;\n                        }\n                    }\n                }\n                // write final result\n                {\n                    if (!no_carry_in_234592) {\n                        ((__local\n                          doubl",
                   "e *) scan_arr_mem_234574)[sext_i32_i64(local_tid_234570)] =\n                            x_234579;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // restore correct values for first block\n            {\n                if (squot32(local_tid_234570, 32) == 0 &&\n                    ltid_in_bounds_234585) {\n                    ((__local\n                      double *) scan_arr_mem_234574)[sext_i32_i64(local_tid_234570)] =\n                        x_234580;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // threads in bounds write partial scan result\n            {\n                if (slt64(gtid_219033, partition_sizze_203667) &&\n                    slt64(gtid_219034, n_203572)) {\n                    double tmp_234594;\n                    \n                    tmp_234594 = ((__local\n                                   double *) scan_arr_mem_234574)[sext_i32_i64(local_tid_234570)];\n                    ((__global double *) mem_230659)[gtid_219033 * n_203572 +\n                                                     gtid_219034] = tmp_234594;\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_234595 = slt64(srem64(chunk_offset_234577 +\n                                                           segscan_group_sizze_219029,\n                                                           n_203572),\n                                                    chunk_offset_234577 +\n                                                    segscan_group_sizze_219029 -\n                                                    (chunk_offset_234577 +\n                                                     segscan_group_sizze_219029 -\n                                                     (int64_t) 1));\n                bool should_load_carry_234596 = local_tid_234570 == 0 &&\n  ",
                   "                   !crosses_segment_234595;\n                \n                if (should_load_carry_234596) {\n                    x_219036 = ((__local\n                                 double *) scan_arr_mem_234574)[segscan_group_sizze_219029 -\n                                                                (int64_t) 1];\n                }\n                if (!should_load_carry_234596) {\n                    x_219036 = 0.0;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    \n  error_1:\n    return;\n    #undef segscan_group_sizze_219029\n}\n__kernel void mainziscan_stage1_228005(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_236569_backing_aligned_0,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_236567_backing_aligned_1,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_236565_backing_aligned_2,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_236563_backing_aligned_3,\n                                       int64_t n_203572,\n                                       int64_t partition_sizze_203667,\n                                       unsigned char cond_f_res_227891_bits,\n                                       unsigned char cond_f_res_227892_bits,\n                                       int64_t unsign_arg_227893,\n                                       int64_t unsign_arg_227894,\n                                       int32_t num_threads_236557, __global\n                                       unsigned char *mem_param_231841, __global\n                                       unsigned char *mem_231877, __global\n                                       unsigned char *mem_231881, __global\n                                       unsigned char *me",
                   "m_231885, __global\n                                       unsigned char *mem_231889, __global\n                                       unsigned char *mem_231893)\n{\n    bool cond_f_res_227891 = cond_f_res_227891_bits;\n    bool cond_f_res_227892 = cond_f_res_227892_bits;\n    \n    #define segscan_group_sizze_227995 (mainzisegscan_group_sizze_227715)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict scan_arr_mem_236569_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_236569_backing_aligned_0;\n    __local volatile unsigned char *restrict scan_arr_mem_236567_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_236567_backing_aligned_1;\n    __local volatile unsigned char *restrict scan_arr_mem_236565_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_236565_backing_aligned_2;\n    __local volatile unsigned char *restrict scan_arr_mem_236563_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_236563_backing_aligned_3;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236558;\n    int32_t local_tid_236559;\n    int64_t group_sizze_236562;\n    int32_t wave_sizze_236561;\n    int32_t group_tid_236560;\n    \n    global_tid_236558 = get_global_id(0);\n    local_tid_236559 = get_local_id(0);\n    group_sizze_236562 = get_local_size(0);\n    wave_sizze_236561 = LOCKSTEP_WIDTH;\n    group_tid_236560 = get_group_id(0);\n    \n    int32_t phys_tid_228005 = global_tid_236558;\n    __local unsigned char *scan_arr_mem_236563;\n    __local unsigned char *scan_arr_mem_236565;\n    __local unsigned char *scan_arr_mem_236567;\n    __local unsigned char *scan_arr_mem_236569;\n   ",
                   " \n    scan_arr_mem_236563 = (__local\n                           unsigned char *) scan_arr_mem_236563_backing_0;\n    scan_arr_mem_236565 = (__local\n                           unsigned char *) scan_arr_mem_236565_backing_1;\n    scan_arr_mem_236567 = (__local\n                           unsigned char *) scan_arr_mem_236567_backing_2;\n    scan_arr_mem_236569 = (__local\n                           unsigned char *) scan_arr_mem_236569_backing_3;\n    \n    int64_t x_228006;\n    int64_t x_228007;\n    int64_t x_228008;\n    int64_t x_228009;\n    int64_t x_228010;\n    int64_t x_228011;\n    int64_t x_228012;\n    int64_t x_228013;\n    \n    x_228006 = (int64_t) 0;\n    x_228007 = (int64_t) 0;\n    x_228008 = (int64_t) 0;\n    x_228009 = (int64_t) 0;\n    for (int64_t j_236571 = 0; j_236571 < sdiv_up64(partition_sizze_203667 *\n                                                    n_203572,\n                                                    sext_i32_i64(num_threads_236557));\n         j_236571++) {\n        int64_t chunk_offset_236572 = segscan_group_sizze_227995 * j_236571 +\n                sext_i32_i64(group_tid_236560) * (segscan_group_sizze_227995 *\n                                                  sdiv_up64(partition_sizze_203667 *\n                                                            n_203572,\n                                                            sext_i32_i64(num_threads_236557)));\n        int64_t flat_idx_236573 = chunk_offset_236572 +\n                sext_i32_i64(local_tid_236559);\n        int64_t gtid_228003 = squot64(flat_idx_236573, n_203572);\n        int64_t gtid_228004 = flat_idx_236573 - squot64(flat_idx_236573,\n                                                        n_203572) * n_203572;\n        \n        // threads in bounds read input\n        {\n            if (slt64(gtid_228003, partition_sizze_203667) && slt64(gtid_228004,\n                                                                    n_203572)) {\n                double x_228019;\n                \n           ",
                   "     x_228019 = ((__global double *) mem_param_231841)[gtid_228003 *\n                                                                  n_203572 +\n                                                                  gtid_228004];\n                \n                int64_t i64_arg_228020;\n                \n                i64_arg_228020 = futrts_to_bits64(x_228019);\n                \n                int64_t unsign_arg_228021 = ashr64(i64_arg_228020,\n                                                   unsign_arg_227893);\n                int64_t unsign_arg_228022 = (int64_t) 1 & unsign_arg_228021;\n                int32_t to_i32_res_228023 = zext_i64_i32(unsign_arg_228022);\n                int64_t unsign_arg_228024 = ashr64(i64_arg_228020,\n                                                   (int64_t) 63);\n                int64_t unsign_arg_228025 = (int64_t) 1 & unsign_arg_228024;\n                int32_t to_i32_res_228026 = zext_i64_i32(unsign_arg_228025);\n                bool cond_228027 = to_i32_res_228026 == 1;\n                bool x_228028 = !cond_228027;\n                bool y_228029 = cond_f_res_227891 && x_228028;\n                bool cond_228030 = cond_228027 || y_228029;\n                int32_t defunc_1_get_bit_res_228031;\n                \n                if (cond_228030) {\n                    int32_t defunc_1_get_bit_res_t_res_228032 = 1 ^\n                            to_i32_res_228023;\n                    \n                    defunc_1_get_bit_res_228031 =\n                        defunc_1_get_bit_res_t_res_228032;\n                } else {\n                    defunc_1_get_bit_res_228031 = to_i32_res_228023;\n                }\n                \n                int32_t x_228033 = mul32(2, defunc_1_get_bit_res_228031);\n                int64_t unsign_arg_228034 = ashr64(i64_arg_228020,\n                                                   unsign_arg_227894);\n                int64_t unsign_arg_228035 = (int64_t) 1 & unsign_arg_228034;\n                int32_t to_i32_res_228036 = zex",
                   "t_i64_i32(unsign_arg_228035);\n                bool y_228037 = cond_f_res_227892 && x_228028;\n                bool cond_228038 = cond_228027 || y_228037;\n                int32_t defunc_1_get_bit_res_228039;\n                \n                if (cond_228038) {\n                    int32_t defunc_1_get_bit_res_t_res_228040 = 1 ^\n                            to_i32_res_228036;\n                    \n                    defunc_1_get_bit_res_228039 =\n                        defunc_1_get_bit_res_t_res_228040;\n                } else {\n                    defunc_1_get_bit_res_228039 = to_i32_res_228036;\n                }\n                \n                int32_t defunc_0_f_res_228041 = add32(x_228033,\n                                                      defunc_1_get_bit_res_228039);\n                bool cond_228042 = defunc_0_f_res_228041 == 0;\n                int64_t defunc_0_f_res_228043 = btoi_bool_i64(cond_228042);\n                int64_t defunc_0_f_res_228044;\n                int64_t defunc_0_f_res_228045;\n                int64_t defunc_0_f_res_228046;\n                \n                if (cond_228042) {\n                    defunc_0_f_res_228044 = (int64_t) 0;\n                    defunc_0_f_res_228045 = (int64_t) 0;\n                    defunc_0_f_res_228046 = (int64_t) 0;\n                } else {\n                    bool cond_228047 = defunc_0_f_res_228041 == 1;\n                    int64_t defunc_0_f_res_f_res_228048 =\n                            btoi_bool_i64(cond_228047);\n                    int64_t defunc_0_f_res_f_res_228049;\n                    int64_t defunc_0_f_res_f_res_228050;\n                    \n                    if (cond_228047) {\n                        defunc_0_f_res_f_res_228049 = (int64_t) 0;\n                        defunc_0_f_res_f_res_228050 = (int64_t) 0;\n                    } else {\n                        bool cond_228051 = defunc_0_f_res_228041 == 2;\n                        int64_t defunc_0_f_res_f_res_f_res_228052 =\n                                bto",
                   "i_bool_i64(cond_228051);\n                        bool cond_neg_228053 = !cond_228051;\n                        int64_t defunc_0_f_res_f_res_f_res_228054 =\n                                btoi_bool_i64(cond_neg_228053);\n                        \n                        defunc_0_f_res_f_res_228049 =\n                            defunc_0_f_res_f_res_f_res_228052;\n                        defunc_0_f_res_f_res_228050 =\n                            defunc_0_f_res_f_res_f_res_228054;\n                    }\n                    defunc_0_f_res_228044 = defunc_0_f_res_f_res_228048;\n                    defunc_0_f_res_228045 = defunc_0_f_res_f_res_228049;\n                    defunc_0_f_res_228046 = defunc_0_f_res_f_res_228050;\n                }\n                // write to-scan values to parameters\n                {\n                    x_228010 = defunc_0_f_res_228043;\n                    x_228011 = defunc_0_f_res_228044;\n                    x_228012 = defunc_0_f_res_228045;\n                    x_228013 = defunc_0_f_res_228046;\n                }\n                // write mapped values results to global memory\n                {\n                    ((__global int32_t *) mem_231893)[gtid_228003 * n_203572 +\n                                                      gtid_228004] =\n                        defunc_0_f_res_228041;\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_228003, partition_sizze_203667) &&\n                      slt64(gtid_228004, n_203572))) {\n                    x_228010 = (int64_t) 0;\n                    x_228011 = (int64_t) 0;\n                    x_228012 = (int64_t) 0;\n                    x_228013 = (int64_t) 0;\n                }\n            }\n            // combine with carry and write to local memory\n            {\n                int64_t defunc_1_op_res_228014 = add64(x_228006, x_228010);\n         ",
                   "       int64_t defunc_1_op_res_228015 = add64(x_228007, x_228011);\n                int64_t defunc_1_op_res_228016 = add64(x_228008, x_228012);\n                int64_t defunc_1_op_res_228017 = add64(x_228009, x_228013);\n                \n                ((__local\n                  int64_t *) scan_arr_mem_236563)[sext_i32_i64(local_tid_236559)] =\n                    defunc_1_op_res_228014;\n                ((__local\n                  int64_t *) scan_arr_mem_236565)[sext_i32_i64(local_tid_236559)] =\n                    defunc_1_op_res_228015;\n                ((__local\n                  int64_t *) scan_arr_mem_236567)[sext_i32_i64(local_tid_236559)] =\n                    defunc_1_op_res_228016;\n                ((__local\n                  int64_t *) scan_arr_mem_236569)[sext_i32_i64(local_tid_236559)] =\n                    defunc_1_op_res_228017;\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            int64_t x_236574;\n            int64_t x_236575;\n            int64_t x_236576;\n            int64_t x_236577;\n            int64_t x_236578;\n            int64_t x_236579;\n            int64_t x_236580;\n            int64_t x_236581;\n            int64_t x_236586;\n            int64_t x_236587;\n            int64_t x_236588;\n            int64_t x_236589;\n            int64_t x_236590;\n            int64_t x_236591;\n            int64_t x_236592;\n            int64_t x_236593;\n            bool ltid_in_bounds_236598 = slt64(sext_i32_i64(local_tid_236559),\n                                               segscan_group_sizze_227995);\n            int32_t skip_threads_236599;\n            \n            // read input for in-block scan\n            {\n                if (ltid_in_bounds_236598) {\n                    x_236578 = ((volatile __local\n                                 int64_t *) scan_arr_mem_236563)[sext_i32_i64(local_tid_236559)];\n                    x_236579 = ((volatile __local\n                                 int64_t *) scan_arr_mem_236565)[sext_i32_i64(local_tid_2",
                   "36559)];\n                    x_236580 = ((volatile __local\n                                 int64_t *) scan_arr_mem_236567)[sext_i32_i64(local_tid_236559)];\n                    x_236581 = ((volatile __local\n                                 int64_t *) scan_arr_mem_236569)[sext_i32_i64(local_tid_236559)];\n                    if ((local_tid_236559 - squot32(local_tid_236559, 32) *\n                         32) == 0) {\n                        x_236574 = x_236578;\n                        x_236575 = x_236579;\n                        x_236576 = x_236580;\n                        x_236577 = x_236581;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_236599 = 1;\n                while (slt32(skip_threads_236599, 32)) {\n                    bool thread_active_236600 = sle32(skip_threads_236599,\n                                                      local_tid_236559 -\n                                                      squot32(local_tid_236559,\n                                                              32) * 32) &&\n                         ltid_in_bounds_236598;\n                    \n                    if (thread_active_236600) {\n                        // read operands\n                        {\n                            x_236574 = ((volatile __local\n                                         int64_t *) scan_arr_mem_236563)[sext_i32_i64(local_tid_236559) -\n                                                                         sext_i32_i64(skip_threads_236599)];\n                            x_236575 = ((volatile __local\n                                         int64_t *) scan_arr_mem_236565)[sext_i32_i64(local_tid_236559) -\n                                                                         sext_i32_i64(skip_threads_236599)];\n                            x_236576 = ((volatile __local\n                                         int64_t *) scan_arr_mem_236567)[sext_i32_i64",
                   "(local_tid_236559) -\n                                                                         sext_i32_i64(skip_threads_236599)];\n                            x_236577 = ((volatile __local\n                                         int64_t *) scan_arr_mem_236569)[sext_i32_i64(local_tid_236559) -\n                                                                         sext_i32_i64(skip_threads_236599)];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_236601 =\n                             slt64(srem64(sext_i32_i64(local_tid_236559) +\n                                          chunk_offset_236572, n_203572),\n                                   sext_i32_i64(local_tid_236559) +\n                                   chunk_offset_236572 -\n                                   (sext_i32_i64(local_tid_236559 -\n                                    skip_threads_236599) +\n                                    chunk_offset_236572));\n                        \n                        if (thread_active_236600 && inactive_236601) {\n                            x_236574 = x_236578;\n                            x_236575 = x_236579;\n                            x_236576 = x_236580;\n                            x_236577 = x_236581;\n                        }\n                        if (thread_active_236600) {\n                            if (!inactive_236601) {\n                                int64_t defunc_1_op_res_236582 = add64(x_236574,\n                                                                       x_236578);\n                                int64_t defunc_1_op_res_236583 = add64(x_236575,\n                                                                       x_236579);\n                                int64_t defunc_1_op_res_236584 = add64(x_236576,\n                                                                       x_236580);\n                                int64_t defunc_1_op_res_236585 = add",
                   "64(x_236577,\n                                                                       x_236581);\n                                \n                                x_236574 = defunc_1_op_res_236582;\n                                x_236575 = defunc_1_op_res_236583;\n                                x_236576 = defunc_1_op_res_236584;\n                                x_236577 = defunc_1_op_res_236585;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_236561, skip_threads_236599)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_236600) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) scan_arr_mem_236563)[sext_i32_i64(local_tid_236559)] =\n                                x_236574;\n                            x_236578 = x_236574;\n                            ((volatile __local\n                              int64_t *) scan_arr_mem_236565)[sext_i32_i64(local_tid_236559)] =\n                                x_236575;\n                            x_236579 = x_236575;\n                            ((volatile __local\n                              int64_t *) scan_arr_mem_236567)[sext_i32_i64(local_tid_236559)] =\n                                x_236576;\n                            x_236580 = x_236576;\n                            ((volatile __local\n                              int64_t *) scan_arr_mem_236569)[sext_i32_i64(local_tid_236559)] =\n                                x_236577;\n                            x_236581 = x_236577;\n                        }\n                    }\n                    if (sle32(wave_sizze_236561, skip_threads_236599)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_236599 *= 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_236559 - squot32(local_tid_236559, 32) * 32) ==\n                    31 && ltid_in_bounds_236598) {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_236563)[sext_i32_i64(squot32(local_tid_236559,\n                                                                           32))] =\n                        x_236574;\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_236565)[sext_i32_i64(squot32(local_tid_236559,\n                                                                           32))] =\n                        x_236575;\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_236567)[sext_i32_i64(squot32(local_tid_236559,\n                                                                           32))] =\n                        x_236576;\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_236569)[sext_i32_i64(squot32(local_tid_236559,\n                                                                           32))] =\n                        x_236577;\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_236602;\n                \n                // read input for in-block scan\n                {\n                    if (squot32(local_tid_236559, 32) == 0 &&\n                        ltid_in_bounds_236598) {\n                        x_236590 = ((volatile __local\n                                     int64_t *) scan_arr_mem_236563)[sext_i32_i64(local_tid_236559)];\n                        x_236591 = ((volatile __local\n                                     int64_t *) scan_arr_mem_236565)[sext_i32_i64(local_tid_236559)];\n                        x_236592 = ((volatile __local\n           ",
                   "                          int64_t *) scan_arr_mem_236567)[sext_i32_i64(local_tid_236559)];\n                        x_236593 = ((volatile __local\n                                     int64_t *) scan_arr_mem_236569)[sext_i32_i64(local_tid_236559)];\n                        if ((local_tid_236559 - squot32(local_tid_236559, 32) *\n                             32) == 0) {\n                            x_236586 = x_236590;\n                            x_236587 = x_236591;\n                            x_236588 = x_236592;\n                            x_236589 = x_236593;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_236602 = 1;\n                    while (slt32(skip_threads_236602, 32)) {\n                        bool thread_active_236603 = sle32(skip_threads_236602,\n                                                          local_tid_236559 -\n                                                          squot32(local_tid_236559,\n                                                                  32) * 32) &&\n                             (squot32(local_tid_236559, 32) == 0 &&\n                              ltid_in_bounds_236598);\n                        \n                        if (thread_active_236603) {\n                            // read operands\n                            {\n                                x_236586 = ((volatile __local\n                                             int64_t *) scan_arr_mem_236563)[sext_i32_i64(local_tid_236559) -\n                                                                             sext_i32_i64(skip_threads_236602)];\n                                x_236587 = ((volatile __local\n                                             int64_t *) scan_arr_mem_236565)[sext_i32_i64(local_tid_236559) -\n                                                                             sext_i32_i64(skip_threads_236602)];\n                   ",
                   "             x_236588 = ((volatile __local\n                                             int64_t *) scan_arr_mem_236567)[sext_i32_i64(local_tid_236559) -\n                                                                             sext_i32_i64(skip_threads_236602)];\n                                x_236589 = ((volatile __local\n                                             int64_t *) scan_arr_mem_236569)[sext_i32_i64(local_tid_236559) -\n                                                                             sext_i32_i64(skip_threads_236602)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_236604 =\n                                 slt64(srem64(sext_i32_i64(local_tid_236559 *\n                                              32 + 32 - 1) +\n                                              chunk_offset_236572, n_203572),\n                                       sext_i32_i64(local_tid_236559 * 32 + 32 -\n                                       1) + chunk_offset_236572 -\n                                       (sext_i32_i64((local_tid_236559 -\n                                                      skip_threads_236602) *\n                                        32 + 32 - 1) + chunk_offset_236572));\n                            \n                            if (thread_active_236603 && inactive_236604) {\n                                x_236586 = x_236590;\n                                x_236587 = x_236591;\n                                x_236588 = x_236592;\n                                x_236589 = x_236593;\n                            }\n                            if (thread_active_236603) {\n                                if (!inactive_236604) {\n                                    int64_t defunc_1_op_res_236594 =\n                                            add64(x_236586, x_236590);\n                                    int64_t defunc_1_op_res_236595 =\n            ",
                   "                                add64(x_236587, x_236591);\n                                    int64_t defunc_1_op_res_236596 =\n                                            add64(x_236588, x_236592);\n                                    int64_t defunc_1_op_res_236597 =\n                                            add64(x_236589, x_236593);\n                                    \n                                    x_236586 = defunc_1_op_res_236594;\n                                    x_236587 = defunc_1_op_res_236595;\n                                    x_236588 = defunc_1_op_res_236596;\n                                    x_236589 = defunc_1_op_res_236597;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_236561, skip_threads_236602)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_236603) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  int64_t *) scan_arr_mem_236563)[sext_i32_i64(local_tid_236559)] =\n                                    x_236586;\n                                x_236590 = x_236586;\n                                ((volatile __local\n                                  int64_t *) scan_arr_mem_236565)[sext_i32_i64(local_tid_236559)] =\n                                    x_236587;\n                                x_236591 = x_236587;\n                                ((volatile __local\n                                  int64_t *) scan_arr_mem_236567)[sext_i32_i64(local_tid_236559)] =\n                                    x_236588;\n                                x_236592 = x_236588;\n                                ((volatile __local\n                                  int64_t *) scan_arr_mem_236569)[sext_i32_i64(local_tid_236559)] =\n                                    x_236589;\n                ",
                   "                x_236593 = x_236589;\n                            }\n                        }\n                        if (sle32(wave_sizze_236561, skip_threads_236602)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_236602 *= 2;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            bool no_carry_in_236605 = squot32(local_tid_236559, 32) == 0 ||\n                 !ltid_in_bounds_236598;\n            \n            // carry-in for every block except the first\n            {\n                // read operands\n                {\n                    if (!no_carry_in_236605) {\n                        x_236578 = x_236574;\n                        x_236579 = x_236575;\n                        x_236580 = x_236576;\n                        x_236581 = x_236577;\n                        x_236574 = ((__local\n                                     int64_t *) scan_arr_mem_236563)[sext_i32_i64(squot32(local_tid_236559,\n                                                                                          32)) -\n                                                                     (int64_t) 1];\n                        x_236575 = ((__local\n                                     int64_t *) scan_arr_mem_236565)[sext_i32_i64(squot32(local_tid_236559,\n                                                                                          32)) -\n                                                                     (int64_t) 1];\n                        x_236576 = ((__local\n                                     int64_t *) scan_arr_mem_236567)[sext_i32_i64(squot32(local_tid_236559,\n                                                                                          32)) -\n                                                                     (int64_t) 1];\n                        x_236577 = ((__local\n                                     int64_t *) scan_arr_mem_236",
                   "569)[sext_i32_i64(squot32(local_tid_236559,\n                                                                                          32)) -\n                                                                     (int64_t) 1];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_236606 =\n                         slt64(srem64(sext_i32_i64(local_tid_236559) +\n                                      chunk_offset_236572, n_203572),\n                               sext_i32_i64(local_tid_236559) +\n                               chunk_offset_236572 -\n                               (sext_i32_i64(squot32(local_tid_236559, 32) *\n                                32 - 1) + chunk_offset_236572));\n                    \n                    if (!no_carry_in_236605) {\n                        if (inactive_236606) {\n                            x_236574 = x_236578;\n                            x_236575 = x_236579;\n                            x_236576 = x_236580;\n                            x_236577 = x_236581;\n                        }\n                    }\n                    if (!no_carry_in_236605) {\n                        if (!inactive_236606) {\n                            int64_t defunc_1_op_res_236582 = add64(x_236574,\n                                                                   x_236578);\n                            int64_t defunc_1_op_res_236583 = add64(x_236575,\n                                                                   x_236579);\n                            int64_t defunc_1_op_res_236584 = add64(x_236576,\n                                                                   x_236580);\n                            int64_t defunc_1_op_res_236585 = add64(x_236577,\n                                                                   x_236581);\n                            \n                            x_236574 = defunc_1_op_res_236582;\n                            x_236575 = defunc_1_op_res_236583;\n         ",
                   "                   x_236576 = defunc_1_op_res_236584;\n                            x_236577 = defunc_1_op_res_236585;\n                        }\n                    }\n                }\n                // write final result\n                {\n                    if (!no_carry_in_236605) {\n                        ((__local\n                          int64_t *) scan_arr_mem_236563)[sext_i32_i64(local_tid_236559)] =\n                            x_236574;\n                        ((__local\n                          int64_t *) scan_arr_mem_236565)[sext_i32_i64(local_tid_236559)] =\n                            x_236575;\n                        ((__local\n                          int64_t *) scan_arr_mem_236567)[sext_i32_i64(local_tid_236559)] =\n                            x_236576;\n                        ((__local\n                          int64_t *) scan_arr_mem_236569)[sext_i32_i64(local_tid_236559)] =\n                            x_236577;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // restore correct values for first block\n            {\n                if (squot32(local_tid_236559, 32) == 0 &&\n                    ltid_in_bounds_236598) {\n                    ((__local\n                      int64_t *) scan_arr_mem_236563)[sext_i32_i64(local_tid_236559)] =\n                        x_236578;\n                    ((__local\n                      int64_t *) scan_arr_mem_236565)[sext_i32_i64(local_tid_236559)] =\n                        x_236579;\n                    ((__local\n                      int64_t *) scan_arr_mem_236567)[sext_i32_i64(local_tid_236559)] =\n                        x_236580;\n                    ((__local\n                      int64_t *) scan_arr_mem_236569)[sext_i32_i64(local_tid_236559)] =\n                        x_236581;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // threads in bounds write partial scan result\n            {\n                if (slt64(gtid_22800",
                   "3, partition_sizze_203667) &&\n                    slt64(gtid_228004, n_203572)) {\n                    int64_t tmp_236607;\n                    \n                    tmp_236607 = ((__local\n                                   int64_t *) scan_arr_mem_236563)[sext_i32_i64(local_tid_236559)];\n                    ((__global int64_t *) mem_231877)[gtid_228003 * n_203572 +\n                                                      gtid_228004] = tmp_236607;\n                    \n                    int64_t tmp_236608;\n                    \n                    tmp_236608 = ((__local\n                                   int64_t *) scan_arr_mem_236565)[sext_i32_i64(local_tid_236559)];\n                    ((__global int64_t *) mem_231881)[gtid_228003 * n_203572 +\n                                                      gtid_228004] = tmp_236608;\n                    \n                    int64_t tmp_236609;\n                    \n                    tmp_236609 = ((__local\n                                   int64_t *) scan_arr_mem_236567)[sext_i32_i64(local_tid_236559)];\n                    ((__global int64_t *) mem_231885)[gtid_228003 * n_203572 +\n                                                      gtid_228004] = tmp_236609;\n                    \n                    int64_t tmp_236610;\n                    \n                    tmp_236610 = ((__local\n                                   int64_t *) scan_arr_mem_236569)[sext_i32_i64(local_tid_236559)];\n                    ((__global int64_t *) mem_231889)[gtid_228003 * n_203572 +\n                                                      gtid_228004] = tmp_236610;\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_236611 = slt64(srem64(chunk_offset_236572 +\n                                                           segscan_group_sizze_227995,\n                                                           n_2035",
                   "72),\n                                                    chunk_offset_236572 +\n                                                    segscan_group_sizze_227995 -\n                                                    (chunk_offset_236572 +\n                                                     segscan_group_sizze_227995 -\n                                                     (int64_t) 1));\n                bool should_load_carry_236612 = local_tid_236559 == 0 &&\n                     !crosses_segment_236611;\n                \n                if (should_load_carry_236612) {\n                    x_228006 = ((__local\n                                 int64_t *) scan_arr_mem_236563)[segscan_group_sizze_227995 -\n                                                                 (int64_t) 1];\n                    x_228007 = ((__local\n                                 int64_t *) scan_arr_mem_236565)[segscan_group_sizze_227995 -\n                                                                 (int64_t) 1];\n                    x_228008 = ((__local\n                                 int64_t *) scan_arr_mem_236567)[segscan_group_sizze_227995 -\n                                                                 (int64_t) 1];\n                    x_228009 = ((__local\n                                 int64_t *) scan_arr_mem_236569)[segscan_group_sizze_227995 -\n                                                                 (int64_t) 1];\n                }\n                if (!should_load_carry_236612) {\n                    x_228006 = (int64_t) 0;\n                    x_228007 = (int64_t) 0;\n                    x_228008 = (int64_t) 0;\n                    x_228009 = (int64_t) 0;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    \n  error_1:\n    return;\n    #undef segscan_group_sizze_227995\n}\n__kernel void mainziscan_stage2_206957(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *s",
                   "can_arr_mem_232399_backing_aligned_0,\n                                       int64_t m_203571,\n                                       int64_t stage1_num_groups_232364,\n                                       int32_t num_threads_232365, __global\n                                       unsigned char *mem_229260)\n{\n    #define segscan_group_sizze_206952 (mainzisegscan_group_sizze_206951)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict scan_arr_mem_232399_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_232399_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232394;\n    int32_t local_tid_232395;\n    int64_t group_sizze_232398;\n    int32_t wave_sizze_232397;\n    int32_t group_tid_232396;\n    \n    global_tid_232394 = get_global_id(0);\n    local_tid_232395 = get_local_id(0);\n    group_sizze_232398 = get_local_size(0);\n    wave_sizze_232397 = LOCKSTEP_WIDTH;\n    group_tid_232396 = get_group_id(0);\n    \n    int32_t phys_tid_206957 = global_tid_232394;\n    __local unsigned char *scan_arr_mem_232399;\n    \n    scan_arr_mem_232399 = (__local\n                           unsigned char *) scan_arr_mem_232399_backing_0;\n    \n    int64_t flat_idx_232401 = (sext_i32_i64(local_tid_232395) + (int64_t) 1) *\n            (segscan_group_sizze_206952 * sdiv_up64(m_203571,\n                                                    sext_i32_i64(num_threads_232365))) -\n            (int64_t) 1;\n    int64_t gtid_206956 = flat_idx_232401;\n    \n    // threads in bound read carries; others get neutral element\n    {\n        if (slt64(gtid_206956, m_203571)) {\n            int64_t tmp_232402;\n            \n            tmp_232402 = ((__global int64_t *) mem_229260)[gtid_206956];\n            ((__local\n              int64_t *) scan_arr_mem_232399)[sext_i32_i64(local_tid_232395)] =\n                ",
                   "tmp_232402;\n        } else {\n            ((__local\n              int64_t *) scan_arr_mem_232399)[sext_i32_i64(local_tid_232395)] =\n                (int64_t) 0;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t x_203630;\n    int64_t y_203631;\n    int64_t x_232403;\n    int64_t y_232404;\n    bool ltid_in_bounds_232406 = slt64(sext_i32_i64(local_tid_232395),\n                                       stage1_num_groups_232364);\n    int32_t skip_threads_232407;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_232406) {\n            y_203631 = ((volatile __local\n                         int64_t *) scan_arr_mem_232399)[sext_i32_i64(local_tid_232395)];\n            if ((local_tid_232395 - squot32(local_tid_232395, 32) * 32) == 0) {\n                x_203630 = y_203631;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_232407 = 1;\n        while (slt32(skip_threads_232407, 32)) {\n            bool thread_active_232408 = sle32(skip_threads_232407,\n                                              local_tid_232395 -\n                                              squot32(local_tid_232395, 32) *\n                                              32) && ltid_in_bounds_232406;\n            \n            if (thread_active_232408) {\n                // read operands\n                {\n                    x_203630 = ((volatile __local\n                                 int64_t *) scan_arr_mem_232399)[sext_i32_i64(local_tid_232395) -\n                                                                 sext_i32_i64(skip_threads_232407)];\n                }\n            }\n            // perform operation\n            {\n                if (thread_active_232408) {\n                    int64_t zz_203632 = x_203630 + y_203631;\n                    \n                    x_203630 = zz_203632;\n                }\n            }\n            if (sle32(wave_sizze_232397, skip_threads_232407)) {\n                barrier(CLK_LOCAL_MEM_FEN",
                   "CE);\n            }\n            if (thread_active_232408) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_232399)[sext_i32_i64(local_tid_232395)] =\n                        x_203630;\n                    y_203631 = x_203630;\n                }\n            }\n            if (sle32(wave_sizze_232397, skip_threads_232407)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_232407 *= 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_232395 - squot32(local_tid_232395, 32) * 32) == 31 &&\n            ltid_in_bounds_232406) {\n            ((volatile __local\n              int64_t *) scan_arr_mem_232399)[sext_i32_i64(squot32(local_tid_232395,\n                                                                   32))] =\n                x_203630;\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_232409;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_232395, 32) == 0 && ltid_in_bounds_232406) {\n                y_232404 = ((volatile __local\n                             int64_t *) scan_arr_mem_232399)[sext_i32_i64(local_tid_232395)];\n                if ((local_tid_232395 - squot32(local_tid_232395, 32) * 32) ==\n                    0) {\n                    x_232403 = y_232404;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_232409 = 1;\n            while (slt32(skip_threads_232409, 32)) {\n                bool thread_active_232410 = sle32(skip_threads_232409,\n                                                  local_tid_232395 -\n                                                  squot32(local_tid_232395,\n                           ",
                   "                               32) * 32) &&\n                     (squot32(local_tid_232395, 32) == 0 &&\n                      ltid_in_bounds_232406);\n                \n                if (thread_active_232410) {\n                    // read operands\n                    {\n                        x_232403 = ((volatile __local\n                                     int64_t *) scan_arr_mem_232399)[sext_i32_i64(local_tid_232395) -\n                                                                     sext_i32_i64(skip_threads_232409)];\n                    }\n                }\n                // perform operation\n                {\n                    if (thread_active_232410) {\n                        int64_t zz_232405 = x_232403 + y_232404;\n                        \n                        x_232403 = zz_232405;\n                    }\n                }\n                if (sle32(wave_sizze_232397, skip_threads_232409)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_232410) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) scan_arr_mem_232399)[sext_i32_i64(local_tid_232395)] =\n                            x_232403;\n                        y_232404 = x_232403;\n                    }\n                }\n                if (sle32(wave_sizze_232397, skip_threads_232409)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_232409 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_232411 = squot32(local_tid_232395, 32) == 0 ||\n         !ltid_in_bounds_232406;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_232411) {\n                y_203631 = x_203630;\n                x_203630 = ((__local\n                             int64_t *) scan_arr_mem_232399)[sext_i32_i64(squot32(local_tid_2323",
                   "95,\n                                                                                  32)) -\n                                                             (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            if (!no_carry_in_232411) {\n                int64_t zz_203632 = x_203630 + y_203631;\n                \n                x_203630 = zz_203632;\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_232411) {\n                ((__local\n                  int64_t *) scan_arr_mem_232399)[sext_i32_i64(local_tid_232395)] =\n                    x_203630;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_232395, 32) == 0 && ltid_in_bounds_232406) {\n            ((__local\n              int64_t *) scan_arr_mem_232399)[sext_i32_i64(local_tid_232395)] =\n                y_203631;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // threads in bounds write scanned carries\n    {\n        if (slt64(gtid_206956, m_203571)) {\n            int64_t tmp_232412;\n            \n            tmp_232412 = ((__local\n                           int64_t *) scan_arr_mem_232399)[sext_i32_i64(local_tid_232395)];\n            ((__global int64_t *) mem_229260)[gtid_206956] = tmp_232412;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_206952\n}\n__kernel void mainziscan_stage2_207097(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_232501_backing_aligned_0,\n                                       int64_t n_203572,\n                                       int64_t partition_sizze_203667,\n                                       int64_t stage1_num_groups_232466,\n                                       int32_t num_threads_232467, __global\n                                       unsigned char *mem_229294)\n{\n    #define segscan_gro",
                   "up_sizze_207091 (mainzisegscan_group_sizze_207071)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict scan_arr_mem_232501_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_232501_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232496;\n    int32_t local_tid_232497;\n    int64_t group_sizze_232500;\n    int32_t wave_sizze_232499;\n    int32_t group_tid_232498;\n    \n    global_tid_232496 = get_global_id(0);\n    local_tid_232497 = get_local_id(0);\n    group_sizze_232500 = get_local_size(0);\n    wave_sizze_232499 = LOCKSTEP_WIDTH;\n    group_tid_232498 = get_group_id(0);\n    \n    int32_t phys_tid_207097 = global_tid_232496;\n    __local unsigned char *scan_arr_mem_232501;\n    \n    scan_arr_mem_232501 = (__local\n                           unsigned char *) scan_arr_mem_232501_backing_0;\n    \n    int64_t flat_idx_232503 = (sext_i32_i64(local_tid_232497) + (int64_t) 1) *\n            (segscan_group_sizze_207091 * sdiv_up64(partition_sizze_203667 *\n                                                    n_203572,\n                                                    sext_i32_i64(num_threads_232467))) -\n            (int64_t) 1;\n    int64_t gtid_207095 = squot64(flat_idx_232503, n_203572);\n    int64_t gtid_207096 = flat_idx_232503 - squot64(flat_idx_232503, n_203572) *\n            n_203572;\n    \n    // threads in bound read carries; others get neutral element\n    {\n        if (slt64(gtid_207095, partition_sizze_203667) && slt64(gtid_207096,\n                                                                n_203572)) {\n            int64_t tmp_232504;\n            \n            tmp_232504 = ((__global int64_t *) mem_229294)[gtid_207095 *\n                                                           n_203572 +\n                                                           gtid_207096];\n ",
                   "           ((__local\n              int64_t *) scan_arr_mem_232501)[sext_i32_i64(local_tid_232497)] =\n                tmp_232504;\n        } else {\n            ((__local\n              int64_t *) scan_arr_mem_232501)[sext_i32_i64(local_tid_232497)] =\n                (int64_t) 0;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t x_207098;\n    int64_t x_207099;\n    int64_t x_232505;\n    int64_t x_232506;\n    bool ltid_in_bounds_232508 = slt64(sext_i32_i64(local_tid_232497),\n                                       stage1_num_groups_232466);\n    int32_t skip_threads_232509;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_232508) {\n            x_207099 = ((volatile __local\n                         int64_t *) scan_arr_mem_232501)[sext_i32_i64(local_tid_232497)];\n            if ((local_tid_232497 - squot32(local_tid_232497, 32) * 32) == 0) {\n                x_207098 = x_207099;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_232509 = 1;\n        while (slt32(skip_threads_232509, 32)) {\n            bool thread_active_232510 = sle32(skip_threads_232509,\n                                              local_tid_232497 -\n                                              squot32(local_tid_232497, 32) *\n                                              32) && ltid_in_bounds_232508;\n            \n            if (thread_active_232510) {\n                // read operands\n                {\n                    x_207098 = ((volatile __local\n                                 int64_t *) scan_arr_mem_232501)[sext_i32_i64(local_tid_232497) -\n                                                                 sext_i32_i64(skip_threads_232509)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_232511 =\n                     slt64(srem64((sext_i32_i64(local_tid_232497) +\n                                   (int64_t) 1) * (segscan_group_sizze_207091 *\n  ",
                   "                                                 sdiv_up64(partition_sizze_203667 *\n                                                             n_203572,\n                                                             sext_i32_i64(num_threads_232467))) -\n                                  (int64_t) 1, n_203572),\n                           (sext_i32_i64(local_tid_232497) + (int64_t) 1) *\n                           (segscan_group_sizze_207091 *\n                            sdiv_up64(partition_sizze_203667 * n_203572,\n                                      sext_i32_i64(num_threads_232467))) -\n                           (int64_t) 1 - ((sext_i32_i64(local_tid_232497 -\n                                           skip_threads_232509) + (int64_t) 1) *\n                                          (segscan_group_sizze_207091 *\n                                           sdiv_up64(partition_sizze_203667 *\n                                                     n_203572,\n                                                     sext_i32_i64(num_threads_232467))) -\n                                          (int64_t) 1));\n                \n                if (thread_active_232510 && inactive_232511) {\n                    x_207098 = x_207099;\n                }\n                if (thread_active_232510) {\n                    if (!inactive_232511) {\n                        int64_t defunc_1_op_res_207100 = add64(x_207098,\n                                                               x_207099);\n                        \n                        x_207098 = defunc_1_op_res_207100;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_232499, skip_threads_232509)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_232510) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_232501)[sext_i32_i64(local_tid_232497)] =\n                        x_207098;\n    ",
                   "                x_207099 = x_207098;\n                }\n            }\n            if (sle32(wave_sizze_232499, skip_threads_232509)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_232509 *= 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_232497 - squot32(local_tid_232497, 32) * 32) == 31 &&\n            ltid_in_bounds_232508) {\n            ((volatile __local\n              int64_t *) scan_arr_mem_232501)[sext_i32_i64(squot32(local_tid_232497,\n                                                                   32))] =\n                x_207098;\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_232512;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_232497, 32) == 0 && ltid_in_bounds_232508) {\n                x_232506 = ((volatile __local\n                             int64_t *) scan_arr_mem_232501)[sext_i32_i64(local_tid_232497)];\n                if ((local_tid_232497 - squot32(local_tid_232497, 32) * 32) ==\n                    0) {\n                    x_232505 = x_232506;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_232512 = 1;\n            while (slt32(skip_threads_232512, 32)) {\n                bool thread_active_232513 = sle32(skip_threads_232512,\n                                                  local_tid_232497 -\n                                                  squot32(local_tid_232497,\n                                                          32) * 32) &&\n                     (squot32(local_tid_232497, 32) == 0 &&\n                      ltid_in_bounds_232508);\n                \n                if (thread_active_232513) {\n                    // read operands\n                    {\n    ",
                   "                    x_232505 = ((volatile __local\n                                     int64_t *) scan_arr_mem_232501)[sext_i32_i64(local_tid_232497) -\n                                                                     sext_i32_i64(skip_threads_232512)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_232514 =\n                         slt64(srem64((sext_i32_i64(local_tid_232497 * 32 + 32 -\n                                       1) + (int64_t) 1) *\n                                      (segscan_group_sizze_207091 *\n                                       sdiv_up64(partition_sizze_203667 *\n                                                 n_203572,\n                                                 sext_i32_i64(num_threads_232467))) -\n                                      (int64_t) 1, n_203572),\n                               (sext_i32_i64(local_tid_232497 * 32 + 32 - 1) +\n                                (int64_t) 1) * (segscan_group_sizze_207091 *\n                                                sdiv_up64(partition_sizze_203667 *\n                                                          n_203572,\n                                                          sext_i32_i64(num_threads_232467))) -\n                               (int64_t) 1 - ((sext_i32_i64((local_tid_232497 -\n                                                             skip_threads_232512) *\n                                               32 + 32 - 1) + (int64_t) 1) *\n                                              (segscan_group_sizze_207091 *\n                                               sdiv_up64(partition_sizze_203667 *\n                                                         n_203572,\n                                                         sext_i32_i64(num_threads_232467))) -\n                                              (int64_t) 1));\n                    \n                    if (thread_active_232513 && inactive_232514) {\n     ",
                   "                   x_232505 = x_232506;\n                    }\n                    if (thread_active_232513) {\n                        if (!inactive_232514) {\n                            int64_t defunc_1_op_res_232507 = add64(x_232505,\n                                                                   x_232506);\n                            \n                            x_232505 = defunc_1_op_res_232507;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_232499, skip_threads_232512)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_232513) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) scan_arr_mem_232501)[sext_i32_i64(local_tid_232497)] =\n                            x_232505;\n                        x_232506 = x_232505;\n                    }\n                }\n                if (sle32(wave_sizze_232499, skip_threads_232512)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_232512 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_232515 = squot32(local_tid_232497, 32) == 0 ||\n         !ltid_in_bounds_232508;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_232515) {\n                x_207099 = x_207098;\n                x_207098 = ((__local\n                             int64_t *) scan_arr_mem_232501)[sext_i32_i64(squot32(local_tid_232497,\n                                                                                  32)) -\n                                                             (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_232516 =\n                 slt64(srem64((sext_i32_i64(local_tid_232497) + (int64_t) 1) *\n                              (seg",
                   "scan_group_sizze_207091 *\n                               sdiv_up64(partition_sizze_203667 * n_203572,\n                                         sext_i32_i64(num_threads_232467))) -\n                              (int64_t) 1, n_203572),\n                       (sext_i32_i64(local_tid_232497) + (int64_t) 1) *\n                       (segscan_group_sizze_207091 *\n                        sdiv_up64(partition_sizze_203667 * n_203572,\n                                  sext_i32_i64(num_threads_232467))) -\n                       (int64_t) 1 - ((sext_i32_i64(squot32(local_tid_232497,\n                                                            32) * 32 - 1) +\n                                       (int64_t) 1) *\n                                      (segscan_group_sizze_207091 *\n                                       sdiv_up64(partition_sizze_203667 *\n                                                 n_203572,\n                                                 sext_i32_i64(num_threads_232467))) -\n                                      (int64_t) 1));\n            \n            if (!no_carry_in_232515) {\n                if (inactive_232516) {\n                    x_207098 = x_207099;\n                }\n            }\n            if (!no_carry_in_232515) {\n                if (!inactive_232516) {\n                    int64_t defunc_1_op_res_207100 = add64(x_207098, x_207099);\n                    \n                    x_207098 = defunc_1_op_res_207100;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_232515) {\n                ((__local\n                  int64_t *) scan_arr_mem_232501)[sext_i32_i64(local_tid_232497)] =\n                    x_207098;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_232497, 32) == 0 && ltid_in_bounds_232508) {\n            ((__local\n              int64_t *) scan_arr_mem_232501)[sext_i32_i64(local_tid_232497)] =\n",
                   "                x_207099;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // threads in bounds write scanned carries\n    {\n        if (slt64(gtid_207095, partition_sizze_203667) && slt64(gtid_207096,\n                                                                n_203572)) {\n            int64_t tmp_232517;\n            \n            tmp_232517 = ((__local\n                           int64_t *) scan_arr_mem_232501)[sext_i32_i64(local_tid_232497)];\n            ((__global int64_t *) mem_229294)[gtid_207095 * n_203572 +\n                                              gtid_207096] = tmp_232517;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_207091\n}\n__kernel void mainziscan_stage2_207649(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_232670_backing_aligned_0,\n                                       int64_t n_p_203574,\n                                       int64_t partition_sizze_203667,\n                                       int64_t defunc_0_f_res_203721,\n                                       int64_t stage1_num_groups_232635,\n                                       int32_t num_threads_232636, __global\n                                       unsigned char *mem_229358)\n{\n    #define segscan_group_sizze_207642 (mainzisegscan_group_sizze_207509)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict scan_arr_mem_232670_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_232670_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232665;\n    int32_t local_tid_232666;\n    int64_t group_sizze_232669;\n    int32_t wave_sizze_232668;\n    int32_t group_tid_232667;\n    \n    global_tid_232665 = get_global_id(0);\n    local_tid_232666 = get_local_id(0);\n",
                   "    group_sizze_232669 = get_local_size(0);\n    wave_sizze_232668 = LOCKSTEP_WIDTH;\n    group_tid_232667 = get_group_id(0);\n    \n    int32_t phys_tid_207649 = global_tid_232665;\n    __local unsigned char *scan_arr_mem_232670;\n    \n    scan_arr_mem_232670 = (__local\n                           unsigned char *) scan_arr_mem_232670_backing_0;\n    \n    int64_t flat_idx_232672 = (sext_i32_i64(local_tid_232666) + (int64_t) 1) *\n            (segscan_group_sizze_207642 * sdiv_up64(partition_sizze_203667 *\n                                                    n_p_203574 *\n                                                    defunc_0_f_res_203721,\n                                                    sext_i32_i64(num_threads_232636))) -\n            (int64_t) 1;\n    int64_t gtid_207646 = squot64(flat_idx_232672, n_p_203574 *\n                                  defunc_0_f_res_203721);\n    int64_t gtid_207647 = squot64(flat_idx_232672 - squot64(flat_idx_232672,\n                                                            n_p_203574 *\n                                                            defunc_0_f_res_203721) *\n                                  (n_p_203574 * defunc_0_f_res_203721),\n                                  defunc_0_f_res_203721);\n    int64_t gtid_207648 = flat_idx_232672 - squot64(flat_idx_232672,\n                                                    n_p_203574 *\n                                                    defunc_0_f_res_203721) *\n            (n_p_203574 * defunc_0_f_res_203721) - squot64(flat_idx_232672 -\n                                                           squot64(flat_idx_232672,\n                                                                   n_p_203574 *\n                                                                   defunc_0_f_res_203721) *\n                                                           (n_p_203574 *\n                                                            defunc_0_f_res_203721),\n                                                        ",
                   "   defunc_0_f_res_203721) *\n            defunc_0_f_res_203721;\n    \n    // threads in bound read carries; others get neutral element\n    {\n        if ((slt64(gtid_207646, partition_sizze_203667) && slt64(gtid_207647,\n                                                                 n_p_203574)) &&\n            slt64(gtid_207648, defunc_0_f_res_203721)) {\n            int64_t tmp_232673;\n            \n            tmp_232673 = ((__global int64_t *) mem_229358)[gtid_207646 *\n                                                           (defunc_0_f_res_203721 *\n                                                            n_p_203574) +\n                                                           gtid_207647 *\n                                                           defunc_0_f_res_203721 +\n                                                           gtid_207648];\n            ((__local\n              int64_t *) scan_arr_mem_232670)[sext_i32_i64(local_tid_232666)] =\n                tmp_232673;\n        } else {\n            ((__local\n              int64_t *) scan_arr_mem_232670)[sext_i32_i64(local_tid_232666)] =\n                (int64_t) 0;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t x_207650;\n    int64_t x_207651;\n    int64_t x_232674;\n    int64_t x_232675;\n    bool ltid_in_bounds_232677 = slt64(sext_i32_i64(local_tid_232666),\n                                       stage1_num_groups_232635);\n    int32_t skip_threads_232678;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_232677) {\n            x_207651 = ((volatile __local\n                         int64_t *) scan_arr_mem_232670)[sext_i32_i64(local_tid_232666)];\n            if ((local_tid_232666 - squot32(local_tid_232666, 32) * 32) == 0) {\n                x_207650 = x_207651;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_232678 = 1;\n        while (slt32(skip_threads_232678, 32)) {\n            bool thread_active_232679 = sle32(",
                   "skip_threads_232678,\n                                              local_tid_232666 -\n                                              squot32(local_tid_232666, 32) *\n                                              32) && ltid_in_bounds_232677;\n            \n            if (thread_active_232679) {\n                // read operands\n                {\n                    x_207650 = ((volatile __local\n                                 int64_t *) scan_arr_mem_232670)[sext_i32_i64(local_tid_232666) -\n                                                                 sext_i32_i64(skip_threads_232678)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_232680 =\n                     slt64(srem64((sext_i32_i64(local_tid_232666) +\n                                   (int64_t) 1) * (segscan_group_sizze_207642 *\n                                                   sdiv_up64(partition_sizze_203667 *\n                                                             n_p_203574 *\n                                                             defunc_0_f_res_203721,\n                                                             sext_i32_i64(num_threads_232636))) -\n                                  (int64_t) 1, defunc_0_f_res_203721),\n                           (sext_i32_i64(local_tid_232666) + (int64_t) 1) *\n                           (segscan_group_sizze_207642 *\n                            sdiv_up64(partition_sizze_203667 * n_p_203574 *\n                                      defunc_0_f_res_203721,\n                                      sext_i32_i64(num_threads_232636))) -\n                           (int64_t) 1 - ((sext_i32_i64(local_tid_232666 -\n                                           skip_threads_232678) + (int64_t) 1) *\n                                          (segscan_group_sizze_207642 *\n                                           sdiv_up64(partition_sizze_203667 *\n                                                     n_p_203574 *\n           ",
                   "                                          defunc_0_f_res_203721,\n                                                     sext_i32_i64(num_threads_232636))) -\n                                          (int64_t) 1));\n                \n                if (thread_active_232679 && inactive_232680) {\n                    x_207650 = x_207651;\n                }\n                if (thread_active_232679) {\n                    if (!inactive_232680) {\n                        int64_t defunc_1_op_res_207652 = add64(x_207650,\n                                                               x_207651);\n                        \n                        x_207650 = defunc_1_op_res_207652;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_232668, skip_threads_232678)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_232679) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_232670)[sext_i32_i64(local_tid_232666)] =\n                        x_207650;\n                    x_207651 = x_207650;\n                }\n            }\n            if (sle32(wave_sizze_232668, skip_threads_232678)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_232678 *= 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_232666 - squot32(local_tid_232666, 32) * 32) == 31 &&\n            ltid_in_bounds_232677) {\n            ((volatile __local\n              int64_t *) scan_arr_mem_232670)[sext_i32_i64(squot32(local_tid_232666,\n                                                                   32))] =\n                x_207650;\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_232681;\n        \n        // read input for",
                   " in-block scan\n        {\n            if (squot32(local_tid_232666, 32) == 0 && ltid_in_bounds_232677) {\n                x_232675 = ((volatile __local\n                             int64_t *) scan_arr_mem_232670)[sext_i32_i64(local_tid_232666)];\n                if ((local_tid_232666 - squot32(local_tid_232666, 32) * 32) ==\n                    0) {\n                    x_232674 = x_232675;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_232681 = 1;\n            while (slt32(skip_threads_232681, 32)) {\n                bool thread_active_232682 = sle32(skip_threads_232681,\n                                                  local_tid_232666 -\n                                                  squot32(local_tid_232666,\n                                                          32) * 32) &&\n                     (squot32(local_tid_232666, 32) == 0 &&\n                      ltid_in_bounds_232677);\n                \n                if (thread_active_232682) {\n                    // read operands\n                    {\n                        x_232674 = ((volatile __local\n                                     int64_t *) scan_arr_mem_232670)[sext_i32_i64(local_tid_232666) -\n                                                                     sext_i32_i64(skip_threads_232681)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_232683 =\n                         slt64(srem64((sext_i32_i64(local_tid_232666 * 32 + 32 -\n                                       1) + (int64_t) 1) *\n                                      (segscan_group_sizze_207642 *\n                                       sdiv_up64(partition_sizze_203667 *\n                                                 n_p_203574 *\n                                                 defunc_0_f_res_203721,\n                                                 sext_i32_i64(num_threads_232636))) -",
                   "\n                                      (int64_t) 1, defunc_0_f_res_203721),\n                               (sext_i32_i64(local_tid_232666 * 32 + 32 - 1) +\n                                (int64_t) 1) * (segscan_group_sizze_207642 *\n                                                sdiv_up64(partition_sizze_203667 *\n                                                          n_p_203574 *\n                                                          defunc_0_f_res_203721,\n                                                          sext_i32_i64(num_threads_232636))) -\n                               (int64_t) 1 - ((sext_i32_i64((local_tid_232666 -\n                                                             skip_threads_232681) *\n                                               32 + 32 - 1) + (int64_t) 1) *\n                                              (segscan_group_sizze_207642 *\n                                               sdiv_up64(partition_sizze_203667 *\n                                                         n_p_203574 *\n                                                         defunc_0_f_res_203721,\n                                                         sext_i32_i64(num_threads_232636))) -\n                                              (int64_t) 1));\n                    \n                    if (thread_active_232682 && inactive_232683) {\n                        x_232674 = x_232675;\n                    }\n                    if (thread_active_232682) {\n                        if (!inactive_232683) {\n                            int64_t defunc_1_op_res_232676 = add64(x_232674,\n                                                                   x_232675);\n                            \n                            x_232674 = defunc_1_op_res_232676;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_232668, skip_threads_232681)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active",
                   "_232682) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) scan_arr_mem_232670)[sext_i32_i64(local_tid_232666)] =\n                            x_232674;\n                        x_232675 = x_232674;\n                    }\n                }\n                if (sle32(wave_sizze_232668, skip_threads_232681)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_232681 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_232684 = squot32(local_tid_232666, 32) == 0 ||\n         !ltid_in_bounds_232677;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_232684) {\n                x_207651 = x_207650;\n                x_207650 = ((__local\n                             int64_t *) scan_arr_mem_232670)[sext_i32_i64(squot32(local_tid_232666,\n                                                                                  32)) -\n                                                             (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_232685 =\n                 slt64(srem64((sext_i32_i64(local_tid_232666) + (int64_t) 1) *\n                              (segscan_group_sizze_207642 *\n                               sdiv_up64(partition_sizze_203667 * n_p_203574 *\n                                         defunc_0_f_res_203721,\n                                         sext_i32_i64(num_threads_232636))) -\n                              (int64_t) 1, defunc_0_f_res_203721),\n                       (sext_i32_i64(local_tid_232666) + (int64_t) 1) *\n                       (segscan_group_sizze_207642 *\n                        sdiv_up64(partition_sizze_203667 * n_p_203574 *\n                                  defunc_0_f_res_203721,\n                                  sext_i32_i64(num_threads_232636))) -\n  ",
                   "                     (int64_t) 1 - ((sext_i32_i64(squot32(local_tid_232666,\n                                                            32) * 32 - 1) +\n                                       (int64_t) 1) *\n                                      (segscan_group_sizze_207642 *\n                                       sdiv_up64(partition_sizze_203667 *\n                                                 n_p_203574 *\n                                                 defunc_0_f_res_203721,\n                                                 sext_i32_i64(num_threads_232636))) -\n                                      (int64_t) 1));\n            \n            if (!no_carry_in_232684) {\n                if (inactive_232685) {\n                    x_207650 = x_207651;\n                }\n            }\n            if (!no_carry_in_232684) {\n                if (!inactive_232685) {\n                    int64_t defunc_1_op_res_207652 = add64(x_207650, x_207651);\n                    \n                    x_207650 = defunc_1_op_res_207652;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_232684) {\n                ((__local\n                  int64_t *) scan_arr_mem_232670)[sext_i32_i64(local_tid_232666)] =\n                    x_207650;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_232666, 32) == 0 && ltid_in_bounds_232677) {\n            ((__local\n              int64_t *) scan_arr_mem_232670)[sext_i32_i64(local_tid_232666)] =\n                x_207651;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // threads in bounds write scanned carries\n    {\n        if ((slt64(gtid_207646, partition_sizze_203667) && slt64(gtid_207647,\n                                                                 n_p_203574)) &&\n            slt64(gtid_207648, defunc_0_f_res_203721)) {\n            int64_t tmp_232686;\n            \n            tmp_232686 = ((__local\n ",
                   "                          int64_t *) scan_arr_mem_232670)[sext_i32_i64(local_tid_232666)];\n            ((__global int64_t *) mem_229358)[gtid_207646 *\n                                              (defunc_0_f_res_203721 *\n                                               n_p_203574) + gtid_207647 *\n                                              defunc_0_f_res_203721 +\n                                              gtid_207648] = tmp_232686;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_207642\n}\n__kernel void mainziscan_stage2_218773(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_234316_backing_aligned_0,\n                                       int64_t partition_sizze_203667,\n                                       int64_t lifted_single_ma_l_arg_204224,\n                                       int64_t stage1_num_groups_234281,\n                                       int32_t num_threads_234282, __global\n                                       unsigned char *mem_230625)\n{\n    #define segscan_group_sizze_218767 (mainzisegscan_group_sizze_218731)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict scan_arr_mem_234316_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_234316_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234311;\n    int32_t local_tid_234312;\n    int64_t group_sizze_234315;\n    int32_t wave_sizze_234314;\n    int32_t group_tid_234313;\n    \n    global_tid_234311 = get_global_id(0);\n    local_tid_234312 = get_local_id(0);\n    group_sizze_234315 = get_local_size(0);\n    wave_sizze_234314 = LOCKSTEP_WIDTH;\n    group_tid_234313 = get_group_id(0);\n    \n    int32_t phys_tid_218773 = global_tid_234311;\n    __local unsigned char *scan_",
                   "arr_mem_234316;\n    \n    scan_arr_mem_234316 = (__local\n                           unsigned char *) scan_arr_mem_234316_backing_0;\n    \n    int64_t flat_idx_234318 = (sext_i32_i64(local_tid_234312) + (int64_t) 1) *\n            (segscan_group_sizze_218767 * sdiv_up64(partition_sizze_203667 *\n                                                    lifted_single_ma_l_arg_204224,\n                                                    sext_i32_i64(num_threads_234282))) -\n            (int64_t) 1;\n    int64_t gtid_218771 = squot64(flat_idx_234318,\n                                  lifted_single_ma_l_arg_204224);\n    int64_t gtid_218772 = flat_idx_234318 - squot64(flat_idx_234318,\n                                                    lifted_single_ma_l_arg_204224) *\n            lifted_single_ma_l_arg_204224;\n    \n    // threads in bound read carries; others get neutral element\n    {\n        if (slt64(gtid_218771, partition_sizze_203667) && slt64(gtid_218772,\n                                                                lifted_single_ma_l_arg_204224)) {\n            double tmp_234319;\n            \n            tmp_234319 = ((__global double *) mem_230625)[gtid_218771 *\n                                                          lifted_single_ma_l_arg_204224 +\n                                                          gtid_218772];\n            ((__local\n              double *) scan_arr_mem_234316)[sext_i32_i64(local_tid_234312)] =\n                tmp_234319;\n        } else {\n            ((__local\n              double *) scan_arr_mem_234316)[sext_i32_i64(local_tid_234312)] =\n                0.0;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    double x_218774;\n    double x_218775;\n    double x_234320;\n    double x_234321;\n    bool ltid_in_bounds_234323 = slt64(sext_i32_i64(local_tid_234312),\n                                       stage1_num_groups_234281);\n    int32_t skip_threads_234324;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_234323) {\n       ",
                   "     x_218775 = ((volatile __local\n                         double *) scan_arr_mem_234316)[sext_i32_i64(local_tid_234312)];\n            if ((local_tid_234312 - squot32(local_tid_234312, 32) * 32) == 0) {\n                x_218774 = x_218775;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_234324 = 1;\n        while (slt32(skip_threads_234324, 32)) {\n            bool thread_active_234325 = sle32(skip_threads_234324,\n                                              local_tid_234312 -\n                                              squot32(local_tid_234312, 32) *\n                                              32) && ltid_in_bounds_234323;\n            \n            if (thread_active_234325) {\n                // read operands\n                {\n                    x_218774 = ((volatile __local\n                                 double *) scan_arr_mem_234316)[sext_i32_i64(local_tid_234312) -\n                                                                sext_i32_i64(skip_threads_234324)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_234326 =\n                     slt64(srem64((sext_i32_i64(local_tid_234312) +\n                                   (int64_t) 1) * (segscan_group_sizze_218767 *\n                                                   sdiv_up64(partition_sizze_203667 *\n                                                             lifted_single_ma_l_arg_204224,\n                                                             sext_i32_i64(num_threads_234282))) -\n                                  (int64_t) 1, lifted_single_ma_l_arg_204224),\n                           (sext_i32_i64(local_tid_234312) + (int64_t) 1) *\n                           (segscan_group_sizze_218767 *\n                            sdiv_up64(partition_sizze_203667 *\n                                      lifted_single_ma_l_arg_204224,\n                                      sext_i32_i64(num_threads_234",
                   "282))) -\n                           (int64_t) 1 - ((sext_i32_i64(local_tid_234312 -\n                                           skip_threads_234324) + (int64_t) 1) *\n                                          (segscan_group_sizze_218767 *\n                                           sdiv_up64(partition_sizze_203667 *\n                                                     lifted_single_ma_l_arg_204224,\n                                                     sext_i32_i64(num_threads_234282))) -\n                                          (int64_t) 1));\n                \n                if (thread_active_234325 && inactive_234326) {\n                    x_218774 = x_218775;\n                }\n                if (thread_active_234325) {\n                    if (!inactive_234326) {\n                        double defunc_1_op_res_218776 = x_218774 + x_218775;\n                        \n                        x_218774 = defunc_1_op_res_218776;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_234314, skip_threads_234324)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_234325) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) scan_arr_mem_234316)[sext_i32_i64(local_tid_234312)] =\n                        x_218774;\n                    x_218775 = x_218774;\n                }\n            }\n            if (sle32(wave_sizze_234314, skip_threads_234324)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_234324 *= 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_234312 - squot32(local_tid_234312, 32) * 32) == 31 &&\n            ltid_in_bounds_234323) {\n            ((volatile __local\n              double *) scan_arr_mem_234316)[sext_i32_i64(squot32(local_tid_234312,\n                                                    ",
                   "              32))] =\n                x_218774;\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_234327;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_234312, 32) == 0 && ltid_in_bounds_234323) {\n                x_234321 = ((volatile __local\n                             double *) scan_arr_mem_234316)[sext_i32_i64(local_tid_234312)];\n                if ((local_tid_234312 - squot32(local_tid_234312, 32) * 32) ==\n                    0) {\n                    x_234320 = x_234321;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_234327 = 1;\n            while (slt32(skip_threads_234327, 32)) {\n                bool thread_active_234328 = sle32(skip_threads_234327,\n                                                  local_tid_234312 -\n                                                  squot32(local_tid_234312,\n                                                          32) * 32) &&\n                     (squot32(local_tid_234312, 32) == 0 &&\n                      ltid_in_bounds_234323);\n                \n                if (thread_active_234328) {\n                    // read operands\n                    {\n                        x_234320 = ((volatile __local\n                                     double *) scan_arr_mem_234316)[sext_i32_i64(local_tid_234312) -\n                                                                    sext_i32_i64(skip_threads_234327)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_234329 =\n                         slt64(srem64((sext_i32_i64(local_tid_234312 * 32 + 32 -\n                                       1) + (int64_t) 1) *\n                                      (segscan_group_sizze_218767 *\n                                   ",
                   "    sdiv_up64(partition_sizze_203667 *\n                                                 lifted_single_ma_l_arg_204224,\n                                                 sext_i32_i64(num_threads_234282))) -\n                                      (int64_t) 1,\n                                      lifted_single_ma_l_arg_204224),\n                               (sext_i32_i64(local_tid_234312 * 32 + 32 - 1) +\n                                (int64_t) 1) * (segscan_group_sizze_218767 *\n                                                sdiv_up64(partition_sizze_203667 *\n                                                          lifted_single_ma_l_arg_204224,\n                                                          sext_i32_i64(num_threads_234282))) -\n                               (int64_t) 1 - ((sext_i32_i64((local_tid_234312 -\n                                                             skip_threads_234327) *\n                                               32 + 32 - 1) + (int64_t) 1) *\n                                              (segscan_group_sizze_218767 *\n                                               sdiv_up64(partition_sizze_203667 *\n                                                         lifted_single_ma_l_arg_204224,\n                                                         sext_i32_i64(num_threads_234282))) -\n                                              (int64_t) 1));\n                    \n                    if (thread_active_234328 && inactive_234329) {\n                        x_234320 = x_234321;\n                    }\n                    if (thread_active_234328) {\n                        if (!inactive_234329) {\n                            double defunc_1_op_res_234322 = x_234320 + x_234321;\n                            \n                            x_234320 = defunc_1_op_res_234322;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_234314, skip_threads_234327)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n",
                   "                }\n                if (thread_active_234328) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) scan_arr_mem_234316)[sext_i32_i64(local_tid_234312)] =\n                            x_234320;\n                        x_234321 = x_234320;\n                    }\n                }\n                if (sle32(wave_sizze_234314, skip_threads_234327)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_234327 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_234330 = squot32(local_tid_234312, 32) == 0 ||\n         !ltid_in_bounds_234323;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_234330) {\n                x_218775 = x_218774;\n                x_218774 = ((__local\n                             double *) scan_arr_mem_234316)[sext_i32_i64(squot32(local_tid_234312,\n                                                                                 32)) -\n                                                            (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_234331 =\n                 slt64(srem64((sext_i32_i64(local_tid_234312) + (int64_t) 1) *\n                              (segscan_group_sizze_218767 *\n                               sdiv_up64(partition_sizze_203667 *\n                                         lifted_single_ma_l_arg_204224,\n                                         sext_i32_i64(num_threads_234282))) -\n                              (int64_t) 1, lifted_single_ma_l_arg_204224),\n                       (sext_i32_i64(local_tid_234312) + (int64_t) 1) *\n                       (segscan_group_sizze_218767 *\n                        sdiv_up64(partition_sizze_203667 *\n                                  lifted_single_ma_l_arg_204224,\n                            ",
                   "      sext_i32_i64(num_threads_234282))) -\n                       (int64_t) 1 - ((sext_i32_i64(squot32(local_tid_234312,\n                                                            32) * 32 - 1) +\n                                       (int64_t) 1) *\n                                      (segscan_group_sizze_218767 *\n                                       sdiv_up64(partition_sizze_203667 *\n                                                 lifted_single_ma_l_arg_204224,\n                                                 sext_i32_i64(num_threads_234282))) -\n                                      (int64_t) 1));\n            \n            if (!no_carry_in_234330) {\n                if (inactive_234331) {\n                    x_218774 = x_218775;\n                }\n            }\n            if (!no_carry_in_234330) {\n                if (!inactive_234331) {\n                    double defunc_1_op_res_218776 = x_218774 + x_218775;\n                    \n                    x_218774 = defunc_1_op_res_218776;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_234330) {\n                ((__local\n                  double *) scan_arr_mem_234316)[sext_i32_i64(local_tid_234312)] =\n                    x_218774;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_234312, 32) == 0 && ltid_in_bounds_234323) {\n            ((__local\n              double *) scan_arr_mem_234316)[sext_i32_i64(local_tid_234312)] =\n                x_218775;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // threads in bounds write scanned carries\n    {\n        if (slt64(gtid_218771, partition_sizze_203667) && slt64(gtid_218772,\n                                                                lifted_single_ma_l_arg_204224)) {\n            double tmp_234332;\n            \n            tmp_234332 = ((__local\n                           double *) scan_arr_mem_234316)[sex",
                   "t_i32_i64(local_tid_234312)];\n            ((__global double *) mem_230625)[gtid_218771 *\n                                             lifted_single_ma_l_arg_204224 +\n                                             gtid_218772] = tmp_234332;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_218767\n}\n__kernel void mainziscan_stage2_218904(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_234459_backing_aligned_0,\n                                       int64_t partition_sizze_203667,\n                                       int64_t dyn_lifted_single_ma_l_arg_204234,\n                                       int64_t stage1_num_groups_234424,\n                                       int32_t num_threads_234425, __global\n                                       unsigned char *mem_230642)\n{\n    #define segscan_group_sizze_218898 (mainzisegscan_group_sizze_218862)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict scan_arr_mem_234459_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_234459_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234454;\n    int32_t local_tid_234455;\n    int64_t group_sizze_234458;\n    int32_t wave_sizze_234457;\n    int32_t group_tid_234456;\n    \n    global_tid_234454 = get_global_id(0);\n    local_tid_234455 = get_local_id(0);\n    group_sizze_234458 = get_local_size(0);\n    wave_sizze_234457 = LOCKSTEP_WIDTH;\n    group_tid_234456 = get_group_id(0);\n    \n    int32_t phys_tid_218904 = global_tid_234454;\n    __local unsigned char *scan_arr_mem_234459;\n    \n    scan_arr_mem_234459 = (__local\n                           unsigned char *) scan_arr_mem_234459_backing_0;\n    \n    int64_t flat_idx_234461 = (sext_i32_i64(local_tid_234455) ",
                   "+ (int64_t) 1) *\n            (segscan_group_sizze_218898 * sdiv_up64(partition_sizze_203667 *\n                                                    dyn_lifted_single_ma_l_arg_204234,\n                                                    sext_i32_i64(num_threads_234425))) -\n            (int64_t) 1;\n    int64_t gtid_218902 = squot64(flat_idx_234461,\n                                  dyn_lifted_single_ma_l_arg_204234);\n    int64_t gtid_218903 = flat_idx_234461 - squot64(flat_idx_234461,\n                                                    dyn_lifted_single_ma_l_arg_204234) *\n            dyn_lifted_single_ma_l_arg_204234;\n    \n    // threads in bound read carries; others get neutral element\n    {\n        if (slt64(gtid_218902, partition_sizze_203667) && slt64(gtid_218903,\n                                                                dyn_lifted_single_ma_l_arg_204234)) {\n            double tmp_234462;\n            \n            tmp_234462 = ((__global double *) mem_230642)[gtid_218902 *\n                                                          dyn_lifted_single_ma_l_arg_204234 +\n                                                          gtid_218903];\n            ((__local\n              double *) scan_arr_mem_234459)[sext_i32_i64(local_tid_234455)] =\n                tmp_234462;\n        } else {\n            ((__local\n              double *) scan_arr_mem_234459)[sext_i32_i64(local_tid_234455)] =\n                0.0;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    double x_218905;\n    double x_218906;\n    double x_234463;\n    double x_234464;\n    bool ltid_in_bounds_234466 = slt64(sext_i32_i64(local_tid_234455),\n                                       stage1_num_groups_234424);\n    int32_t skip_threads_234467;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_234466) {\n            x_218906 = ((volatile __local\n                         double *) scan_arr_mem_234459)[sext_i32_i64(local_tid_234455)];\n            if ((local_tid_234455 - squot32(local_",
                   "tid_234455, 32) * 32) == 0) {\n                x_218905 = x_218906;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_234467 = 1;\n        while (slt32(skip_threads_234467, 32)) {\n            bool thread_active_234468 = sle32(skip_threads_234467,\n                                              local_tid_234455 -\n                                              squot32(local_tid_234455, 32) *\n                                              32) && ltid_in_bounds_234466;\n            \n            if (thread_active_234468) {\n                // read operands\n                {\n                    x_218905 = ((volatile __local\n                                 double *) scan_arr_mem_234459)[sext_i32_i64(local_tid_234455) -\n                                                                sext_i32_i64(skip_threads_234467)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_234469 =\n                     slt64(srem64((sext_i32_i64(local_tid_234455) +\n                                   (int64_t) 1) * (segscan_group_sizze_218898 *\n                                                   sdiv_up64(partition_sizze_203667 *\n                                                             dyn_lifted_single_ma_l_arg_204234,\n                                                             sext_i32_i64(num_threads_234425))) -\n                                  (int64_t) 1,\n                                  dyn_lifted_single_ma_l_arg_204234),\n                           (sext_i32_i64(local_tid_234455) + (int64_t) 1) *\n                           (segscan_group_sizze_218898 *\n                            sdiv_up64(partition_sizze_203667 *\n                                      dyn_lifted_single_ma_l_arg_204234,\n                                      sext_i32_i64(num_threads_234425))) -\n                           (int64_t) 1 - ((sext_i32_i64(local_tid_234455 -\n                                           s",
                   "kip_threads_234467) + (int64_t) 1) *\n                                          (segscan_group_sizze_218898 *\n                                           sdiv_up64(partition_sizze_203667 *\n                                                     dyn_lifted_single_ma_l_arg_204234,\n                                                     sext_i32_i64(num_threads_234425))) -\n                                          (int64_t) 1));\n                \n                if (thread_active_234468 && inactive_234469) {\n                    x_218905 = x_218906;\n                }\n                if (thread_active_234468) {\n                    if (!inactive_234469) {\n                        double defunc_1_op_res_218907 = x_218905 + x_218906;\n                        \n                        x_218905 = defunc_1_op_res_218907;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_234457, skip_threads_234467)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_234468) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) scan_arr_mem_234459)[sext_i32_i64(local_tid_234455)] =\n                        x_218905;\n                    x_218906 = x_218905;\n                }\n            }\n            if (sle32(wave_sizze_234457, skip_threads_234467)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_234467 *= 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_234455 - squot32(local_tid_234455, 32) * 32) == 31 &&\n            ltid_in_bounds_234466) {\n            ((volatile __local\n              double *) scan_arr_mem_234459)[sext_i32_i64(squot32(local_tid_234455,\n                                                                  32))] =\n                x_218905;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // scan the first bloc",
                   "k, after which offset 'i' contains carry-in for block 'i+1'\n    {\n        int32_t skip_threads_234470;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_234455, 32) == 0 && ltid_in_bounds_234466) {\n                x_234464 = ((volatile __local\n                             double *) scan_arr_mem_234459)[sext_i32_i64(local_tid_234455)];\n                if ((local_tid_234455 - squot32(local_tid_234455, 32) * 32) ==\n                    0) {\n                    x_234463 = x_234464;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_234470 = 1;\n            while (slt32(skip_threads_234470, 32)) {\n                bool thread_active_234471 = sle32(skip_threads_234470,\n                                                  local_tid_234455 -\n                                                  squot32(local_tid_234455,\n                                                          32) * 32) &&\n                     (squot32(local_tid_234455, 32) == 0 &&\n                      ltid_in_bounds_234466);\n                \n                if (thread_active_234471) {\n                    // read operands\n                    {\n                        x_234463 = ((volatile __local\n                                     double *) scan_arr_mem_234459)[sext_i32_i64(local_tid_234455) -\n                                                                    sext_i32_i64(skip_threads_234470)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_234472 =\n                         slt64(srem64((sext_i32_i64(local_tid_234455 * 32 + 32 -\n                                       1) + (int64_t) 1) *\n                                      (segscan_group_sizze_218898 *\n                                       sdiv_up64(partition_sizze_203667 *\n                                                 dyn_lifted_single_ma_l_arg_204234,\n ",
                   "                                                sext_i32_i64(num_threads_234425))) -\n                                      (int64_t) 1,\n                                      dyn_lifted_single_ma_l_arg_204234),\n                               (sext_i32_i64(local_tid_234455 * 32 + 32 - 1) +\n                                (int64_t) 1) * (segscan_group_sizze_218898 *\n                                                sdiv_up64(partition_sizze_203667 *\n                                                          dyn_lifted_single_ma_l_arg_204234,\n                                                          sext_i32_i64(num_threads_234425))) -\n                               (int64_t) 1 - ((sext_i32_i64((local_tid_234455 -\n                                                             skip_threads_234470) *\n                                               32 + 32 - 1) + (int64_t) 1) *\n                                              (segscan_group_sizze_218898 *\n                                               sdiv_up64(partition_sizze_203667 *\n                                                         dyn_lifted_single_ma_l_arg_204234,\n                                                         sext_i32_i64(num_threads_234425))) -\n                                              (int64_t) 1));\n                    \n                    if (thread_active_234471 && inactive_234472) {\n                        x_234463 = x_234464;\n                    }\n                    if (thread_active_234471) {\n                        if (!inactive_234472) {\n                            double defunc_1_op_res_234465 = x_234463 + x_234464;\n                            \n                            x_234463 = defunc_1_op_res_234465;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_234457, skip_threads_234470)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_234471) {\n                    // write result\n          ",
                   "          {\n                        ((volatile __local\n                          double *) scan_arr_mem_234459)[sext_i32_i64(local_tid_234455)] =\n                            x_234463;\n                        x_234464 = x_234463;\n                    }\n                }\n                if (sle32(wave_sizze_234457, skip_threads_234470)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_234470 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_234473 = squot32(local_tid_234455, 32) == 0 ||\n         !ltid_in_bounds_234466;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_234473) {\n                x_218906 = x_218905;\n                x_218905 = ((__local\n                             double *) scan_arr_mem_234459)[sext_i32_i64(squot32(local_tid_234455,\n                                                                                 32)) -\n                                                            (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_234474 =\n                 slt64(srem64((sext_i32_i64(local_tid_234455) + (int64_t) 1) *\n                              (segscan_group_sizze_218898 *\n                               sdiv_up64(partition_sizze_203667 *\n                                         dyn_lifted_single_ma_l_arg_204234,\n                                         sext_i32_i64(num_threads_234425))) -\n                              (int64_t) 1, dyn_lifted_single_ma_l_arg_204234),\n                       (sext_i32_i64(local_tid_234455) + (int64_t) 1) *\n                       (segscan_group_sizze_218898 *\n                        sdiv_up64(partition_sizze_203667 *\n                                  dyn_lifted_single_ma_l_arg_204234,\n                                  sext_i32_i64(num_threads_234425))) -\n                       (int64_t) 1 - ((sext_i32_i64(s",
                   "quot32(local_tid_234455,\n                                                            32) * 32 - 1) +\n                                       (int64_t) 1) *\n                                      (segscan_group_sizze_218898 *\n                                       sdiv_up64(partition_sizze_203667 *\n                                                 dyn_lifted_single_ma_l_arg_204234,\n                                                 sext_i32_i64(num_threads_234425))) -\n                                      (int64_t) 1));\n            \n            if (!no_carry_in_234473) {\n                if (inactive_234474) {\n                    x_218905 = x_218906;\n                }\n            }\n            if (!no_carry_in_234473) {\n                if (!inactive_234474) {\n                    double defunc_1_op_res_218907 = x_218905 + x_218906;\n                    \n                    x_218905 = defunc_1_op_res_218907;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_234473) {\n                ((__local\n                  double *) scan_arr_mem_234459)[sext_i32_i64(local_tid_234455)] =\n                    x_218905;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_234455, 32) == 0 && ltid_in_bounds_234466) {\n            ((__local\n              double *) scan_arr_mem_234459)[sext_i32_i64(local_tid_234455)] =\n                x_218906;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // threads in bounds write scanned carries\n    {\n        if (slt64(gtid_218902, partition_sizze_203667) && slt64(gtid_218903,\n                                                                dyn_lifted_single_ma_l_arg_204234)) {\n            double tmp_234475;\n            \n            tmp_234475 = ((__local\n                           double *) scan_arr_mem_234459)[sext_i32_i64(local_tid_234455)];\n            ((__global double *) mem_230642)[gtid_218902 *",
                   "\n                                             dyn_lifted_single_ma_l_arg_204234 +\n                                             gtid_218903] = tmp_234475;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_218898\n}\n__kernel void mainziscan_stage2_219035(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_234602_backing_aligned_0,\n                                       int64_t n_203572,\n                                       int64_t partition_sizze_203667,\n                                       int64_t stage1_num_groups_234567,\n                                       int32_t num_threads_234568, __global\n                                       unsigned char *mem_230659)\n{\n    #define segscan_group_sizze_219029 (mainzisegscan_group_sizze_218993)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict scan_arr_mem_234602_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_234602_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234597;\n    int32_t local_tid_234598;\n    int64_t group_sizze_234601;\n    int32_t wave_sizze_234600;\n    int32_t group_tid_234599;\n    \n    global_tid_234597 = get_global_id(0);\n    local_tid_234598 = get_local_id(0);\n    group_sizze_234601 = get_local_size(0);\n    wave_sizze_234600 = LOCKSTEP_WIDTH;\n    group_tid_234599 = get_group_id(0);\n    \n    int32_t phys_tid_219035 = global_tid_234597;\n    __local unsigned char *scan_arr_mem_234602;\n    \n    scan_arr_mem_234602 = (__local\n                           unsigned char *) scan_arr_mem_234602_backing_0;\n    \n    int64_t flat_idx_234604 = (sext_i32_i64(local_tid_234598) + (int64_t) 1) *\n            (segscan_group_sizze_219029 * sdiv_up64(partition_sizze_203667 *\n               ",
                   "                                     n_203572,\n                                                    sext_i32_i64(num_threads_234568))) -\n            (int64_t) 1;\n    int64_t gtid_219033 = squot64(flat_idx_234604, n_203572);\n    int64_t gtid_219034 = flat_idx_234604 - squot64(flat_idx_234604, n_203572) *\n            n_203572;\n    \n    // threads in bound read carries; others get neutral element\n    {\n        if (slt64(gtid_219033, partition_sizze_203667) && slt64(gtid_219034,\n                                                                n_203572)) {\n            double tmp_234605;\n            \n            tmp_234605 = ((__global double *) mem_230659)[gtid_219033 *\n                                                          n_203572 +\n                                                          gtid_219034];\n            ((__local\n              double *) scan_arr_mem_234602)[sext_i32_i64(local_tid_234598)] =\n                tmp_234605;\n        } else {\n            ((__local\n              double *) scan_arr_mem_234602)[sext_i32_i64(local_tid_234598)] =\n                0.0;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    double x_219036;\n    double x_219037;\n    double x_234606;\n    double x_234607;\n    bool ltid_in_bounds_234609 = slt64(sext_i32_i64(local_tid_234598),\n                                       stage1_num_groups_234567);\n    int32_t skip_threads_234610;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_234609) {\n            x_219037 = ((volatile __local\n                         double *) scan_arr_mem_234602)[sext_i32_i64(local_tid_234598)];\n            if ((local_tid_234598 - squot32(local_tid_234598, 32) * 32) == 0) {\n                x_219036 = x_219037;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_234610 = 1;\n        while (slt32(skip_threads_234610, 32)) {\n            bool thread_active_234611 = sle32(skip_threads_234610,\n                                         ",
                   "     local_tid_234598 -\n                                              squot32(local_tid_234598, 32) *\n                                              32) && ltid_in_bounds_234609;\n            \n            if (thread_active_234611) {\n                // read operands\n                {\n                    x_219036 = ((volatile __local\n                                 double *) scan_arr_mem_234602)[sext_i32_i64(local_tid_234598) -\n                                                                sext_i32_i64(skip_threads_234610)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_234612 =\n                     slt64(srem64((sext_i32_i64(local_tid_234598) +\n                                   (int64_t) 1) * (segscan_group_sizze_219029 *\n                                                   sdiv_up64(partition_sizze_203667 *\n                                                             n_203572,\n                                                             sext_i32_i64(num_threads_234568))) -\n                                  (int64_t) 1, n_203572),\n                           (sext_i32_i64(local_tid_234598) + (int64_t) 1) *\n                           (segscan_group_sizze_219029 *\n                            sdiv_up64(partition_sizze_203667 * n_203572,\n                                      sext_i32_i64(num_threads_234568))) -\n                           (int64_t) 1 - ((sext_i32_i64(local_tid_234598 -\n                                           skip_threads_234610) + (int64_t) 1) *\n                                          (segscan_group_sizze_219029 *\n                                           sdiv_up64(partition_sizze_203667 *\n                                                     n_203572,\n                                                     sext_i32_i64(num_threads_234568))) -\n                                          (int64_t) 1));\n                \n                if (thread_active_234611 && inactive_234612) {\n               ",
                   "     x_219036 = x_219037;\n                }\n                if (thread_active_234611) {\n                    if (!inactive_234612) {\n                        double defunc_1_op_res_219038 = x_219036 + x_219037;\n                        \n                        x_219036 = defunc_1_op_res_219038;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_234600, skip_threads_234610)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_234611) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) scan_arr_mem_234602)[sext_i32_i64(local_tid_234598)] =\n                        x_219036;\n                    x_219037 = x_219036;\n                }\n            }\n            if (sle32(wave_sizze_234600, skip_threads_234610)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_234610 *= 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_234598 - squot32(local_tid_234598, 32) * 32) == 31 &&\n            ltid_in_bounds_234609) {\n            ((volatile __local\n              double *) scan_arr_mem_234602)[sext_i32_i64(squot32(local_tid_234598,\n                                                                  32))] =\n                x_219036;\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_234613;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_234598, 32) == 0 && ltid_in_bounds_234609) {\n                x_234607 = ((volatile __local\n                             double *) scan_arr_mem_234602)[sext_i32_i64(local_tid_234598)];\n                if ((local_tid_234598 - squot32(local_tid_234598, 32) * 32) ==\n                    0) {\n                    x_234606 = x_",
                   "234607;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_234613 = 1;\n            while (slt32(skip_threads_234613, 32)) {\n                bool thread_active_234614 = sle32(skip_threads_234613,\n                                                  local_tid_234598 -\n                                                  squot32(local_tid_234598,\n                                                          32) * 32) &&\n                     (squot32(local_tid_234598, 32) == 0 &&\n                      ltid_in_bounds_234609);\n                \n                if (thread_active_234614) {\n                    // read operands\n                    {\n                        x_234606 = ((volatile __local\n                                     double *) scan_arr_mem_234602)[sext_i32_i64(local_tid_234598) -\n                                                                    sext_i32_i64(skip_threads_234613)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_234615 =\n                         slt64(srem64((sext_i32_i64(local_tid_234598 * 32 + 32 -\n                                       1) + (int64_t) 1) *\n                                      (segscan_group_sizze_219029 *\n                                       sdiv_up64(partition_sizze_203667 *\n                                                 n_203572,\n                                                 sext_i32_i64(num_threads_234568))) -\n                                      (int64_t) 1, n_203572),\n                               (sext_i32_i64(local_tid_234598 * 32 + 32 - 1) +\n                                (int64_t) 1) * (segscan_group_sizze_219029 *\n                                                sdiv_up64(partition_sizze_203667 *\n                                                          n_203572,\n                                                          sext_i32_i64(num_threads_23456",
                   "8))) -\n                               (int64_t) 1 - ((sext_i32_i64((local_tid_234598 -\n                                                             skip_threads_234613) *\n                                               32 + 32 - 1) + (int64_t) 1) *\n                                              (segscan_group_sizze_219029 *\n                                               sdiv_up64(partition_sizze_203667 *\n                                                         n_203572,\n                                                         sext_i32_i64(num_threads_234568))) -\n                                              (int64_t) 1));\n                    \n                    if (thread_active_234614 && inactive_234615) {\n                        x_234606 = x_234607;\n                    }\n                    if (thread_active_234614) {\n                        if (!inactive_234615) {\n                            double defunc_1_op_res_234608 = x_234606 + x_234607;\n                            \n                            x_234606 = defunc_1_op_res_234608;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_234600, skip_threads_234613)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_234614) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) scan_arr_mem_234602)[sext_i32_i64(local_tid_234598)] =\n                            x_234606;\n                        x_234607 = x_234606;\n                    }\n                }\n                if (sle32(wave_sizze_234600, skip_threads_234613)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_234613 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_234616 = squot32(local_tid_234598, 32) == 0 ||\n         !ltid_in_bounds_234609;\n    \n    // carry-in for every block ",
                   "except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_234616) {\n                x_219037 = x_219036;\n                x_219036 = ((__local\n                             double *) scan_arr_mem_234602)[sext_i32_i64(squot32(local_tid_234598,\n                                                                                 32)) -\n                                                            (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_234617 =\n                 slt64(srem64((sext_i32_i64(local_tid_234598) + (int64_t) 1) *\n                              (segscan_group_sizze_219029 *\n                               sdiv_up64(partition_sizze_203667 * n_203572,\n                                         sext_i32_i64(num_threads_234568))) -\n                              (int64_t) 1, n_203572),\n                       (sext_i32_i64(local_tid_234598) + (int64_t) 1) *\n                       (segscan_group_sizze_219029 *\n                        sdiv_up64(partition_sizze_203667 * n_203572,\n                                  sext_i32_i64(num_threads_234568))) -\n                       (int64_t) 1 - ((sext_i32_i64(squot32(local_tid_234598,\n                                                            32) * 32 - 1) +\n                                       (int64_t) 1) *\n                                      (segscan_group_sizze_219029 *\n                                       sdiv_up64(partition_sizze_203667 *\n                                                 n_203572,\n                                                 sext_i32_i64(num_threads_234568))) -\n                                      (int64_t) 1));\n            \n            if (!no_carry_in_234616) {\n                if (inactive_234617) {\n                    x_219036 = x_219037;\n                }\n            }\n            if (!no_carry_in_234616) {\n                if (!inactive_234617) {\n                    double defunc_1_op_res_219038 = x_219036 + x_21",
                   "9037;\n                    \n                    x_219036 = defunc_1_op_res_219038;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_234616) {\n                ((__local\n                  double *) scan_arr_mem_234602)[sext_i32_i64(local_tid_234598)] =\n                    x_219036;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_234598, 32) == 0 && ltid_in_bounds_234609) {\n            ((__local\n              double *) scan_arr_mem_234602)[sext_i32_i64(local_tid_234598)] =\n                x_219037;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // threads in bounds write scanned carries\n    {\n        if (slt64(gtid_219033, partition_sizze_203667) && slt64(gtid_219034,\n                                                                n_203572)) {\n            double tmp_234618;\n            \n            tmp_234618 = ((__local\n                           double *) scan_arr_mem_234602)[sext_i32_i64(local_tid_234598)];\n            ((__global double *) mem_230659)[gtid_219033 * n_203572 +\n                                             gtid_219034] = tmp_234618;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_219029\n}\n__kernel void mainziscan_stage2_228005(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_236624_backing_aligned_0,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_236622_backing_aligned_1,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_236620_backing_aligned_2,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_236618_backing_aligned_3,\n                                       int64_t",
                   " n_203572,\n                                       int64_t partition_sizze_203667,\n                                       int64_t stage1_num_groups_236556,\n                                       int32_t num_threads_236557, __global\n                                       unsigned char *mem_231877, __global\n                                       unsigned char *mem_231881, __global\n                                       unsigned char *mem_231885, __global\n                                       unsigned char *mem_231889)\n{\n    #define segscan_group_sizze_227995 (mainzisegscan_group_sizze_227715)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict scan_arr_mem_236624_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_236624_backing_aligned_0;\n    __local volatile unsigned char *restrict scan_arr_mem_236622_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_236622_backing_aligned_1;\n    __local volatile unsigned char *restrict scan_arr_mem_236620_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_236620_backing_aligned_2;\n    __local volatile unsigned char *restrict scan_arr_mem_236618_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_236618_backing_aligned_3;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236613;\n    int32_t local_tid_236614;\n    int64_t group_sizze_236617;\n    int32_t wave_sizze_236616;\n    int32_t group_tid_236615;\n    \n    global_tid_236613 = get_global_id(0);\n    local_tid_236614 = get_local_id(0);\n    group_sizze_236617 = get_local_size(0);\n    wave_sizze_236616 = LOCKSTEP_WIDTH;\n    group_tid_236615 = get_group_id(0)",
                   ";\n    \n    int32_t phys_tid_228005 = global_tid_236613;\n    __local unsigned char *scan_arr_mem_236618;\n    __local unsigned char *scan_arr_mem_236620;\n    __local unsigned char *scan_arr_mem_236622;\n    __local unsigned char *scan_arr_mem_236624;\n    \n    scan_arr_mem_236618 = (__local\n                           unsigned char *) scan_arr_mem_236618_backing_0;\n    scan_arr_mem_236620 = (__local\n                           unsigned char *) scan_arr_mem_236620_backing_1;\n    scan_arr_mem_236622 = (__local\n                           unsigned char *) scan_arr_mem_236622_backing_2;\n    scan_arr_mem_236624 = (__local\n                           unsigned char *) scan_arr_mem_236624_backing_3;\n    \n    int64_t flat_idx_236626 = (sext_i32_i64(local_tid_236614) + (int64_t) 1) *\n            (segscan_group_sizze_227995 * sdiv_up64(partition_sizze_203667 *\n                                                    n_203572,\n                                                    sext_i32_i64(num_threads_236557))) -\n            (int64_t) 1;\n    int64_t gtid_228003 = squot64(flat_idx_236626, n_203572);\n    int64_t gtid_228004 = flat_idx_236626 - squot64(flat_idx_236626, n_203572) *\n            n_203572;\n    \n    // threads in bound read carries; others get neutral element\n    {\n        if (slt64(gtid_228003, partition_sizze_203667) && slt64(gtid_228004,\n                                                                n_203572)) {\n            int64_t tmp_236627;\n            \n            tmp_236627 = ((__global int64_t *) mem_231877)[gtid_228003 *\n                                                           n_203572 +\n                                                           gtid_228004];\n            ((__local\n              int64_t *) scan_arr_mem_236618)[sext_i32_i64(local_tid_236614)] =\n                tmp_236627;\n            \n            int64_t tmp_236628;\n            \n            tmp_236628 = ((__global int64_t *) mem_231881)[gtid_228003 *\n                                                     ",
                   "      n_203572 +\n                                                           gtid_228004];\n            ((__local\n              int64_t *) scan_arr_mem_236620)[sext_i32_i64(local_tid_236614)] =\n                tmp_236628;\n            \n            int64_t tmp_236629;\n            \n            tmp_236629 = ((__global int64_t *) mem_231885)[gtid_228003 *\n                                                           n_203572 +\n                                                           gtid_228004];\n            ((__local\n              int64_t *) scan_arr_mem_236622)[sext_i32_i64(local_tid_236614)] =\n                tmp_236629;\n            \n            int64_t tmp_236630;\n            \n            tmp_236630 = ((__global int64_t *) mem_231889)[gtid_228003 *\n                                                           n_203572 +\n                                                           gtid_228004];\n            ((__local\n              int64_t *) scan_arr_mem_236624)[sext_i32_i64(local_tid_236614)] =\n                tmp_236630;\n        } else {\n            ((__local\n              int64_t *) scan_arr_mem_236618)[sext_i32_i64(local_tid_236614)] =\n                (int64_t) 0;\n            ((__local\n              int64_t *) scan_arr_mem_236620)[sext_i32_i64(local_tid_236614)] =\n                (int64_t) 0;\n            ((__local\n              int64_t *) scan_arr_mem_236622)[sext_i32_i64(local_tid_236614)] =\n                (int64_t) 0;\n            ((__local\n              int64_t *) scan_arr_mem_236624)[sext_i32_i64(local_tid_236614)] =\n                (int64_t) 0;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t x_228006;\n    int64_t x_228007;\n    int64_t x_228008;\n    int64_t x_228009;\n    int64_t x_228010;\n    int64_t x_228011;\n    int64_t x_228012;\n    int64_t x_228013;\n    int64_t x_236631;\n    int64_t x_236632;\n    int64_t x_236633;\n    int64_t x_236634;\n    int64_t x_236635;\n    int64_t x_236636;\n    int64_t x_236637;\n    int64_t x_236638;\n    bool ltid_in_bounds_",
                   "236643 = slt64(sext_i32_i64(local_tid_236614),\n                                       stage1_num_groups_236556);\n    int32_t skip_threads_236644;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_236643) {\n            x_228010 = ((volatile __local\n                         int64_t *) scan_arr_mem_236618)[sext_i32_i64(local_tid_236614)];\n            x_228011 = ((volatile __local\n                         int64_t *) scan_arr_mem_236620)[sext_i32_i64(local_tid_236614)];\n            x_228012 = ((volatile __local\n                         int64_t *) scan_arr_mem_236622)[sext_i32_i64(local_tid_236614)];\n            x_228013 = ((volatile __local\n                         int64_t *) scan_arr_mem_236624)[sext_i32_i64(local_tid_236614)];\n            if ((local_tid_236614 - squot32(local_tid_236614, 32) * 32) == 0) {\n                x_228006 = x_228010;\n                x_228007 = x_228011;\n                x_228008 = x_228012;\n                x_228009 = x_228013;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_236644 = 1;\n        while (slt32(skip_threads_236644, 32)) {\n            bool thread_active_236645 = sle32(skip_threads_236644,\n                                              local_tid_236614 -\n                                              squot32(local_tid_236614, 32) *\n                                              32) && ltid_in_bounds_236643;\n            \n            if (thread_active_236645) {\n                // read operands\n                {\n                    x_228006 = ((volatile __local\n                                 int64_t *) scan_arr_mem_236618)[sext_i32_i64(local_tid_236614) -\n                                                                 sext_i32_i64(skip_threads_236644)];\n                    x_228007 = ((volatile __local\n                                 int64_t *) scan_arr_mem_236620)[sext_i32_i64(local_tid_236614) -\n                                                         ",
                   "        sext_i32_i64(skip_threads_236644)];\n                    x_228008 = ((volatile __local\n                                 int64_t *) scan_arr_mem_236622)[sext_i32_i64(local_tid_236614) -\n                                                                 sext_i32_i64(skip_threads_236644)];\n                    x_228009 = ((volatile __local\n                                 int64_t *) scan_arr_mem_236624)[sext_i32_i64(local_tid_236614) -\n                                                                 sext_i32_i64(skip_threads_236644)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_236646 =\n                     slt64(srem64((sext_i32_i64(local_tid_236614) +\n                                   (int64_t) 1) * (segscan_group_sizze_227995 *\n                                                   sdiv_up64(partition_sizze_203667 *\n                                                             n_203572,\n                                                             sext_i32_i64(num_threads_236557))) -\n                                  (int64_t) 1, n_203572),\n                           (sext_i32_i64(local_tid_236614) + (int64_t) 1) *\n                           (segscan_group_sizze_227995 *\n                            sdiv_up64(partition_sizze_203667 * n_203572,\n                                      sext_i32_i64(num_threads_236557))) -\n                           (int64_t) 1 - ((sext_i32_i64(local_tid_236614 -\n                                           skip_threads_236644) + (int64_t) 1) *\n                                          (segscan_group_sizze_227995 *\n                                           sdiv_up64(partition_sizze_203667 *\n                                                     n_203572,\n                                                     sext_i32_i64(num_threads_236557))) -\n                                          (int64_t) 1));\n                \n                if (thread_active_236645 && inactive_236646) {\n  ",
                   "                  x_228006 = x_228010;\n                    x_228007 = x_228011;\n                    x_228008 = x_228012;\n                    x_228009 = x_228013;\n                }\n                if (thread_active_236645) {\n                    if (!inactive_236646) {\n                        int64_t defunc_1_op_res_228014 = add64(x_228006,\n                                                               x_228010);\n                        int64_t defunc_1_op_res_228015 = add64(x_228007,\n                                                               x_228011);\n                        int64_t defunc_1_op_res_228016 = add64(x_228008,\n                                                               x_228012);\n                        int64_t defunc_1_op_res_228017 = add64(x_228009,\n                                                               x_228013);\n                        \n                        x_228006 = defunc_1_op_res_228014;\n                        x_228007 = defunc_1_op_res_228015;\n                        x_228008 = defunc_1_op_res_228016;\n                        x_228009 = defunc_1_op_res_228017;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_236616, skip_threads_236644)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_236645) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_236618)[sext_i32_i64(local_tid_236614)] =\n                        x_228006;\n                    x_228010 = x_228006;\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_236620)[sext_i32_i64(local_tid_236614)] =\n                        x_228007;\n                    x_228011 = x_228007;\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_236622)[sext_i32_i64(local_tid_236614)] =\n                        x_228008;\n                    x_228012 = x_228008;\n        ",
                   "            ((volatile __local\n                      int64_t *) scan_arr_mem_236624)[sext_i32_i64(local_tid_236614)] =\n                        x_228009;\n                    x_228013 = x_228009;\n                }\n            }\n            if (sle32(wave_sizze_236616, skip_threads_236644)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_236644 *= 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_236614 - squot32(local_tid_236614, 32) * 32) == 31 &&\n            ltid_in_bounds_236643) {\n            ((volatile __local\n              int64_t *) scan_arr_mem_236618)[sext_i32_i64(squot32(local_tid_236614,\n                                                                   32))] =\n                x_228006;\n            ((volatile __local\n              int64_t *) scan_arr_mem_236620)[sext_i32_i64(squot32(local_tid_236614,\n                                                                   32))] =\n                x_228007;\n            ((volatile __local\n              int64_t *) scan_arr_mem_236622)[sext_i32_i64(squot32(local_tid_236614,\n                                                                   32))] =\n                x_228008;\n            ((volatile __local\n              int64_t *) scan_arr_mem_236624)[sext_i32_i64(squot32(local_tid_236614,\n                                                                   32))] =\n                x_228009;\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_236647;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_236614, 32) == 0 && ltid_in_bounds_236643) {\n                x_236635 = ((volatile __local\n                             int64_t *) scan_arr_mem_236618)[sext_i32_i64(local_tid_236614)];\n                x_236636 = ((volatile __local\n      ",
                   "                       int64_t *) scan_arr_mem_236620)[sext_i32_i64(local_tid_236614)];\n                x_236637 = ((volatile __local\n                             int64_t *) scan_arr_mem_236622)[sext_i32_i64(local_tid_236614)];\n                x_236638 = ((volatile __local\n                             int64_t *) scan_arr_mem_236624)[sext_i32_i64(local_tid_236614)];\n                if ((local_tid_236614 - squot32(local_tid_236614, 32) * 32) ==\n                    0) {\n                    x_236631 = x_236635;\n                    x_236632 = x_236636;\n                    x_236633 = x_236637;\n                    x_236634 = x_236638;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_236647 = 1;\n            while (slt32(skip_threads_236647, 32)) {\n                bool thread_active_236648 = sle32(skip_threads_236647,\n                                                  local_tid_236614 -\n                                                  squot32(local_tid_236614,\n                                                          32) * 32) &&\n                     (squot32(local_tid_236614, 32) == 0 &&\n                      ltid_in_bounds_236643);\n                \n                if (thread_active_236648) {\n                    // read operands\n                    {\n                        x_236631 = ((volatile __local\n                                     int64_t *) scan_arr_mem_236618)[sext_i32_i64(local_tid_236614) -\n                                                                     sext_i32_i64(skip_threads_236647)];\n                        x_236632 = ((volatile __local\n                                     int64_t *) scan_arr_mem_236620)[sext_i32_i64(local_tid_236614) -\n                                                                     sext_i32_i64(skip_threads_236647)];\n                        x_236633 = ((volatile __local\n                                     int64_t *) scan_arr_mem_236622)[sext_i32",
                   "_i64(local_tid_236614) -\n                                                                     sext_i32_i64(skip_threads_236647)];\n                        x_236634 = ((volatile __local\n                                     int64_t *) scan_arr_mem_236624)[sext_i32_i64(local_tid_236614) -\n                                                                     sext_i32_i64(skip_threads_236647)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_236649 =\n                         slt64(srem64((sext_i32_i64(local_tid_236614 * 32 + 32 -\n                                       1) + (int64_t) 1) *\n                                      (segscan_group_sizze_227995 *\n                                       sdiv_up64(partition_sizze_203667 *\n                                                 n_203572,\n                                                 sext_i32_i64(num_threads_236557))) -\n                                      (int64_t) 1, n_203572),\n                               (sext_i32_i64(local_tid_236614 * 32 + 32 - 1) +\n                                (int64_t) 1) * (segscan_group_sizze_227995 *\n                                                sdiv_up64(partition_sizze_203667 *\n                                                          n_203572,\n                                                          sext_i32_i64(num_threads_236557))) -\n                               (int64_t) 1 - ((sext_i32_i64((local_tid_236614 -\n                                                             skip_threads_236647) *\n                                               32 + 32 - 1) + (int64_t) 1) *\n                                              (segscan_group_sizze_227995 *\n                                               sdiv_up64(partition_sizze_203667 *\n                                                         n_203572,\n                                                         sext_i32_i64(num_threads_236557))) -\n                    ",
                   "                          (int64_t) 1));\n                    \n                    if (thread_active_236648 && inactive_236649) {\n                        x_236631 = x_236635;\n                        x_236632 = x_236636;\n                        x_236633 = x_236637;\n                        x_236634 = x_236638;\n                    }\n                    if (thread_active_236648) {\n                        if (!inactive_236649) {\n                            int64_t defunc_1_op_res_236639 = add64(x_236631,\n                                                                   x_236635);\n                            int64_t defunc_1_op_res_236640 = add64(x_236632,\n                                                                   x_236636);\n                            int64_t defunc_1_op_res_236641 = add64(x_236633,\n                                                                   x_236637);\n                            int64_t defunc_1_op_res_236642 = add64(x_236634,\n                                                                   x_236638);\n                            \n                            x_236631 = defunc_1_op_res_236639;\n                            x_236632 = defunc_1_op_res_236640;\n                            x_236633 = defunc_1_op_res_236641;\n                            x_236634 = defunc_1_op_res_236642;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_236616, skip_threads_236647)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_236648) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) scan_arr_mem_236618)[sext_i32_i64(local_tid_236614)] =\n                            x_236631;\n                        x_236635 = x_236631;\n                        ((volatile __local\n                          int64_t *) scan_arr_mem_236620)[sext_i32_i64(local_tid_236614)] =\n              ",
                   "              x_236632;\n                        x_236636 = x_236632;\n                        ((volatile __local\n                          int64_t *) scan_arr_mem_236622)[sext_i32_i64(local_tid_236614)] =\n                            x_236633;\n                        x_236637 = x_236633;\n                        ((volatile __local\n                          int64_t *) scan_arr_mem_236624)[sext_i32_i64(local_tid_236614)] =\n                            x_236634;\n                        x_236638 = x_236634;\n                    }\n                }\n                if (sle32(wave_sizze_236616, skip_threads_236647)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_236647 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_236650 = squot32(local_tid_236614, 32) == 0 ||\n         !ltid_in_bounds_236643;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_236650) {\n                x_228010 = x_228006;\n                x_228011 = x_228007;\n                x_228012 = x_228008;\n                x_228013 = x_228009;\n                x_228006 = ((__local\n                             int64_t *) scan_arr_mem_236618)[sext_i32_i64(squot32(local_tid_236614,\n                                                                                  32)) -\n                                                             (int64_t) 1];\n                x_228007 = ((__local\n                             int64_t *) scan_arr_mem_236620)[sext_i32_i64(squot32(local_tid_236614,\n                                                                                  32)) -\n                                                             (int64_t) 1];\n                x_228008 = ((__local\n                             int64_t *) scan_arr_mem_236622)[sext_i32_i64(squot32(local_tid_236614,\n                                                                                  32)",
                   ") -\n                                                             (int64_t) 1];\n                x_228009 = ((__local\n                             int64_t *) scan_arr_mem_236624)[sext_i32_i64(squot32(local_tid_236614,\n                                                                                  32)) -\n                                                             (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_236651 =\n                 slt64(srem64((sext_i32_i64(local_tid_236614) + (int64_t) 1) *\n                              (segscan_group_sizze_227995 *\n                               sdiv_up64(partition_sizze_203667 * n_203572,\n                                         sext_i32_i64(num_threads_236557))) -\n                              (int64_t) 1, n_203572),\n                       (sext_i32_i64(local_tid_236614) + (int64_t) 1) *\n                       (segscan_group_sizze_227995 *\n                        sdiv_up64(partition_sizze_203667 * n_203572,\n                                  sext_i32_i64(num_threads_236557))) -\n                       (int64_t) 1 - ((sext_i32_i64(squot32(local_tid_236614,\n                                                            32) * 32 - 1) +\n                                       (int64_t) 1) *\n                                      (segscan_group_sizze_227995 *\n                                       sdiv_up64(partition_sizze_203667 *\n                                                 n_203572,\n                                                 sext_i32_i64(num_threads_236557))) -\n                                      (int64_t) 1));\n            \n            if (!no_carry_in_236650) {\n                if (inactive_236651) {\n                    x_228006 = x_228010;\n                    x_228007 = x_228011;\n                    x_228008 = x_228012;\n                    x_228009 = x_228013;\n                }\n            }\n            if (!no_carry_in_236650) {\n                if (!inactive_236651",
                   ") {\n                    int64_t defunc_1_op_res_228014 = add64(x_228006, x_228010);\n                    int64_t defunc_1_op_res_228015 = add64(x_228007, x_228011);\n                    int64_t defunc_1_op_res_228016 = add64(x_228008, x_228012);\n                    int64_t defunc_1_op_res_228017 = add64(x_228009, x_228013);\n                    \n                    x_228006 = defunc_1_op_res_228014;\n                    x_228007 = defunc_1_op_res_228015;\n                    x_228008 = defunc_1_op_res_228016;\n                    x_228009 = defunc_1_op_res_228017;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_236650) {\n                ((__local\n                  int64_t *) scan_arr_mem_236618)[sext_i32_i64(local_tid_236614)] =\n                    x_228006;\n                ((__local\n                  int64_t *) scan_arr_mem_236620)[sext_i32_i64(local_tid_236614)] =\n                    x_228007;\n                ((__local\n                  int64_t *) scan_arr_mem_236622)[sext_i32_i64(local_tid_236614)] =\n                    x_228008;\n                ((__local\n                  int64_t *) scan_arr_mem_236624)[sext_i32_i64(local_tid_236614)] =\n                    x_228009;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_236614, 32) == 0 && ltid_in_bounds_236643) {\n            ((__local\n              int64_t *) scan_arr_mem_236618)[sext_i32_i64(local_tid_236614)] =\n                x_228010;\n            ((__local\n              int64_t *) scan_arr_mem_236620)[sext_i32_i64(local_tid_236614)] =\n                x_228011;\n            ((__local\n              int64_t *) scan_arr_mem_236622)[sext_i32_i64(local_tid_236614)] =\n                x_228012;\n            ((__local\n              int64_t *) scan_arr_mem_236624)[sext_i32_i64(local_tid_236614)] =\n                x_228013;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n ",
                   "   // threads in bounds write scanned carries\n    {\n        if (slt64(gtid_228003, partition_sizze_203667) && slt64(gtid_228004,\n                                                                n_203572)) {\n            int64_t tmp_236652;\n            \n            tmp_236652 = ((__local\n                           int64_t *) scan_arr_mem_236618)[sext_i32_i64(local_tid_236614)];\n            ((__global int64_t *) mem_231877)[gtid_228003 * n_203572 +\n                                              gtid_228004] = tmp_236652;\n            \n            int64_t tmp_236653;\n            \n            tmp_236653 = ((__local\n                           int64_t *) scan_arr_mem_236620)[sext_i32_i64(local_tid_236614)];\n            ((__global int64_t *) mem_231881)[gtid_228003 * n_203572 +\n                                              gtid_228004] = tmp_236653;\n            \n            int64_t tmp_236654;\n            \n            tmp_236654 = ((__local\n                           int64_t *) scan_arr_mem_236622)[sext_i32_i64(local_tid_236614)];\n            ((__global int64_t *) mem_231885)[gtid_228003 * n_203572 +\n                                              gtid_228004] = tmp_236654;\n            \n            int64_t tmp_236655;\n            \n            tmp_236655 = ((__local\n                           int64_t *) scan_arr_mem_236624)[sext_i32_i64(local_tid_236614)];\n            ((__global int64_t *) mem_231889)[gtid_228003 * n_203572 +\n                                              gtid_228004] = tmp_236655;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_227995\n}\n__kernel void mainziscan_stage3_206957(__global int *global_failure,\n                                       int64_t m_203571,\n                                       int64_t num_groups_206954,\n                                       int32_t num_threads_232365,\n                                       int32_t required_groups_232413, __global\n                                       unsigned char *mem_229260)\n{\n",
                   "    #define segscan_group_sizze_206952 (mainzisegscan_group_sizze_206951)\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_232414;\n    int32_t local_tid_232415;\n    int64_t group_sizze_232418;\n    int32_t wave_sizze_232417;\n    int32_t group_tid_232416;\n    \n    global_tid_232414 = get_global_id(0);\n    local_tid_232415 = get_local_id(0);\n    group_sizze_232418 = get_local_size(0);\n    wave_sizze_232417 = LOCKSTEP_WIDTH;\n    group_tid_232416 = get_group_id(0);\n    \n    int32_t phys_tid_206957 = global_tid_232414;\n    int32_t phys_group_id_232419;\n    \n    phys_group_id_232419 = get_group_id(0);\n    for (int32_t i_232420 = 0; i_232420 < sdiv_up32(required_groups_232413 -\n                                                    phys_group_id_232419,\n                                                    sext_i64_i32(num_groups_206954));\n         i_232420++) {\n        int32_t virt_group_id_232421 = phys_group_id_232419 + i_232420 *\n                sext_i64_i32(num_groups_206954);\n        int64_t flat_idx_232422 = sext_i32_i64(virt_group_id_232421) *\n                segscan_group_sizze_206952 + sext_i32_i64(local_tid_232415);\n        int64_t gtid_206956 = flat_idx_232422;\n        int64_t orig_group_232423 = squot64(flat_idx_232422,\n                                            segscan_group_sizze_206952 *\n                                            sdiv_up64(m_203571,\n                                                      sext_i32_i64(num_threads_232365)));\n        int64_t carry_in_flat_idx_232424 = orig_group_232423 *\n                (segscan_group_sizze_206952 * sdiv_up64(m_203571,\n                                                        sext_i32_i64(num_threads_232365))) -\n                (int64_t) 1;\n        \n        if (slt64(gtid_206956, m_203571)) {\n            if (!(orig_group_232423 == (int64_t) 0 || flat_idx_232422 ==\n                  (orig_group_2",
                   "32423 + (int64_t) 1) *\n                  (segscan_group_sizze_206952 * sdiv_up64(m_203571,\n                                                          sext_i32_i64(num_threads_232365))) -\n                  (int64_t) 1)) {\n                int64_t x_203630;\n                int64_t y_203631;\n                \n                x_203630 = ((__global\n                             int64_t *) mem_229260)[carry_in_flat_idx_232424];\n                y_203631 = ((__global int64_t *) mem_229260)[gtid_206956];\n                \n                int64_t zz_203632 = x_203630 + y_203631;\n                \n                x_203630 = zz_203632;\n                ((__global int64_t *) mem_229260)[gtid_206956] = x_203630;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_206952\n}\n__kernel void mainziscan_stage3_207097(__global int *global_failure,\n                                       int64_t n_203572,\n                                       int64_t partition_sizze_203667,\n                                       int64_t num_groups_207092,\n                                       int32_t num_threads_232467,\n                                       int32_t required_groups_232518, __global\n                                       unsigned char *mem_229294)\n{\n    #define segscan_group_sizze_207091 (mainzisegscan_group_sizze_207071)\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_232519;\n    int32_t local_tid_232520;\n    int64_t group_sizze_232523;\n    int32_t wave_sizze_232522;\n    int32_t group_tid_232521;\n    \n    global_tid_232519 = get_global_id(0);\n    local_tid_232520 = get_local_id(0);\n    group_sizze_232523 = get_local_size(0);\n    wave_sizze_232522 = LOCKSTEP_WIDTH;\n    group_tid_232521 = get_group_id(0);\n    \n    int32_t phys_tid_207097 = global_tid_232519;\n    int32_t phys_g",
                   "roup_id_232524;\n    \n    phys_group_id_232524 = get_group_id(0);\n    for (int32_t i_232525 = 0; i_232525 < sdiv_up32(required_groups_232518 -\n                                                    phys_group_id_232524,\n                                                    sext_i64_i32(num_groups_207092));\n         i_232525++) {\n        int32_t virt_group_id_232526 = phys_group_id_232524 + i_232525 *\n                sext_i64_i32(num_groups_207092);\n        int64_t flat_idx_232527 = sext_i32_i64(virt_group_id_232526) *\n                segscan_group_sizze_207091 + sext_i32_i64(local_tid_232520);\n        int64_t gtid_207095 = squot64(flat_idx_232527, n_203572);\n        int64_t gtid_207096 = flat_idx_232527 - squot64(flat_idx_232527,\n                                                        n_203572) * n_203572;\n        int64_t orig_group_232528 = squot64(flat_idx_232527,\n                                            segscan_group_sizze_207091 *\n                                            sdiv_up64(partition_sizze_203667 *\n                                                      n_203572,\n                                                      sext_i32_i64(num_threads_232467)));\n        int64_t carry_in_flat_idx_232529 = orig_group_232528 *\n                (segscan_group_sizze_207091 * sdiv_up64(partition_sizze_203667 *\n                                                        n_203572,\n                                                        sext_i32_i64(num_threads_232467))) -\n                (int64_t) 1;\n        \n        if (slt64(gtid_207095, partition_sizze_203667) && slt64(gtid_207096,\n                                                                n_203572)) {\n            if (!(orig_group_232528 == (int64_t) 0 || (flat_idx_232527 ==\n                                                       (orig_group_232528 +\n                                                        (int64_t) 1) *\n                                                       (segscan_group_sizze_207091 *\n                    ",
                   "                                    sdiv_up64(partition_sizze_203667 *\n                                                                  n_203572,\n                                                                  sext_i32_i64(num_threads_232467))) -\n                                                       (int64_t) 1 ||\n                                                       slt64(srem64(flat_idx_232527,\n                                                                    n_203572),\n                                                             flat_idx_232527 -\n                                                             carry_in_flat_idx_232529)))) {\n                int64_t x_207098;\n                int64_t x_207099;\n                \n                x_207098 = ((__global\n                             int64_t *) mem_229294)[squot64(carry_in_flat_idx_232529,\n                                                            n_203572) *\n                                                    n_203572 +\n                                                    (carry_in_flat_idx_232529 -\n                                                     squot64(carry_in_flat_idx_232529,\n                                                             n_203572) *\n                                                     n_203572)];\n                x_207099 = ((__global int64_t *) mem_229294)[gtid_207095 *\n                                                             n_203572 +\n                                                             gtid_207096];\n                \n                int64_t defunc_1_op_res_207100 = add64(x_207098, x_207099);\n                \n                x_207098 = defunc_1_op_res_207100;\n                ((__global int64_t *) mem_229294)[gtid_207095 * n_203572 +\n                                                  gtid_207096] = x_207098;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_207091\n}\n__ke",
                   "rnel void mainziscan_stage3_207649(__global int *global_failure,\n                                       int64_t n_p_203574,\n                                       int64_t partition_sizze_203667,\n                                       int64_t defunc_0_f_res_203721,\n                                       int64_t num_groups_207643,\n                                       int32_t num_threads_232636,\n                                       int32_t required_groups_232687, __global\n                                       unsigned char *mem_229358)\n{\n    #define segscan_group_sizze_207642 (mainzisegscan_group_sizze_207509)\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_232688;\n    int32_t local_tid_232689;\n    int64_t group_sizze_232692;\n    int32_t wave_sizze_232691;\n    int32_t group_tid_232690;\n    \n    global_tid_232688 = get_global_id(0);\n    local_tid_232689 = get_local_id(0);\n    group_sizze_232692 = get_local_size(0);\n    wave_sizze_232691 = LOCKSTEP_WIDTH;\n    group_tid_232690 = get_group_id(0);\n    \n    int32_t phys_tid_207649 = global_tid_232688;\n    int32_t phys_group_id_232693;\n    \n    phys_group_id_232693 = get_group_id(0);\n    for (int32_t i_232694 = 0; i_232694 < sdiv_up32(required_groups_232687 -\n                                                    phys_group_id_232693,\n                                                    sext_i64_i32(num_groups_207643));\n         i_232694++) {\n        int32_t virt_group_id_232695 = phys_group_id_232693 + i_232694 *\n                sext_i64_i32(num_groups_207643);\n        int64_t flat_idx_232696 = sext_i32_i64(virt_group_id_232695) *\n                segscan_group_sizze_207642 + sext_i32_i64(local_tid_232689);\n        int64_t gtid_207646 = squot64(flat_idx_232696, n_p_203574 *\n                                      defunc_0_f_res_203721);\n        int64_t gtid_207647 = squot64(flat_idx_232696 - squot64(fla",
                   "t_idx_232696,\n                                                                n_p_203574 *\n                                                                defunc_0_f_res_203721) *\n                                      (n_p_203574 * defunc_0_f_res_203721),\n                                      defunc_0_f_res_203721);\n        int64_t gtid_207648 = flat_idx_232696 - squot64(flat_idx_232696,\n                                                        n_p_203574 *\n                                                        defunc_0_f_res_203721) *\n                (n_p_203574 * defunc_0_f_res_203721) - squot64(flat_idx_232696 -\n                                                               squot64(flat_idx_232696,\n                                                                       n_p_203574 *\n                                                                       defunc_0_f_res_203721) *\n                                                               (n_p_203574 *\n                                                                defunc_0_f_res_203721),\n                                                               defunc_0_f_res_203721) *\n                defunc_0_f_res_203721;\n        int64_t orig_group_232697 = squot64(flat_idx_232696,\n                                            segscan_group_sizze_207642 *\n                                            sdiv_up64(partition_sizze_203667 *\n                                                      n_p_203574 *\n                                                      defunc_0_f_res_203721,\n                                                      sext_i32_i64(num_threads_232636)));\n        int64_t carry_in_flat_idx_232698 = orig_group_232697 *\n                (segscan_group_sizze_207642 * sdiv_up64(partition_sizze_203667 *\n                                                        n_p_203574 *\n                                                        defunc_0_f_res_203721,\n                                                        sext_i32_i64(num_thread",
                   "s_232636))) -\n                (int64_t) 1;\n        \n        if ((slt64(gtid_207646, partition_sizze_203667) && slt64(gtid_207647,\n                                                                 n_p_203574)) &&\n            slt64(gtid_207648, defunc_0_f_res_203721)) {\n            if (!(orig_group_232697 == (int64_t) 0 || (flat_idx_232696 ==\n                                                       (orig_group_232697 +\n                                                        (int64_t) 1) *\n                                                       (segscan_group_sizze_207642 *\n                                                        sdiv_up64(partition_sizze_203667 *\n                                                                  n_p_203574 *\n                                                                  defunc_0_f_res_203721,\n                                                                  sext_i32_i64(num_threads_232636))) -\n                                                       (int64_t) 1 ||\n                                                       slt64(srem64(flat_idx_232696,\n                                                                    defunc_0_f_res_203721),\n                                                             flat_idx_232696 -\n                                                             carry_in_flat_idx_232698)))) {\n                int64_t x_207650;\n                int64_t x_207651;\n                \n                x_207650 = ((__global\n                             int64_t *) mem_229358)[squot64(carry_in_flat_idx_232698,\n                                                            n_p_203574 *\n                                                            defunc_0_f_res_203721) *\n                                                    (defunc_0_f_res_203721 *\n                                                     n_p_203574) +\n                                                    squot64(carry_in_flat_idx_232698 -\n                                                ",
                   "            squot64(carry_in_flat_idx_232698,\n                                                                    n_p_203574 *\n                                                                    defunc_0_f_res_203721) *\n                                                            (n_p_203574 *\n                                                             defunc_0_f_res_203721),\n                                                            defunc_0_f_res_203721) *\n                                                    defunc_0_f_res_203721 +\n                                                    (carry_in_flat_idx_232698 -\n                                                     squot64(carry_in_flat_idx_232698,\n                                                             n_p_203574 *\n                                                             defunc_0_f_res_203721) *\n                                                     (n_p_203574 *\n                                                      defunc_0_f_res_203721) -\n                                                     squot64(carry_in_flat_idx_232698 -\n                                                             squot64(carry_in_flat_idx_232698,\n                                                                     n_p_203574 *\n                                                                     defunc_0_f_res_203721) *\n                                                             (n_p_203574 *\n                                                              defunc_0_f_res_203721),\n                                                             defunc_0_f_res_203721) *\n                                                     defunc_0_f_res_203721)];\n                x_207651 = ((__global int64_t *) mem_229358)[gtid_207646 *\n                                                             (defunc_0_f_res_203721 *\n                                                              n_p_203574) +\n                                                             gtid_",
                   "207647 *\n                                                             defunc_0_f_res_203721 +\n                                                             gtid_207648];\n                \n                int64_t defunc_1_op_res_207652 = add64(x_207650, x_207651);\n                \n                x_207650 = defunc_1_op_res_207652;\n                ((__global int64_t *) mem_229358)[gtid_207646 *\n                                                  (defunc_0_f_res_203721 *\n                                                   n_p_203574) + gtid_207647 *\n                                                  defunc_0_f_res_203721 +\n                                                  gtid_207648] = x_207650;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_207642\n}\n__kernel void mainziscan_stage3_218773(__global int *global_failure,\n                                       int64_t partition_sizze_203667,\n                                       int64_t lifted_single_ma_l_arg_204224,\n                                       int64_t num_groups_218768,\n                                       int32_t num_threads_234282,\n                                       int32_t required_groups_234333, __global\n                                       unsigned char *mem_230625)\n{\n    #define segscan_group_sizze_218767 (mainzisegscan_group_sizze_218731)\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_234334;\n    int32_t local_tid_234335;\n    int64_t group_sizze_234338;\n    int32_t wave_sizze_234337;\n    int32_t group_tid_234336;\n    \n    global_tid_234334 = get_global_id(0);\n    local_tid_234335 = get_local_id(0);\n    group_sizze_234338 = get_local_size(0);\n    wave_sizze_234337 = LOCKSTEP_WIDTH;\n    group_tid_234336 = get_group_id(0);\n    \n    int32_t phys_tid_218773 = global_tid_234334;\n ",
                   "   int32_t phys_group_id_234339;\n    \n    phys_group_id_234339 = get_group_id(0);\n    for (int32_t i_234340 = 0; i_234340 < sdiv_up32(required_groups_234333 -\n                                                    phys_group_id_234339,\n                                                    sext_i64_i32(num_groups_218768));\n         i_234340++) {\n        int32_t virt_group_id_234341 = phys_group_id_234339 + i_234340 *\n                sext_i64_i32(num_groups_218768);\n        int64_t flat_idx_234342 = sext_i32_i64(virt_group_id_234341) *\n                segscan_group_sizze_218767 + sext_i32_i64(local_tid_234335);\n        int64_t gtid_218771 = squot64(flat_idx_234342,\n                                      lifted_single_ma_l_arg_204224);\n        int64_t gtid_218772 = flat_idx_234342 - squot64(flat_idx_234342,\n                                                        lifted_single_ma_l_arg_204224) *\n                lifted_single_ma_l_arg_204224;\n        int64_t orig_group_234343 = squot64(flat_idx_234342,\n                                            segscan_group_sizze_218767 *\n                                            sdiv_up64(partition_sizze_203667 *\n                                                      lifted_single_ma_l_arg_204224,\n                                                      sext_i32_i64(num_threads_234282)));\n        int64_t carry_in_flat_idx_234344 = orig_group_234343 *\n                (segscan_group_sizze_218767 * sdiv_up64(partition_sizze_203667 *\n                                                        lifted_single_ma_l_arg_204224,\n                                                        sext_i32_i64(num_threads_234282))) -\n                (int64_t) 1;\n        \n        if (slt64(gtid_218771, partition_sizze_203667) && slt64(gtid_218772,\n                                                                lifted_single_ma_l_arg_204224)) {\n            if (!(orig_group_234343 == (int64_t) 0 || (flat_idx_234342 ==\n                                                       ",
                   "(orig_group_234343 +\n                                                        (int64_t) 1) *\n                                                       (segscan_group_sizze_218767 *\n                                                        sdiv_up64(partition_sizze_203667 *\n                                                                  lifted_single_ma_l_arg_204224,\n                                                                  sext_i32_i64(num_threads_234282))) -\n                                                       (int64_t) 1 ||\n                                                       slt64(srem64(flat_idx_234342,\n                                                                    lifted_single_ma_l_arg_204224),\n                                                             flat_idx_234342 -\n                                                             carry_in_flat_idx_234344)))) {\n                double x_218774;\n                double x_218775;\n                \n                x_218774 = ((__global\n                             double *) mem_230625)[squot64(carry_in_flat_idx_234344,\n                                                           lifted_single_ma_l_arg_204224) *\n                                                   lifted_single_ma_l_arg_204224 +\n                                                   (carry_in_flat_idx_234344 -\n                                                    squot64(carry_in_flat_idx_234344,\n                                                            lifted_single_ma_l_arg_204224) *\n                                                    lifted_single_ma_l_arg_204224)];\n                x_218775 = ((__global double *) mem_230625)[gtid_218771 *\n                                                            lifted_single_ma_l_arg_204224 +\n                                                            gtid_218772];\n                \n                double defunc_1_op_res_218776 = x_218774 + x_218775;\n                \n                x_218774 = defunc_1_op_",
                   "res_218776;\n                ((__global double *) mem_230625)[gtid_218771 *\n                                                 lifted_single_ma_l_arg_204224 +\n                                                 gtid_218772] = x_218774;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_218767\n}\n__kernel void mainziscan_stage3_218904(__global int *global_failure,\n                                       int64_t partition_sizze_203667,\n                                       int64_t dyn_lifted_single_ma_l_arg_204234,\n                                       int64_t num_groups_218899,\n                                       int32_t num_threads_234425,\n                                       int32_t required_groups_234476, __global\n                                       unsigned char *mem_230642)\n{\n    #define segscan_group_sizze_218898 (mainzisegscan_group_sizze_218862)\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_234477;\n    int32_t local_tid_234478;\n    int64_t group_sizze_234481;\n    int32_t wave_sizze_234480;\n    int32_t group_tid_234479;\n    \n    global_tid_234477 = get_global_id(0);\n    local_tid_234478 = get_local_id(0);\n    group_sizze_234481 = get_local_size(0);\n    wave_sizze_234480 = LOCKSTEP_WIDTH;\n    group_tid_234479 = get_group_id(0);\n    \n    int32_t phys_tid_218904 = global_tid_234477;\n    int32_t phys_group_id_234482;\n    \n    phys_group_id_234482 = get_group_id(0);\n    for (int32_t i_234483 = 0; i_234483 < sdiv_up32(required_groups_234476 -\n                                                    phys_group_id_234482,\n                                                    sext_i64_i32(num_groups_218899));\n         i_234483++) {\n        int32_t virt_group_id_234484 = phys_group_id_234482 + i_234483 *\n                sext_i64_i32(num_groups_218899);",
                   "\n        int64_t flat_idx_234485 = sext_i32_i64(virt_group_id_234484) *\n                segscan_group_sizze_218898 + sext_i32_i64(local_tid_234478);\n        int64_t gtid_218902 = squot64(flat_idx_234485,\n                                      dyn_lifted_single_ma_l_arg_204234);\n        int64_t gtid_218903 = flat_idx_234485 - squot64(flat_idx_234485,\n                                                        dyn_lifted_single_ma_l_arg_204234) *\n                dyn_lifted_single_ma_l_arg_204234;\n        int64_t orig_group_234486 = squot64(flat_idx_234485,\n                                            segscan_group_sizze_218898 *\n                                            sdiv_up64(partition_sizze_203667 *\n                                                      dyn_lifted_single_ma_l_arg_204234,\n                                                      sext_i32_i64(num_threads_234425)));\n        int64_t carry_in_flat_idx_234487 = orig_group_234486 *\n                (segscan_group_sizze_218898 * sdiv_up64(partition_sizze_203667 *\n                                                        dyn_lifted_single_ma_l_arg_204234,\n                                                        sext_i32_i64(num_threads_234425))) -\n                (int64_t) 1;\n        \n        if (slt64(gtid_218902, partition_sizze_203667) && slt64(gtid_218903,\n                                                                dyn_lifted_single_ma_l_arg_204234)) {\n            if (!(orig_group_234486 == (int64_t) 0 || (flat_idx_234485 ==\n                                                       (orig_group_234486 +\n                                                        (int64_t) 1) *\n                                                       (segscan_group_sizze_218898 *\n                                                        sdiv_up64(partition_sizze_203667 *\n                                                                  dyn_lifted_single_ma_l_arg_204234,\n                                                                  sext",
                   "_i32_i64(num_threads_234425))) -\n                                                       (int64_t) 1 ||\n                                                       slt64(srem64(flat_idx_234485,\n                                                                    dyn_lifted_single_ma_l_arg_204234),\n                                                             flat_idx_234485 -\n                                                             carry_in_flat_idx_234487)))) {\n                double x_218905;\n                double x_218906;\n                \n                x_218905 = ((__global\n                             double *) mem_230642)[squot64(carry_in_flat_idx_234487,\n                                                           dyn_lifted_single_ma_l_arg_204234) *\n                                                   dyn_lifted_single_ma_l_arg_204234 +\n                                                   (carry_in_flat_idx_234487 -\n                                                    squot64(carry_in_flat_idx_234487,\n                                                            dyn_lifted_single_ma_l_arg_204234) *\n                                                    dyn_lifted_single_ma_l_arg_204234)];\n                x_218906 = ((__global double *) mem_230642)[gtid_218902 *\n                                                            dyn_lifted_single_ma_l_arg_204234 +\n                                                            gtid_218903];\n                \n                double defunc_1_op_res_218907 = x_218905 + x_218906;\n                \n                x_218905 = defunc_1_op_res_218907;\n                ((__global double *) mem_230642)[gtid_218902 *\n                                                 dyn_lifted_single_ma_l_arg_204234 +\n                                                 gtid_218903] = x_218905;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_218898\n}\n__kernel void main",
                   "ziscan_stage3_219035(__global int *global_failure,\n                                       int64_t n_203572,\n                                       int64_t partition_sizze_203667,\n                                       int64_t num_groups_219030,\n                                       int32_t num_threads_234568,\n                                       int32_t required_groups_234619, __global\n                                       unsigned char *mem_230659)\n{\n    #define segscan_group_sizze_219029 (mainzisegscan_group_sizze_218993)\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_234620;\n    int32_t local_tid_234621;\n    int64_t group_sizze_234624;\n    int32_t wave_sizze_234623;\n    int32_t group_tid_234622;\n    \n    global_tid_234620 = get_global_id(0);\n    local_tid_234621 = get_local_id(0);\n    group_sizze_234624 = get_local_size(0);\n    wave_sizze_234623 = LOCKSTEP_WIDTH;\n    group_tid_234622 = get_group_id(0);\n    \n    int32_t phys_tid_219035 = global_tid_234620;\n    int32_t phys_group_id_234625;\n    \n    phys_group_id_234625 = get_group_id(0);\n    for (int32_t i_234626 = 0; i_234626 < sdiv_up32(required_groups_234619 -\n                                                    phys_group_id_234625,\n                                                    sext_i64_i32(num_groups_219030));\n         i_234626++) {\n        int32_t virt_group_id_234627 = phys_group_id_234625 + i_234626 *\n                sext_i64_i32(num_groups_219030);\n        int64_t flat_idx_234628 = sext_i32_i64(virt_group_id_234627) *\n                segscan_group_sizze_219029 + sext_i32_i64(local_tid_234621);\n        int64_t gtid_219033 = squot64(flat_idx_234628, n_203572);\n        int64_t gtid_219034 = flat_idx_234628 - squot64(flat_idx_234628,\n                                                        n_203572) * n_203572;\n        int64_t orig_group_234629 = squot64(flat_idx_234628,\n     ",
                   "                                       segscan_group_sizze_219029 *\n                                            sdiv_up64(partition_sizze_203667 *\n                                                      n_203572,\n                                                      sext_i32_i64(num_threads_234568)));\n        int64_t carry_in_flat_idx_234630 = orig_group_234629 *\n                (segscan_group_sizze_219029 * sdiv_up64(partition_sizze_203667 *\n                                                        n_203572,\n                                                        sext_i32_i64(num_threads_234568))) -\n                (int64_t) 1;\n        \n        if (slt64(gtid_219033, partition_sizze_203667) && slt64(gtid_219034,\n                                                                n_203572)) {\n            if (!(orig_group_234629 == (int64_t) 0 || (flat_idx_234628 ==\n                                                       (orig_group_234629 +\n                                                        (int64_t) 1) *\n                                                       (segscan_group_sizze_219029 *\n                                                        sdiv_up64(partition_sizze_203667 *\n                                                                  n_203572,\n                                                                  sext_i32_i64(num_threads_234568))) -\n                                                       (int64_t) 1 ||\n                                                       slt64(srem64(flat_idx_234628,\n                                                                    n_203572),\n                                                             flat_idx_234628 -\n                                                             carry_in_flat_idx_234630)))) {\n                double x_219036;\n                double x_219037;\n                \n                x_219036 = ((__global\n                             double *) mem_230659)[squot64(carry_in_flat_idx_234630,\n                 ",
                   "                                          n_203572) *\n                                                   n_203572 +\n                                                   (carry_in_flat_idx_234630 -\n                                                    squot64(carry_in_flat_idx_234630,\n                                                            n_203572) *\n                                                    n_203572)];\n                x_219037 = ((__global double *) mem_230659)[gtid_219033 *\n                                                            n_203572 +\n                                                            gtid_219034];\n                \n                double defunc_1_op_res_219038 = x_219036 + x_219037;\n                \n                x_219036 = defunc_1_op_res_219038;\n                ((__global double *) mem_230659)[gtid_219033 * n_203572 +\n                                                 gtid_219034] = x_219036;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_219029\n}\n__kernel void mainziscan_stage3_228005(__global int *global_failure,\n                                       int64_t n_203572,\n                                       int64_t partition_sizze_203667,\n                                       int64_t num_groups_227996,\n                                       int32_t num_threads_236557,\n                                       int32_t required_groups_236656, __global\n                                       unsigned char *mem_231877, __global\n                                       unsigned char *mem_231881, __global\n                                       unsigned char *mem_231885, __global\n                                       unsigned char *mem_231889)\n{\n    #define segscan_group_sizze_227995 (mainzisegscan_group_sizze_227715)\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_236657;\n    int32_t local_tid_236658;\n    int64_t group_sizze_236661;\n    int32_t wave_sizze_236660;\n    int32_t group_tid_236659;\n    \n    global_tid_236657 = get_global_id(0);\n    local_tid_236658 = get_local_id(0);\n    group_sizze_236661 = get_local_size(0);\n    wave_sizze_236660 = LOCKSTEP_WIDTH;\n    group_tid_236659 = get_group_id(0);\n    \n    int32_t phys_tid_228005 = global_tid_236657;\n    int32_t phys_group_id_236662;\n    \n    phys_group_id_236662 = get_group_id(0);\n    for (int32_t i_236663 = 0; i_236663 < sdiv_up32(required_groups_236656 -\n                                                    phys_group_id_236662,\n                                                    sext_i64_i32(num_groups_227996));\n         i_236663++) {\n        int32_t virt_group_id_236664 = phys_group_id_236662 + i_236663 *\n                sext_i64_i32(num_groups_227996);\n        int64_t flat_idx_236665 = sext_i32_i64(virt_group_id_236664) *\n                segscan_group_sizze_227995 + sext_i32_i64(local_tid_236658);\n        int64_t gtid_228003 = squot64(flat_idx_236665, n_203572);\n        int64_t gtid_228004 = flat_idx_236665 - squot64(flat_idx_236665,\n                                                        n_203572) * n_203572;\n        int64_t orig_group_236666 = squot64(flat_idx_236665,\n                                            segscan_group_sizze_227995 *\n                                            sdiv_up64(partition_sizze_203667 *\n                                                      n_203572,\n                                                      sext_i32_i64(num_threads_236557)));\n        int64_t carry_in_flat_idx_236667 = orig_group_236666 *\n                (segscan_group_sizze_227995 * sdiv_up64(partition_sizze_203667 *\n                                                        n_203572,\n                                                        sext_i32_i64(num_threads_236557))) -\n                (int64_t) 1;\n        \n        if (slt64(",
                   "gtid_228003, partition_sizze_203667) && slt64(gtid_228004,\n                                                                n_203572)) {\n            if (!(orig_group_236666 == (int64_t) 0 || (flat_idx_236665 ==\n                                                       (orig_group_236666 +\n                                                        (int64_t) 1) *\n                                                       (segscan_group_sizze_227995 *\n                                                        sdiv_up64(partition_sizze_203667 *\n                                                                  n_203572,\n                                                                  sext_i32_i64(num_threads_236557))) -\n                                                       (int64_t) 1 ||\n                                                       slt64(srem64(flat_idx_236665,\n                                                                    n_203572),\n                                                             flat_idx_236665 -\n                                                             carry_in_flat_idx_236667)))) {\n                int64_t x_228006;\n                int64_t x_228007;\n                int64_t x_228008;\n                int64_t x_228009;\n                int64_t x_228010;\n                int64_t x_228011;\n                int64_t x_228012;\n                int64_t x_228013;\n                \n                x_228006 = ((__global\n                             int64_t *) mem_231877)[squot64(carry_in_flat_idx_236667,\n                                                            n_203572) *\n                                                    n_203572 +\n                                                    (carry_in_flat_idx_236667 -\n                                                     squot64(carry_in_flat_idx_236667,\n                                                             n_203572) *\n                                                     n_203572)];\n                x_228007 = ((_",
                   "_global\n                             int64_t *) mem_231881)[squot64(carry_in_flat_idx_236667,\n                                                            n_203572) *\n                                                    n_203572 +\n                                                    (carry_in_flat_idx_236667 -\n                                                     squot64(carry_in_flat_idx_236667,\n                                                             n_203572) *\n                                                     n_203572)];\n                x_228008 = ((__global\n                             int64_t *) mem_231885)[squot64(carry_in_flat_idx_236667,\n                                                            n_203572) *\n                                                    n_203572 +\n                                                    (carry_in_flat_idx_236667 -\n                                                     squot64(carry_in_flat_idx_236667,\n                                                             n_203572) *\n                                                     n_203572)];\n                x_228009 = ((__global\n                             int64_t *) mem_231889)[squot64(carry_in_flat_idx_236667,\n                                                            n_203572) *\n                                                    n_203572 +\n                                                    (carry_in_flat_idx_236667 -\n                                                     squot64(carry_in_flat_idx_236667,\n                                                             n_203572) *\n                                                     n_203572)];\n                x_228010 = ((__global int64_t *) mem_231877)[gtid_228003 *\n                                                             n_203572 +\n                                                             gtid_228004];\n                x_228011 = ((__global int64_t *) mem_231881)[gtid_228003 *\n                                         ",
                   "                    n_203572 +\n                                                             gtid_228004];\n                x_228012 = ((__global int64_t *) mem_231885)[gtid_228003 *\n                                                             n_203572 +\n                                                             gtid_228004];\n                x_228013 = ((__global int64_t *) mem_231889)[gtid_228003 *\n                                                             n_203572 +\n                                                             gtid_228004];\n                \n                int64_t defunc_1_op_res_228014 = add64(x_228006, x_228010);\n                int64_t defunc_1_op_res_228015 = add64(x_228007, x_228011);\n                int64_t defunc_1_op_res_228016 = add64(x_228008, x_228012);\n                int64_t defunc_1_op_res_228017 = add64(x_228009, x_228013);\n                \n                x_228006 = defunc_1_op_res_228014;\n                x_228007 = defunc_1_op_res_228015;\n                x_228008 = defunc_1_op_res_228016;\n                x_228009 = defunc_1_op_res_228017;\n                ((__global int64_t *) mem_231877)[gtid_228003 * n_203572 +\n                                                  gtid_228004] = x_228006;\n                ((__global int64_t *) mem_231881)[gtid_228003 * n_203572 +\n                                                  gtid_228004] = x_228007;\n                ((__global int64_t *) mem_231885)[gtid_228003 * n_203572 +\n                                                  gtid_228004] = x_228008;\n                ((__global int64_t *) mem_231889)[gtid_228003 * n_203572 +\n                                                  gtid_228004] = x_228009;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_227995\n}\n__kernel void mainzisegmap_206959(__global int *global_failure,\n                                  int64_t m_203571, int64_t n_203572,\n               ",
                   "                   int64_t num_groups_206964, __global\n                                  unsigned char *mem_229242, __global\n                                  unsigned char *mem_229260, __global\n                                  unsigned char *mem_229263, __global\n                                  unsigned char *mem_229269, __global\n                                  unsigned char *mem_229272)\n{\n    #define segmap_group_sizze_206962 (mainzisegmap_group_sizze_206961)\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_232426;\n    int32_t local_tid_232427;\n    int64_t group_sizze_232430;\n    int32_t wave_sizze_232429;\n    int32_t group_tid_232428;\n    \n    global_tid_232426 = get_global_id(0);\n    local_tid_232427 = get_local_id(0);\n    group_sizze_232430 = get_local_size(0);\n    wave_sizze_232429 = LOCKSTEP_WIDTH;\n    group_tid_232428 = get_group_id(0);\n    \n    int32_t phys_tid_206959 = global_tid_232426;\n    int32_t phys_group_id_232431;\n    \n    phys_group_id_232431 = get_group_id(0);\n    for (int32_t i_232432 = 0; i_232432 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_203571,\n                                          segmap_group_sizze_206962)) -\n                   phys_group_id_232431, sext_i64_i32(num_groups_206964));\n         i_232432++) {\n        int32_t virt_group_id_232433 = phys_group_id_232431 + i_232432 *\n                sext_i64_i32(num_groups_206964);\n        int64_t global_tid_232434 = sext_i32_i64(virt_group_id_232433) *\n                segmap_group_sizze_206962 + sext_i32_i64(local_tid_232427);\n        int64_t slice_232435 = m_203571;\n        int64_t write_i_206958 = global_tid_232434;\n        int64_t remnant_232436 = global_tid_232434 - write_i_206958;\n        \n        if (slt64(write_i_206958, m_203571)) {\n            int64_t c_203673;\n            \n            c_203673 = ((__global int64_t *) mem_229263)[write_i_206958];\n       ",
                   "     \n            int64_t offset_203674;\n            \n            offset_203674 = ((__global int64_t *) mem_229260)[write_i_206958];\n            \n            bool is_this_one_203678 = c_203673 == (int64_t) 0;\n            int64_t this_offset_203679 = (int64_t) -1 + offset_203674;\n            int64_t total_res_203680;\n            \n            if (is_this_one_203678) {\n                total_res_203680 = this_offset_203679;\n            } else {\n                total_res_203680 = (int64_t) -1;\n            }\n            if (sle64((int64_t) 0, total_res_203680) && slt64(total_res_203680,\n                                                              m_203571)) {\n                for (int64_t i_232437 = 0; i_232437 < n_203572; i_232437++) {\n                    double tmp_232438;\n                    \n                    tmp_232438 = ((__global\n                                   double *) mem_229242)[write_i_206958 +\n                                                         i_232437 * m_203571];\n                    ((__global double *) mem_229269)[total_res_203680 *\n                                                     n_203572 + i_232437] =\n                        tmp_232438;\n                }\n            }\n            if (sle64((int64_t) 0, total_res_203680) && slt64(total_res_203680,\n                                                              m_203571)) {\n                ((__global int64_t *) mem_229272)[total_res_203680] =\n                    write_i_206958;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_206962\n}\n__kernel void mainzisegmap_207135(__global int *global_failure,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667, __global\n                                  unsigned char *mem_229269, __global\n                                  unsigned char *mem_229294, __global\n                                  un",
                   "signed char *mem_229298)\n{\n    #define segmap_group_sizze_207130 (mainzisegmap_group_sizze_207015)\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_232542;\n    int32_t local_tid_232543;\n    int64_t group_sizze_232546;\n    int32_t wave_sizze_232545;\n    int32_t group_tid_232544;\n    \n    global_tid_232542 = get_global_id(0);\n    local_tid_232543 = get_local_id(0);\n    group_sizze_232546 = get_local_size(0);\n    wave_sizze_232545 = LOCKSTEP_WIDTH;\n    group_tid_232544 = get_group_id(0);\n    \n    int32_t phys_tid_207135 = global_tid_232542;\n    int64_t global_tid_232547 = sext_i32_i64(group_tid_232544) *\n            segmap_group_sizze_207130 + sext_i32_i64(local_tid_232543);\n    int64_t slice_232548 = n_203572;\n    int64_t slice_232549 = partition_sizze_203667 * slice_232548;\n    int64_t gtid_207133 = squot64(global_tid_232547, slice_232548);\n    int64_t remnant_232550 = global_tid_232547 - gtid_207133 * slice_232548;\n    int64_t gtid_207134 = remnant_232550;\n    int64_t remnant_232551 = remnant_232550 - gtid_207134;\n    \n    if (slt64(gtid_207133, partition_sizze_203667) && slt64(gtid_207134,\n                                                            n_203572)) {\n        double x_207136;\n        \n        x_207136 = ((__global double *) mem_229269)[gtid_207133 * n_203572 +\n                                                    gtid_207134];\n        \n        bool isnan_res_207139;\n        \n        isnan_res_207139 = futrts_isnan64(x_207136);\n        \n        bool defunc_0_p_res_207140 = !isnan_res_207139;\n        int64_t defunc_1_f_res_207141;\n        \n        if (defunc_0_p_res_207140) {\n            int64_t x_207137;\n            \n            x_207137 = ((__global int64_t *) mem_229294)[gtid_207133 *\n                                                         n_203572 +\n                                                         gtid_207134];\n            ",
                   "\n            int64_t defunc_1_f_res_t_res_207142 = sub64(x_207137, (int64_t) 1);\n            \n            defunc_1_f_res_207141 = defunc_1_f_res_t_res_207142;\n        } else {\n            defunc_1_f_res_207141 = (int64_t) -1;\n        }\n        if ((sle64((int64_t) 0, gtid_207133) && slt64(gtid_207133,\n                                                      partition_sizze_203667)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_207141) &&\n             slt64(defunc_1_f_res_207141, n_203572))) {\n            ((__global int64_t *) mem_229298)[gtid_207133 * n_203572 +\n                                              defunc_1_f_res_207141] =\n                gtid_207134;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_207130\n}\n__kernel void mainzisegmap_207260(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572, int64_t n_p_203574,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t i_203760, __global\n                                  unsigned char *mem_229308, __global\n                                  unsigned char *mem_229314)\n{\n    #define segmap_group_sizze_207254 (mainzisegmap_group_sizze_207172)\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_232562;\n    int32_t local_tid_232563;\n    int64_t group_sizze_232566;\n    int32_t wave_sizze_232565;\n    int32_t group_tid_232564;\n    \n    global_tid_232562 = get_global_id(0);\n    local_tid_232563 = get_local_id(0);\n    group_sizze_232566 = get_local_size(0);\n    wave_sizze_232565 = LOCKSTEP_WIDTH;\n    group_tid_232564 = get_group_id(0);\n    \n    int32_t phys_tid_207260 = global_tid_232562;\n    int64_t",
                   " global_tid_232567 = sext_i32_i64(group_tid_232564) *\n            segmap_group_sizze_207254 + sext_i32_i64(local_tid_232563);\n    int64_t slice_232568 = defunc_0_f_res_203721;\n    int64_t slice_232569 = n_p_203574 * slice_232568;\n    int64_t slice_232570 = partition_sizze_203667 * slice_232569;\n    int64_t gtid_207257 = squot64(global_tid_232567, slice_232569);\n    int64_t remnant_232571 = global_tid_232567 - gtid_207257 * slice_232569;\n    int64_t gtid_207258 = squot64(remnant_232571, slice_232568);\n    int64_t remnant_232572 = remnant_232571 - gtid_207258 * slice_232568;\n    int64_t gtid_207259 = remnant_232572;\n    int64_t remnant_232573 = remnant_232572 - gtid_207259;\n    \n    if ((slt64(gtid_207257, partition_sizze_203667) && slt64(gtid_207258,\n                                                             n_p_203574)) &&\n        slt64(gtid_207259, defunc_0_f_res_203721)) {\n        int64_t y_207264 = mul64(n_p_203574, gtid_207259);\n        int64_t new_i_207265 = add64(gtid_207258, y_207264);\n        bool cond_207266 = slt64(i_203760, new_i_207265);\n        double defunc_0_f_res_207267;\n        \n        if (cond_207266) {\n            defunc_0_f_res_207267 = NAN;\n        } else {\n            bool x_207268 = sle64((int64_t) 0, new_i_207265);\n            bool y_207269 = slt64(new_i_207265, n_203572);\n            bool bounds_check_207270 = x_207268 && y_207269;\n            bool index_certs_207271;\n            \n            if (!bounds_check_207270) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 1) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) new_i_207265;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_f_res_207272;\n            \n            defunc_0_f_res_f_res_207272 = ((__global\n                           ",
                   "                 double *) mem_229308)[gtid_207257 *\n                                                                  n_203572 +\n                                                                  new_i_207265];\n            defunc_0_f_res_207267 = defunc_0_f_res_f_res_207272;\n        }\n        ((__global double *) mem_229314)[gtid_207257 * (defunc_0_f_res_203721 *\n                                                        n_p_203574) +\n                                         gtid_207258 * defunc_0_f_res_203721 +\n                                         gtid_207259] = defunc_0_f_res_207267;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_207254\n}\n__kernel void mainzisegmap_207695(__global int *global_failure,\n                                  int64_t n_p_203574,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721, __global\n                                  unsigned char *mem_229314, __global\n                                  unsigned char *mem_229358, __global\n                                  unsigned char *mem_229363)\n{\n    #define segmap_group_sizze_207689 (mainzisegmap_group_sizze_207440)\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_232699;\n    int32_t local_tid_232700;\n    int64_t group_sizze_232703;\n    int32_t wave_sizze_232702;\n    int32_t group_tid_232701;\n    \n    global_tid_232699 = get_global_id(0);\n    local_tid_232700 = get_local_id(0);\n    group_sizze_232703 = get_local_size(0);\n    wave_sizze_232702 = LOCKSTEP_WIDTH;\n    group_tid_232701 = get_group_id(0);\n    \n    int32_t phys_tid_207695 = global_tid_232699;\n    int64_t global_tid_232704 = sext_i32_i64(group_tid_232701) *\n            segmap_group_sizze_207689 + sext_i32_i64(local_tid_232700);\n    int64_t slice_232705 = defunc_0_f_res_203721;\n    int64_t slice_232706 = n_p_203574 * sli",
                   "ce_232705;\n    int64_t slice_232707 = partition_sizze_203667 * slice_232706;\n    int64_t gtid_207692 = squot64(global_tid_232704, slice_232706);\n    int64_t remnant_232708 = global_tid_232704 - gtid_207692 * slice_232706;\n    int64_t gtid_207693 = squot64(remnant_232708, slice_232705);\n    int64_t remnant_232709 = remnant_232708 - gtid_207693 * slice_232705;\n    int64_t gtid_207694 = remnant_232709;\n    int64_t remnant_232710 = remnant_232709 - gtid_207694;\n    \n    if ((slt64(gtid_207692, partition_sizze_203667) && slt64(gtid_207693,\n                                                             n_p_203574)) &&\n        slt64(gtid_207694, defunc_0_f_res_203721)) {\n        double x_207696;\n        \n        x_207696 = ((__global double *) mem_229314)[gtid_207692 *\n                                                    (defunc_0_f_res_203721 *\n                                                     n_p_203574) + gtid_207693 *\n                                                    defunc_0_f_res_203721 +\n                                                    gtid_207694];\n        \n        bool isnan_res_207699;\n        \n        isnan_res_207699 = futrts_isnan64(x_207696);\n        \n        bool defunc_0_p_res_207700 = !isnan_res_207699;\n        int64_t defunc_1_f_res_207701;\n        \n        if (defunc_0_p_res_207700) {\n            int64_t x_207697;\n            \n            x_207697 = ((__global int64_t *) mem_229358)[gtid_207692 *\n                                                         (defunc_0_f_res_203721 *\n                                                          n_p_203574) +\n                                                         gtid_207693 *\n                                                         defunc_0_f_res_203721 +\n                                                         gtid_207694];\n            \n            int64_t defunc_1_f_res_t_res_207702 = sub64(x_207697, (int64_t) 1);\n            \n            defunc_1_f_res_207701 = defunc_1_f_res_t_res_207702;\n        } else ",
                   "{\n            defunc_1_f_res_207701 = (int64_t) -1;\n        }\n        if (((sle64((int64_t) 0, gtid_207692) && slt64(gtid_207692,\n                                                       partition_sizze_203667)) &&\n             (sle64((int64_t) 0, gtid_207693) && slt64(gtid_207693,\n                                                       n_p_203574))) &&\n            (sle64((int64_t) 0, defunc_1_f_res_207701) &&\n             slt64(defunc_1_f_res_207701, defunc_0_f_res_203721))) {\n            ((__global int64_t *) mem_229363)[gtid_207692 *\n                                              (defunc_0_f_res_203721 *\n                                               n_p_203574) + gtid_207693 *\n                                              defunc_0_f_res_203721 +\n                                              defunc_1_f_res_207701] =\n                gtid_207694;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_207689\n}\n__kernel void mainzisegmap_208908(__global int *global_failure,\n                                  int64_t n_p_203574,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721, __global\n                                  unsigned char *ext_mem_229373, __global\n                                  unsigned char *mem_229439)\n{\n    #define segmap_group_sizze_208902 (mainzisegmap_group_sizze_208565)\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_232784;\n    int32_t local_tid_232785;\n    int64_t group_sizze_232788;\n    int32_t wave_sizze_232787;\n    int32_t group_tid_232786;\n    \n    global_tid_232784 = get_global_id(0);\n    local_tid_232785 = get_local_id(0);\n    group_sizze_232788 = get_local_size(0);\n    wave_sizze_232787 = LOCKSTEP_WIDTH;\n    group_tid_232786 = get_group_id(0);\n    \n    int32_t phys_tid_208908 = global_tid_232784;\n    int64_t global_tid_2",
                   "32789 = sext_i32_i64(group_tid_232786) *\n            segmap_group_sizze_208902 + sext_i32_i64(local_tid_232785);\n    int64_t slice_232790 = defunc_0_f_res_203721;\n    int64_t slice_232791 = n_p_203574 * slice_232790;\n    int64_t slice_232792 = partition_sizze_203667 * slice_232791;\n    int64_t gtid_208905 = squot64(global_tid_232789, slice_232791);\n    int64_t remnant_232793 = global_tid_232789 - gtid_208905 * slice_232791;\n    int64_t gtid_208906 = squot64(remnant_232793, slice_232790);\n    int64_t remnant_232794 = remnant_232793 - gtid_208906 * slice_232790;\n    int64_t gtid_208907 = remnant_232794;\n    int64_t remnant_232795 = remnant_232794 - gtid_208907;\n    \n    if ((slt64(gtid_208905, partition_sizze_203667) && slt64(gtid_208906,\n                                                             n_p_203574)) &&\n        slt64(gtid_208907, defunc_0_f_res_203721)) {\n        int64_t x_208909;\n        \n        x_208909 = ((__global int64_t *) ext_mem_229373)[gtid_208905 *\n                                                         (defunc_0_f_res_203721 *\n                                                          n_p_203574) +\n                                                         gtid_208906 *\n                                                         defunc_0_f_res_203721 +\n                                                         gtid_208907];\n        \n        int64_t defunc_0_f_res_208910 = add64((int64_t) 1, x_208909);\n        \n        ((__global int64_t *) mem_229439)[gtid_208905 * (defunc_0_f_res_203721 *\n                                                         n_p_203574) +\n                                          gtid_208906 * defunc_0_f_res_203721 +\n                                          gtid_208907] = defunc_0_f_res_208910;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_208902\n}\n__kernel void mainzisegmap_208922(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t q_s_203575,\n                             ",
                   "     int64_t partition_sizze_203667,\n                                  int64_t min_res_203839, double i64_res_203845,\n                                  __global unsigned char *ext_mem_229372,\n                                  __global unsigned char *mem_229444, __global\n                                  unsigned char *mem_229448, __global\n                                  unsigned char *mem_229452, __global\n                                  unsigned char *mem_229456)\n{\n    #define segmap_group_sizze_208914 (mainzisegmap_group_sizze_208534)\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_232796;\n    int32_t local_tid_232797;\n    int64_t group_sizze_232800;\n    int32_t wave_sizze_232799;\n    int32_t group_tid_232798;\n    \n    global_tid_232796 = get_global_id(0);\n    local_tid_232797 = get_local_id(0);\n    group_sizze_232800 = get_local_size(0);\n    wave_sizze_232799 = LOCKSTEP_WIDTH;\n    group_tid_232798 = get_group_id(0);\n    \n    int32_t phys_tid_208922 = global_tid_232796;\n    int64_t global_tid_232801 = sext_i32_i64(group_tid_232798) *\n            segmap_group_sizze_208914 + sext_i32_i64(local_tid_232797);\n    int64_t slice_232802 = n_p_203574;\n    int64_t slice_232803 = partition_sizze_203667 * slice_232802;\n    int64_t gtid_208920 = squot64(global_tid_232801, slice_232802);\n    int64_t remnant_232804 = global_tid_232801 - gtid_208920 * slice_232802;\n    int64_t gtid_208921 = remnant_232804;\n    int64_t remnant_232805 = remnant_232804 - gtid_208921;\n    \n    if (slt64(gtid_208920, partition_sizze_203667) && slt64(gtid_208921,\n                                                            n_p_203574)) {\n        int64_t x_208923;\n        \n        x_208923 = ((__global int64_t *) ext_mem_229372)[gtid_208920 *\n                                                         n_p_203574 +\n                                                         gtid_20892",
                   "1];\n        \n        int64_t min_arg_208924 = sub64(x_208923, (int64_t) 1);\n        int64_t min_arg_208925 = sub64(x_208923, min_res_203839);\n        int64_t min_res_208926 = smin64(q_s_203575, x_208923);\n        double i64_res_208927 = sitofp_i64_f64(x_208923);\n        double x_208928 = i64_res_203845 - i64_res_208927;\n        double max_arg_208929 = x_208928 / 2.0;\n        double max_res_208930 = fmax64(0.0, max_arg_208929);\n        \n        ((__global int64_t *) mem_229444)[gtid_208920 * n_p_203574 +\n                                          gtid_208921] = min_arg_208924;\n        ((__global int64_t *) mem_229448)[gtid_208920 * n_p_203574 +\n                                          gtid_208921] = min_arg_208925;\n        ((__global int64_t *) mem_229452)[gtid_208920 * n_p_203574 +\n                                          gtid_208921] = min_res_208926;\n        ((__global double *) mem_229456)[gtid_208920 * n_p_203574 +\n                                         gtid_208921] = max_res_208930;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_208914\n}\n__kernel void mainzisegmap_208946(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_p_203574, int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726, int64_t i_203808,\n                                  unsigned char x_203809_bits,\n                                  int64_t min_res_203839,\n                                  unsigned char loop_cond_203844_bits, __global\n                                  unsigned char *mem_229439, __global\n                                  unsigned char *mem_229444, __global\n                                  unsig",
                   "ned char *mem_229448, __global\n                                  unsigned char *mem_229452, __global\n                                  unsigned char *mem_229456, __global\n                                  unsigned char *mem_229462, __global\n                                  unsigned char *mem_229467)\n{\n    bool x_203809 = x_203809_bits;\n    bool loop_cond_203844 = loop_cond_203844_bits;\n    \n    #define segmap_group_sizze_208939 (mainzisegmap_group_sizze_208295)\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_232806;\n    int32_t local_tid_232807;\n    int64_t group_sizze_232810;\n    int32_t wave_sizze_232809;\n    int32_t group_tid_232808;\n    \n    global_tid_232806 = get_global_id(0);\n    local_tid_232807 = get_local_id(0);\n    group_sizze_232810 = get_local_size(0);\n    wave_sizze_232809 = LOCKSTEP_WIDTH;\n    group_tid_232808 = get_group_id(0);\n    \n    int32_t phys_tid_208946 = global_tid_232806;\n    int64_t global_tid_232811 = sext_i32_i64(group_tid_232808) *\n            segmap_group_sizze_208939 + sext_i32_i64(local_tid_232807);\n    int64_t slice_232812 = s_n_m_203726;\n    int64_t slice_232813 = n_p_203574 * slice_232812;\n    int64_t slice_232814 = partition_sizze_203667 * slice_232813;\n    int64_t gtid_208943 = squot64(global_tid_232811, slice_232813);\n    int64_t remnant_232815 = global_tid_232811 - gtid_208943 * slice_232813;\n    int64_t gtid_208944 = squot64(remnant_232815, slice_232812);\n    int64_t remnant_232816 = remnant_232815 - gtid_208944 * slice_232812;\n    int64_t gtid_208945 = remnant_232816;\n    int64_t remnant_232817 = remnant_232816 - gtid_208945;\n    \n    if ((slt64(gtid_208943, partition_sizze_203667) && slt64(gtid_208944,\n                                                             n_p_203574)) &&\n        slt64(gtid_208945, s_n_m_203726)) {\n        int64_t min_arg_208948;\n        \n        min_arg_208948 = ((__global int",
                   "64_t *) mem_229444)[gtid_208943 *\n                                                           n_p_203574 +\n                                                           gtid_208944];\n        \n        int64_t min_arg_208949;\n        \n        min_arg_208949 = ((__global int64_t *) mem_229448)[gtid_208943 *\n                                                           n_p_203574 +\n                                                           gtid_208944];\n        \n        int64_t min_res_208950;\n        \n        min_res_208950 = ((__global int64_t *) mem_229452)[gtid_208943 *\n                                                           n_p_203574 +\n                                                           gtid_208944];\n        \n        double max_res_208951;\n        \n        max_res_208951 = ((__global double *) mem_229456)[gtid_208943 *\n                                                          n_p_203574 +\n                                                          gtid_208944];\n        \n        bool cond_208953 = gtid_208945 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_208954;\n        \n        if (cond_208953) {\n            defunc_0_m_fun_res_208954 = (int64_t) 0;\n        } else {\n            int64_t y_208955 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_208956 = gtid_208945 == y_208955;\n            int64_t defunc_0_m_fun_res_f_res_208957;\n            \n            if (cond_208956) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_208958 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_208957 =\n                    defunc_0_m_fun_res_f_res_t_res_208958;\n            } else {\n                int64_t x_208959 = sub64(gtid_208945, (int64_t) 1);\n                int64_t x_208960 = mul64(jump_s_203581, x_208959);\n                int64_t min_arg_208961 = add64((int64_t) 1, x_208960);\n                int64_t min_res_208962 = smin64(defunc_0_f_res_203721,\n                                      ",
                   "          min_arg_208961);\n                \n                defunc_0_m_fun_res_f_res_208957 = min_res_208962;\n            }\n            defunc_0_m_fun_res_208954 = defunc_0_m_fun_res_f_res_208957;\n        }\n        \n        bool init_idx_208963;\n        int64_t init_idx_208964;\n        int64_t init_idx_208965;\n        bool loop_while_208966;\n        int64_t low_208967;\n        int64_t high_208968;\n        \n        loop_while_208966 = x_203809;\n        low_208967 = (int64_t) 0;\n        high_208968 = i_203808;\n        while (loop_while_208966) {\n            int64_t x_208969 = add64(low_208967, high_208968);\n            int64_t mid_208970 = sdiv64(x_208969, (int64_t) 2);\n            bool x_208971 = sle64((int64_t) 0, mid_208970);\n            bool y_208972 = slt64(mid_208970, defunc_0_f_res_203721);\n            bool bounds_check_208973 = x_208971 && y_208972;\n            bool index_certs_208974;\n            \n            if (!bounds_check_208973) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 12) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_208970;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203721;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t mid_id_208975;\n            \n            mid_id_208975 = ((__global int64_t *) mem_229439)[gtid_208943 *\n                                                              (defunc_0_f_res_203721 *\n                                                               n_p_203574) +\n                                                              gtid_208944 *\n                                                              defunc_0_f_res_203721 +\n                                                              mid_208970];\n            \n            bool cond_208976 = slt64(mid_id_208975, (int64_t) 0);\n           ",
                   " int64_t mid_idx_208977;\n            \n            if (cond_208976) {\n                mid_idx_208977 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_208977 = mid_id_208975;\n            }\n            \n            bool cond_208978 = sle64(defunc_0_m_fun_res_208954, mid_idx_208977);\n            int64_t loopres_208979;\n            int64_t loopres_208980;\n            \n            if (cond_208978) {\n                int64_t loopres_t_res_208981 = sub64(mid_208970, (int64_t) 1);\n                \n                loopres_208979 = low_208967;\n                loopres_208980 = loopres_t_res_208981;\n            } else {\n                int64_t loopres_f_res_208982 = add64((int64_t) 1, mid_208970);\n                \n                loopres_208979 = loopres_f_res_208982;\n                loopres_208980 = high_208968;\n            }\n            \n            bool loop_cond_208983 = sle64(loopres_208979, loopres_208980);\n            bool loop_while_tmp_232818 = loop_cond_208983;\n            int64_t low_tmp_232819 = loopres_208979;\n            int64_t high_tmp_232820 = loopres_208980;\n            \n            loop_while_208966 = loop_while_tmp_232818;\n            low_208967 = low_tmp_232819;\n            high_208968 = high_tmp_232820;\n        }\n        init_idx_208963 = loop_while_208966;\n        init_idx_208964 = low_208967;\n        init_idx_208965 = high_208968;\n        \n        bool idx_208984;\n        int64_t idx_208985;\n        int64_t idx_208986;\n        int64_t idx_208987;\n        bool loop_while_208988;\n        int64_t l_idx_208989;\n        int64_t r_idx_208990;\n        int64_t span_208991;\n        \n        loop_while_208988 = loop_cond_203844;\n        l_idx_208989 = init_idx_208964;\n        r_idx_208990 = init_idx_208964;\n        span_208991 = (int64_t) 1;\n        while (loop_while_208988) {\n            int64_t max_arg_208992 = sub64(l_idx_208989, (int64_t) 1);\n            int64_t max_res_208993 = smax64((int64_t) 0, max_arg_208992);\n            int64_",
                   "t min_arg_208994 = add64((int64_t) 1, r_idx_208990);\n            int64_t min_res_208995 = smin64(min_arg_208948, min_arg_208994);\n            bool x_208996 = sle64((int64_t) 0, max_res_208993);\n            bool y_208997 = slt64(max_res_208993, defunc_0_f_res_203721);\n            bool bounds_check_208998 = x_208996 && y_208997;\n            bool index_certs_208999;\n            \n            if (!bounds_check_208998) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 13) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_208993;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203721;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_209000;\n            \n            x_209000 = ((__global int64_t *) mem_229439)[gtid_208943 *\n                                                         (defunc_0_f_res_203721 *\n                                                          n_p_203574) +\n                                                         gtid_208944 *\n                                                         defunc_0_f_res_203721 +\n                                                         max_res_208993];\n            \n            int64_t abs_arg_209001 = sub64(x_209000, defunc_0_m_fun_res_208954);\n            int64_t abs_res_209002 = abs64(abs_arg_209001);\n            bool x_209003 = sle64((int64_t) 0, min_res_208995);\n            bool y_209004 = slt64(min_res_208995, defunc_0_f_res_203721);\n            bool bounds_check_209005 = x_209003 && y_209004;\n            bool index_certs_209006;\n            \n            if (!bounds_check_209005) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 14) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_208995;\n             ",
                   "           global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203721;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_209007;\n            \n            x_209007 = ((__global int64_t *) mem_229439)[gtid_208943 *\n                                                         (defunc_0_f_res_203721 *\n                                                          n_p_203574) +\n                                                         gtid_208944 *\n                                                         defunc_0_f_res_203721 +\n                                                         min_res_208995];\n            \n            int64_t abs_arg_209008 = sub64(x_209007, defunc_0_m_fun_res_208954);\n            int64_t abs_res_209009 = abs64(abs_arg_209008);\n            bool cond_209010 = max_res_208993 == l_idx_208989;\n            int64_t loopres_209011;\n            int64_t loopres_209012;\n            int64_t loopres_209013;\n            \n            if (cond_209010) {\n                loopres_209011 = l_idx_208989;\n                loopres_209012 = r_idx_208990;\n                loopres_209013 = min_res_203839;\n            } else {\n                bool cond_209014 = slt64(abs_res_209002, abs_res_209009);\n                bool cond_f_res_209015 = min_res_208995 == r_idx_208990;\n                bool x_209016 = !cond_209014;\n                bool y_209017 = cond_f_res_209015 && x_209016;\n                bool cond_209018 = cond_209014 || y_209017;\n                int64_t loopres_f_res_209019;\n                \n                if (cond_209018) {\n                    loopres_f_res_209019 = max_res_208993;\n                } else {\n                    loopres_f_res_209019 = l_idx_208989;\n                }\n                \n                int64_t loopres_f_res_209020;\n                \n                if (cond_209018) {\n                    loopres_f_res_209020 = r_idx_208990;\n          ",
                   "      } else {\n                    loopres_f_res_209020 = min_res_208995;\n                }\n                \n                int64_t loopres_f_res_209021;\n                \n                if (cond_209018) {\n                    int64_t loopres_f_res_t_res_209022 = add64((int64_t) 1,\n                                                               span_208991);\n                    \n                    loopres_f_res_209021 = loopres_f_res_t_res_209022;\n                } else {\n                    int64_t loopres_f_res_f_res_209023 = add64((int64_t) 1,\n                                                               span_208991);\n                    \n                    loopres_f_res_209021 = loopres_f_res_f_res_209023;\n                }\n                loopres_209011 = loopres_f_res_209019;\n                loopres_209012 = loopres_f_res_209020;\n                loopres_209013 = loopres_f_res_209021;\n            }\n            \n            bool loop_cond_209024 = slt64(loopres_209013, min_res_203839);\n            bool loop_while_tmp_232821 = loop_cond_209024;\n            int64_t l_idx_tmp_232822 = loopres_209011;\n            int64_t r_idx_tmp_232823 = loopres_209012;\n            int64_t span_tmp_232824 = loopres_209013;\n            \n            loop_while_208988 = loop_while_tmp_232821;\n            l_idx_208989 = l_idx_tmp_232822;\n            r_idx_208990 = r_idx_tmp_232823;\n            span_208991 = span_tmp_232824;\n        }\n        idx_208984 = loop_while_208988;\n        idx_208985 = l_idx_208989;\n        idx_208986 = r_idx_208990;\n        idx_208987 = span_208991;\n        \n        int64_t min_res_209025 = smin64(min_arg_208949, idx_208985);\n        int64_t max_res_209026 = smax64((int64_t) 0, min_res_209025);\n        int64_t defunc_0_m_fun_res_209027;\n        \n        if (cond_208953) {\n            defunc_0_m_fun_res_209027 = (int64_t) 0;\n        } else {\n            int64_t y_209028 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_209029 = gtid_208945 == y_20902",
                   "8;\n            int64_t defunc_0_m_fun_res_f_res_209030;\n            \n            if (cond_209029) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_209031 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_209030 =\n                    defunc_0_m_fun_res_f_res_t_res_209031;\n            } else {\n                int64_t x_209032 = sub64(gtid_208945, (int64_t) 1);\n                int64_t x_209033 = mul64(jump_s_203581, x_209032);\n                int64_t min_arg_209034 = add64((int64_t) 1, x_209033);\n                int64_t min_res_209035 = smin64(defunc_0_f_res_203721,\n                                                min_arg_209034);\n                \n                defunc_0_m_fun_res_f_res_209030 = min_res_209035;\n            }\n            defunc_0_m_fun_res_209027 = defunc_0_m_fun_res_f_res_209030;\n        }\n        \n        int64_t x_209036 = add64(min_res_208950, max_res_209026);\n        int64_t r_209037 = sub64(x_209036, (int64_t) 1);\n        bool x_209038 = sle64((int64_t) 0, r_209037);\n        bool y_209039 = slt64(r_209037, defunc_0_f_res_203721);\n        bool bounds_check_209040 = x_209038 && y_209039;\n        bool index_certs_209041;\n        \n        if (!bounds_check_209040) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 15) == -1) {\n                    global_failure_args[0] = (int64_t) r_209037;\n                    global_failure_args[1] = (int64_t) defunc_0_f_res_203721;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_209042;\n        \n        x_209042 = ((__global int64_t *) mem_229439)[gtid_208943 *\n                                                     (defunc_0_f_res_203721 *\n                                                      n_p_203574) +\n                                                     gtid_208944 *\n                                                     defunc_0_f_res_20",
                   "3721 +\n                                                     r_209037];\n        \n        int64_t abs_arg_209043 = sub64(x_209042, defunc_0_m_fun_res_209027);\n        int64_t abs_res_209044 = abs64(abs_arg_209043);\n        bool x_209045 = sle64((int64_t) 0, max_res_209026);\n        bool y_209046 = slt64(max_res_209026, defunc_0_f_res_203721);\n        bool bounds_check_209047 = x_209045 && y_209046;\n        bool index_certs_209048;\n        \n        if (!bounds_check_209047) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 16) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_209026;\n                    global_failure_args[1] = (int64_t) defunc_0_f_res_203721;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_209049;\n        \n        x_209049 = ((__global int64_t *) mem_229439)[gtid_208943 *\n                                                     (defunc_0_f_res_203721 *\n                                                      n_p_203574) +\n                                                     gtid_208944 *\n                                                     defunc_0_f_res_203721 +\n                                                     max_res_209026];\n        \n        int64_t abs_arg_209050 = sub64(x_209049, defunc_0_m_fun_res_209027);\n        int64_t abs_res_209051 = abs64(abs_arg_209050);\n        int64_t max_res_209052 = smax64(abs_res_209044, abs_res_209051);\n        double defunc_0_f_res_209053 = sitofp_i64_f64(max_res_209052);\n        double defunc_1_f_res_209054 = max_res_208951 + defunc_0_f_res_209053;\n        \n        ((__global double *) mem_229462)[gtid_208943 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_208944 * s_n_m_203726 +\n                                         gtid_208945] = defunc_1_f_res_209054;\n        ((__global int64_t *) mem_229467)[gtid_208943 * (",
                   "s_n_m_203726 *\n                                                         n_p_203574) +\n                                          gtid_208944 * s_n_m_203726 +\n                                          gtid_208945] = max_res_209026;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_208939\n}\n__kernel void mainzisegmap_209556(__global int *global_failure,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667, __global\n                                  unsigned char *ext_mem_229305, __global\n                                  unsigned char *mem_229496)\n{\n    #define segmap_group_sizze_209551 (mainzisegmap_group_sizze_209527)\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_232851;\n    int32_t local_tid_232852;\n    int64_t group_sizze_232855;\n    int32_t wave_sizze_232854;\n    int32_t group_tid_232853;\n    \n    global_tid_232851 = get_global_id(0);\n    local_tid_232852 = get_local_id(0);\n    group_sizze_232855 = get_local_size(0);\n    wave_sizze_232854 = LOCKSTEP_WIDTH;\n    group_tid_232853 = get_group_id(0);\n    \n    int32_t phys_tid_209556 = global_tid_232851;\n    int64_t global_tid_232856 = sext_i32_i64(group_tid_232853) *\n            segmap_group_sizze_209551 + sext_i32_i64(local_tid_232852);\n    int64_t slice_232857 = n_203572;\n    int64_t slice_232858 = partition_sizze_203667 * slice_232857;\n    int64_t gtid_209554 = squot64(global_tid_232856, slice_232857);\n    int64_t remnant_232859 = global_tid_232856 - gtid_209554 * slice_232857;\n    int64_t gtid_209555 = remnant_232859;\n    int64_t remnant_232860 = remnant_232859 - gtid_209555;\n    \n    if (slt64(gtid_209554, partition_sizze_203667) && slt64(gtid_209555,\n                                                            n_203572)) {\n        int64_t x_209557;\n        \n        x_209557 = ((__global int64_t *) ext_mem_229305",
                   ")[gtid_209554 *\n                                                         n_203572 +\n                                                         gtid_209555];\n        \n        int64_t defunc_0_f_res_209558 = add64((int64_t) 1, x_209557);\n        \n        ((__global int64_t *) mem_229496)[gtid_209554 * n_203572 +\n                                          gtid_209555] = defunc_0_f_res_209558;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_209551\n}\n__kernel void mainzisegmap_209568(__global int *global_failure,\n                                  int64_t q_l_203577,\n                                  int64_t partition_sizze_203667,\n                                  int64_t min_res_203971, double i64_res_203977,\n                                  __global unsigned char *ext_mem_229304,\n                                  __global unsigned char *mem_229500, __global\n                                  unsigned char *mem_229503, __global\n                                  unsigned char *mem_229506, __global\n                                  unsigned char *mem_229509)\n{\n    #define segmap_group_sizze_209561 (mainzisegmap_group_sizze_209501)\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_232861;\n    int32_t local_tid_232862;\n    int64_t group_sizze_232865;\n    int32_t wave_sizze_232864;\n    int32_t group_tid_232863;\n    \n    global_tid_232861 = get_global_id(0);\n    local_tid_232862 = get_local_id(0);\n    group_sizze_232865 = get_local_size(0);\n    wave_sizze_232864 = LOCKSTEP_WIDTH;\n    group_tid_232863 = get_group_id(0);\n    \n    int32_t phys_tid_209568 = global_tid_232861;\n    int64_t global_tid_232866 = sext_i32_i64(group_tid_232863) *\n            segmap_group_sizze_209561 + sext_i32_i64(local_tid_232862);\n    int64_t slice_232867 = partition_sizze_203667;\n    int64_t gtid_209567 = global_tid_232866;\n    int64_t remnant_232868 = global_tid_2",
                   "32866 - gtid_209567;\n    \n    if (slt64(gtid_209567, partition_sizze_203667)) {\n        int64_t x_209569;\n        \n        x_209569 = ((__global int64_t *) ext_mem_229304)[gtid_209567];\n        \n        int64_t min_arg_209570 = sub64(x_209569, (int64_t) 1);\n        int64_t min_arg_209571 = sub64(x_209569, min_res_203971);\n        int64_t min_res_209572 = smin64(q_l_203577, x_209569);\n        double i64_res_209573 = sitofp_i64_f64(x_209569);\n        double x_209574 = i64_res_203977 - i64_res_209573;\n        double max_arg_209575 = x_209574 / 2.0;\n        double max_res_209576 = fmax64(0.0, max_arg_209575);\n        \n        ((__global int64_t *) mem_229500)[gtid_209567] = min_arg_209570;\n        ((__global int64_t *) mem_229503)[gtid_209567] = min_arg_209571;\n        ((__global int64_t *) mem_229506)[gtid_209567] = min_res_209572;\n        ((__global double *) mem_229509)[gtid_209567] = max_res_209576;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_209561\n}\n__kernel void mainzisegmap_209589(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572, int64_t jump_l_203583,\n                                  int64_t partition_sizze_203667,\n                                  int64_t l_n_m_203733, int64_t i_203760,\n                                  unsigned char x_203761_bits,\n                                  int64_t min_res_203971,\n                                  unsigned char loop_cond_203976_bits, __global\n                                  unsigned char *ext_mem_229305, __global\n                                  unsigned char *mem_229496, __global\n                                  unsigned char *mem_229500, __global\n                                  unsigned char *mem_229503, __global\n                                  unsigned char *mem_229506, __global\n                                  unsigned char",
                   " *mem_229509, __global\n                                  unsigned char *mem_229514, __global\n                                  unsigned char *mem_229518)\n{\n    bool x_203761 = x_203761_bits;\n    bool loop_cond_203976 = loop_cond_203976_bits;\n    \n    #define segmap_group_sizze_209583 (mainzisegmap_group_sizze_209297)\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_232869;\n    int32_t local_tid_232870;\n    int64_t group_sizze_232873;\n    int32_t wave_sizze_232872;\n    int32_t group_tid_232871;\n    \n    global_tid_232869 = get_global_id(0);\n    local_tid_232870 = get_local_id(0);\n    group_sizze_232873 = get_local_size(0);\n    wave_sizze_232872 = LOCKSTEP_WIDTH;\n    group_tid_232871 = get_group_id(0);\n    \n    int32_t phys_tid_209589 = global_tid_232869;\n    int64_t global_tid_232874 = sext_i32_i64(group_tid_232871) *\n            segmap_group_sizze_209583 + sext_i32_i64(local_tid_232870);\n    int64_t slice_232875 = l_n_m_203733;\n    int64_t slice_232876 = partition_sizze_203667 * slice_232875;\n    int64_t gtid_209587 = squot64(global_tid_232874, slice_232875);\n    int64_t remnant_232877 = global_tid_232874 - gtid_209587 * slice_232875;\n    int64_t gtid_209588 = remnant_232877;\n    int64_t remnant_232878 = remnant_232877 - gtid_209588;\n    \n    if (slt64(gtid_209587, partition_sizze_203667) && slt64(gtid_209588,\n                                                            l_n_m_203733)) {\n        int64_t min_arg_209592;\n        \n        min_arg_209592 = ((__global int64_t *) mem_229500)[gtid_209587];\n        \n        int64_t min_arg_209593;\n        \n        min_arg_209593 = ((__global int64_t *) mem_229503)[gtid_209587];\n        \n        int64_t min_res_209594;\n        \n        min_res_209594 = ((__global int64_t *) mem_229506)[gtid_209587];\n        \n        double max_res_209595;\n        \n        max_res_209595 = ((__global double *) mem_229509)",
                   "[gtid_209587];\n        \n        int64_t min_arg_209597 = mul64(jump_l_203583, gtid_209588);\n        int64_t min_res_209598 = smin64(i_203760, min_arg_209597);\n        int64_t defunc_0_g_res_209599 = add64((int64_t) 1, min_res_209598);\n        bool init_idx_209600;\n        int64_t init_idx_209601;\n        int64_t init_idx_209602;\n        bool loop_while_209603;\n        int64_t low_209604;\n        int64_t high_209605;\n        \n        loop_while_209603 = x_203761;\n        low_209604 = (int64_t) 0;\n        high_209605 = i_203760;\n        while (loop_while_209603) {\n            int64_t x_209606 = add64(low_209604, high_209605);\n            int64_t mid_209607 = sdiv64(x_209606, (int64_t) 2);\n            bool x_209608 = sle64((int64_t) 0, mid_209607);\n            bool y_209609 = slt64(mid_209607, n_203572);\n            bool bounds_check_209610 = x_209608 && y_209609;\n            bool index_certs_209611;\n            \n            if (!bounds_check_209610) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 22) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_209607;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t mid_id_209612;\n            \n            mid_id_209612 = ((__global int64_t *) mem_229496)[gtid_209587 *\n                                                              n_203572 +\n                                                              mid_209607];\n            \n            bool cond_209613 = slt64(mid_id_209612, (int64_t) 0);\n            int64_t mid_idx_209614;\n            \n            if (cond_209613) {\n                mid_idx_209614 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_209614 = mid_id_209612;\n            }\n            \n            bool cond_209615 = sle64(defunc_0_g_res_209599,",
                   " mid_idx_209614);\n            int64_t loopres_209616;\n            int64_t loopres_209617;\n            \n            if (cond_209615) {\n                int64_t loopres_t_res_209618 = sub64(mid_209607, (int64_t) 1);\n                \n                loopres_209616 = low_209604;\n                loopres_209617 = loopres_t_res_209618;\n            } else {\n                int64_t loopres_f_res_209619 = add64((int64_t) 1, mid_209607);\n                \n                loopres_209616 = loopres_f_res_209619;\n                loopres_209617 = high_209605;\n            }\n            \n            bool loop_cond_209620 = sle64(loopres_209616, loopres_209617);\n            bool loop_while_tmp_232879 = loop_cond_209620;\n            int64_t low_tmp_232880 = loopres_209616;\n            int64_t high_tmp_232881 = loopres_209617;\n            \n            loop_while_209603 = loop_while_tmp_232879;\n            low_209604 = low_tmp_232880;\n            high_209605 = high_tmp_232881;\n        }\n        init_idx_209600 = loop_while_209603;\n        init_idx_209601 = low_209604;\n        init_idx_209602 = high_209605;\n        \n        bool idx_209621;\n        int64_t idx_209622;\n        int64_t idx_209623;\n        int64_t idx_209624;\n        bool loop_while_209625;\n        int64_t l_idx_209626;\n        int64_t r_idx_209627;\n        int64_t span_209628;\n        \n        loop_while_209625 = loop_cond_203976;\n        l_idx_209626 = init_idx_209601;\n        r_idx_209627 = init_idx_209601;\n        span_209628 = (int64_t) 1;\n        while (loop_while_209625) {\n            int64_t max_arg_209629 = sub64(l_idx_209626, (int64_t) 1);\n            int64_t max_res_209630 = smax64((int64_t) 0, max_arg_209629);\n            int64_t min_arg_209631 = add64((int64_t) 1, r_idx_209627);\n            int64_t min_res_209632 = smin64(min_arg_209592, min_arg_209631);\n            bool x_209633 = sle64((int64_t) 0, max_res_209630);\n            bool y_209634 = slt64(max_res_209630, n_203572);\n            bool bounds_check_209635 ",
                   "= x_209633 && y_209634;\n            bool index_certs_209636;\n            \n            if (!bounds_check_209635) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 23) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_209630;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_209637;\n            \n            x_209637 = ((__global int64_t *) mem_229496)[gtid_209587 *\n                                                         n_203572 +\n                                                         max_res_209630];\n            \n            int64_t abs_arg_209638 = sub64(x_209637, defunc_0_g_res_209599);\n            int64_t abs_res_209639 = abs64(abs_arg_209638);\n            bool x_209640 = sle64((int64_t) 0, min_res_209632);\n            bool y_209641 = slt64(min_res_209632, n_203572);\n            bool bounds_check_209642 = x_209640 && y_209641;\n            bool index_certs_209643;\n            \n            if (!bounds_check_209642) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 24) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_209632;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_209644;\n            \n            x_209644 = ((__global int64_t *) mem_229496)[gtid_209587 *\n                                                         n_203572 +\n                                                         min_res_209632];\n            \n            int64_t abs_arg_209645 = sub64(x_209644, defunc_0_g_res_209599);\n            int64_t abs_res_209646 = abs64(abs_arg_209645);\n            bool c",
                   "ond_209647 = max_res_209630 == l_idx_209626;\n            int64_t loopres_209648;\n            int64_t loopres_209649;\n            int64_t loopres_209650;\n            \n            if (cond_209647) {\n                loopres_209648 = l_idx_209626;\n                loopres_209649 = r_idx_209627;\n                loopres_209650 = min_res_203971;\n            } else {\n                bool cond_209651 = slt64(abs_res_209639, abs_res_209646);\n                bool cond_f_res_209652 = min_res_209632 == r_idx_209627;\n                bool x_209653 = !cond_209651;\n                bool y_209654 = cond_f_res_209652 && x_209653;\n                bool cond_209655 = cond_209651 || y_209654;\n                int64_t loopres_f_res_209656;\n                \n                if (cond_209655) {\n                    loopres_f_res_209656 = max_res_209630;\n                } else {\n                    loopres_f_res_209656 = l_idx_209626;\n                }\n                \n                int64_t loopres_f_res_209657;\n                \n                if (cond_209655) {\n                    loopres_f_res_209657 = r_idx_209627;\n                } else {\n                    loopres_f_res_209657 = min_res_209632;\n                }\n                \n                int64_t loopres_f_res_209658;\n                \n                if (cond_209655) {\n                    int64_t loopres_f_res_t_res_209659 = add64((int64_t) 1,\n                                                               span_209628);\n                    \n                    loopres_f_res_209658 = loopres_f_res_t_res_209659;\n                } else {\n                    int64_t loopres_f_res_f_res_209660 = add64((int64_t) 1,\n                                                               span_209628);\n                    \n                    loopres_f_res_209658 = loopres_f_res_f_res_209660;\n                }\n                loopres_209648 = loopres_f_res_209656;\n                loopres_209649 = loopres_f_res_209657;\n                loopres_209650 = l",
                   "oopres_f_res_209658;\n            }\n            \n            bool loop_cond_209661 = slt64(loopres_209650, min_res_203971);\n            bool loop_while_tmp_232882 = loop_cond_209661;\n            int64_t l_idx_tmp_232883 = loopres_209648;\n            int64_t r_idx_tmp_232884 = loopres_209649;\n            int64_t span_tmp_232885 = loopres_209650;\n            \n            loop_while_209625 = loop_while_tmp_232882;\n            l_idx_209626 = l_idx_tmp_232883;\n            r_idx_209627 = r_idx_tmp_232884;\n            span_209628 = span_tmp_232885;\n        }\n        idx_209621 = loop_while_209625;\n        idx_209622 = l_idx_209626;\n        idx_209623 = r_idx_209627;\n        idx_209624 = span_209628;\n        \n        int64_t min_res_209662 = smin64(min_arg_209593, idx_209622);\n        int64_t max_res_209663 = smax64((int64_t) 0, min_res_209662);\n        int64_t x_209664 = add64(min_res_209594, max_res_209663);\n        int64_t r_209665 = sub64(x_209664, (int64_t) 1);\n        bool x_209666 = sle64((int64_t) 0, r_209665);\n        bool y_209667 = slt64(r_209665, n_203572);\n        bool bounds_check_209668 = x_209666 && y_209667;\n        bool index_certs_209669;\n        \n        if (!bounds_check_209668) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 25) == -1) {\n                    global_failure_args[0] = (int64_t) r_209665;\n                    global_failure_args[1] = (int64_t) n_203572;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_209670;\n        \n        x_209670 = ((__global int64_t *) ext_mem_229305)[gtid_209587 *\n                                                         n_203572 + r_209665];\n        \n        int64_t abs_arg_209671 = sub64(x_209670, min_res_209598);\n        int64_t abs_res_209672 = abs64(abs_arg_209671);\n        bool x_209673 = sle64((int64_t) 0, max_res_209663);\n        bool y_209674 = slt64(max_res_209663, n_203572);\n        bool bounds_check_209675 = ",
                   "x_209673 && y_209674;\n        bool index_certs_209676;\n        \n        if (!bounds_check_209675) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 26) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_209663;\n                    global_failure_args[1] = (int64_t) n_203572;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_209677;\n        \n        x_209677 = ((__global int64_t *) ext_mem_229305)[gtid_209587 *\n                                                         n_203572 +\n                                                         max_res_209663];\n        \n        int64_t abs_arg_209678 = sub64(x_209677, min_res_209598);\n        int64_t abs_res_209679 = abs64(abs_arg_209678);\n        int64_t max_res_209680 = smax64(abs_res_209672, abs_res_209679);\n        double defunc_0_f_res_209681 = sitofp_i64_f64(max_res_209680);\n        double defunc_1_f_res_209682 = max_res_209595 + defunc_0_f_res_209681;\n        \n        ((__global double *) mem_229514)[gtid_209587 * l_n_m_203733 +\n                                         gtid_209588] = defunc_1_f_res_209682;\n        ((__global int64_t *) mem_229518)[gtid_209587 * l_n_m_203733 +\n                                          gtid_209588] = max_res_209663;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_209583\n}\n__kernel void mainzisegmap_210182(__global int *global_failure,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667, __global\n                                  unsigned char *ext_mem_229305, __global\n                                  unsigned char *mem_229545)\n{\n    #define segmap_group_sizze_210177 (mainzisegmap_group_sizze_210153)\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_232911;\n    int32_t loc",
                   "al_tid_232912;\n    int64_t group_sizze_232915;\n    int32_t wave_sizze_232914;\n    int32_t group_tid_232913;\n    \n    global_tid_232911 = get_global_id(0);\n    local_tid_232912 = get_local_id(0);\n    group_sizze_232915 = get_local_size(0);\n    wave_sizze_232914 = LOCKSTEP_WIDTH;\n    group_tid_232913 = get_group_id(0);\n    \n    int32_t phys_tid_210182 = global_tid_232911;\n    int64_t global_tid_232916 = sext_i32_i64(group_tid_232913) *\n            segmap_group_sizze_210177 + sext_i32_i64(local_tid_232912);\n    int64_t slice_232917 = n_203572;\n    int64_t slice_232918 = partition_sizze_203667 * slice_232917;\n    int64_t gtid_210180 = squot64(global_tid_232916, slice_232917);\n    int64_t remnant_232919 = global_tid_232916 - gtid_210180 * slice_232917;\n    int64_t gtid_210181 = remnant_232919;\n    int64_t remnant_232920 = remnant_232919 - gtid_210181;\n    \n    if (slt64(gtid_210180, partition_sizze_203667) && slt64(gtid_210181,\n                                                            n_203572)) {\n        int64_t x_210183;\n        \n        x_210183 = ((__global int64_t *) ext_mem_229305)[gtid_210180 *\n                                                         n_203572 +\n                                                         gtid_210181];\n        \n        int64_t defunc_0_f_res_210184 = add64((int64_t) 1, x_210183);\n        \n        ((__global int64_t *) mem_229545)[gtid_210180 * n_203572 +\n                                          gtid_210181] = defunc_0_f_res_210184;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_210177\n}\n__kernel void mainzisegmap_210194(__global int *global_failure,\n                                  int64_t q_t_203576,\n                                  int64_t partition_sizze_203667,\n                                  int64_t min_res_204083, double i64_res_204089,\n                                  __global unsigned char *ext_mem_229304,\n                                  __global unsigned char *mem_229549, __global\n                   ",
                   "               unsigned char *mem_229552, __global\n                                  unsigned char *mem_229555, __global\n                                  unsigned char *mem_229558)\n{\n    #define segmap_group_sizze_210187 (mainzisegmap_group_sizze_210127)\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_232921;\n    int32_t local_tid_232922;\n    int64_t group_sizze_232925;\n    int32_t wave_sizze_232924;\n    int32_t group_tid_232923;\n    \n    global_tid_232921 = get_global_id(0);\n    local_tid_232922 = get_local_id(0);\n    group_sizze_232925 = get_local_size(0);\n    wave_sizze_232924 = LOCKSTEP_WIDTH;\n    group_tid_232923 = get_group_id(0);\n    \n    int32_t phys_tid_210194 = global_tid_232921;\n    int64_t global_tid_232926 = sext_i32_i64(group_tid_232923) *\n            segmap_group_sizze_210187 + sext_i32_i64(local_tid_232922);\n    int64_t slice_232927 = partition_sizze_203667;\n    int64_t gtid_210193 = global_tid_232926;\n    int64_t remnant_232928 = global_tid_232926 - gtid_210193;\n    \n    if (slt64(gtid_210193, partition_sizze_203667)) {\n        int64_t x_210195;\n        \n        x_210195 = ((__global int64_t *) ext_mem_229304)[gtid_210193];\n        \n        int64_t min_arg_210196 = sub64(x_210195, (int64_t) 1);\n        int64_t min_arg_210197 = sub64(x_210195, min_res_204083);\n        int64_t min_res_210198 = smin64(q_t_203576, x_210195);\n        double i64_res_210199 = sitofp_i64_f64(x_210195);\n        double x_210200 = i64_res_204089 - i64_res_210199;\n        double max_arg_210201 = x_210200 / 2.0;\n        double max_res_210202 = fmax64(0.0, max_arg_210201);\n        \n        ((__global int64_t *) mem_229549)[gtid_210193] = min_arg_210196;\n        ((__global int64_t *) mem_229552)[gtid_210193] = min_arg_210197;\n        ((__global int64_t *) mem_229555)[gtid_210193] = min_res_210198;\n        ((__global double *) mem_229558)[gtid_210193] = max",
                   "_res_210202;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_210187\n}\n__kernel void mainzisegmap_210215(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572, int64_t jump_t_203582,\n                                  int64_t partition_sizze_203667,\n                                  int64_t t_n_m_203740, int64_t i_203760,\n                                  unsigned char x_203761_bits,\n                                  int64_t min_res_204083,\n                                  unsigned char loop_cond_204088_bits, __global\n                                  unsigned char *ext_mem_229305, __global\n                                  unsigned char *mem_229545, __global\n                                  unsigned char *mem_229549, __global\n                                  unsigned char *mem_229552, __global\n                                  unsigned char *mem_229555, __global\n                                  unsigned char *mem_229558, __global\n                                  unsigned char *mem_229563, __global\n                                  unsigned char *mem_229567)\n{\n    bool x_203761 = x_203761_bits;\n    bool loop_cond_204088 = loop_cond_204088_bits;\n    \n    #define segmap_group_sizze_210209 (mainzisegmap_group_sizze_209923)\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_232929;\n    int32_t local_tid_232930;\n    int64_t group_sizze_232933;\n    int32_t wave_sizze_232932;\n    int32_t group_tid_232931;\n    \n    global_tid_232929 = get_global_id(0);\n    local_tid_232930 = get_local_id(0);\n    group_sizze_232933 = get_local_size(0);\n    wave_sizze_232932 = LOCKSTEP_WIDTH;\n    group_tid_232931 = get_group_id(0);\n    \n    int32_t phys_tid_210215 = global_tid_232929;\n    int64_t",
                   " global_tid_232934 = sext_i32_i64(group_tid_232931) *\n            segmap_group_sizze_210209 + sext_i32_i64(local_tid_232930);\n    int64_t slice_232935 = t_n_m_203740;\n    int64_t slice_232936 = partition_sizze_203667 * slice_232935;\n    int64_t gtid_210213 = squot64(global_tid_232934, slice_232935);\n    int64_t remnant_232937 = global_tid_232934 - gtid_210213 * slice_232935;\n    int64_t gtid_210214 = remnant_232937;\n    int64_t remnant_232938 = remnant_232937 - gtid_210214;\n    \n    if (slt64(gtid_210213, partition_sizze_203667) && slt64(gtid_210214,\n                                                            t_n_m_203740)) {\n        int64_t min_arg_210218;\n        \n        min_arg_210218 = ((__global int64_t *) mem_229549)[gtid_210213];\n        \n        int64_t min_arg_210219;\n        \n        min_arg_210219 = ((__global int64_t *) mem_229552)[gtid_210213];\n        \n        int64_t min_res_210220;\n        \n        min_res_210220 = ((__global int64_t *) mem_229555)[gtid_210213];\n        \n        double max_res_210221;\n        \n        max_res_210221 = ((__global double *) mem_229558)[gtid_210213];\n        \n        int64_t min_arg_210223 = mul64(jump_t_203582, gtid_210214);\n        int64_t min_res_210224 = smin64(i_203760, min_arg_210223);\n        int64_t defunc_0_g_res_210225 = add64((int64_t) 1, min_res_210224);\n        bool init_idx_210226;\n        int64_t init_idx_210227;\n        int64_t init_idx_210228;\n        bool loop_while_210229;\n        int64_t low_210230;\n        int64_t high_210231;\n        \n        loop_while_210229 = x_203761;\n        low_210230 = (int64_t) 0;\n        high_210231 = i_203760;\n        while (loop_while_210229) {\n            int64_t x_210232 = add64(low_210230, high_210231);\n            int64_t mid_210233 = sdiv64(x_210232, (int64_t) 2);\n            bool x_210234 = sle64((int64_t) 0, mid_210233);\n            bool y_210235 = slt64(mid_210233, n_203572);\n            bool bounds_check_210236 = x_210234 && y_210235;\n            bool index_cer",
                   "ts_210237;\n            \n            if (!bounds_check_210236) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 32) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_210233;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t mid_id_210238;\n            \n            mid_id_210238 = ((__global int64_t *) mem_229545)[gtid_210213 *\n                                                              n_203572 +\n                                                              mid_210233];\n            \n            bool cond_210239 = slt64(mid_id_210238, (int64_t) 0);\n            int64_t mid_idx_210240;\n            \n            if (cond_210239) {\n                mid_idx_210240 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_210240 = mid_id_210238;\n            }\n            \n            bool cond_210241 = sle64(defunc_0_g_res_210225, mid_idx_210240);\n            int64_t loopres_210242;\n            int64_t loopres_210243;\n            \n            if (cond_210241) {\n                int64_t loopres_t_res_210244 = sub64(mid_210233, (int64_t) 1);\n                \n                loopres_210242 = low_210230;\n                loopres_210243 = loopres_t_res_210244;\n            } else {\n                int64_t loopres_f_res_210245 = add64((int64_t) 1, mid_210233);\n                \n                loopres_210242 = loopres_f_res_210245;\n                loopres_210243 = high_210231;\n            }\n            \n            bool loop_cond_210246 = sle64(loopres_210242, loopres_210243);\n            bool loop_while_tmp_232939 = loop_cond_210246;\n            int64_t low_tmp_232940 = loopres_210242;\n            int64_t high_tmp_232941 = loopres_210243;\n            \n            loop_while_210229 = loop_while_tmp_232939;\n            low_",
                   "210230 = low_tmp_232940;\n            high_210231 = high_tmp_232941;\n        }\n        init_idx_210226 = loop_while_210229;\n        init_idx_210227 = low_210230;\n        init_idx_210228 = high_210231;\n        \n        bool idx_210247;\n        int64_t idx_210248;\n        int64_t idx_210249;\n        int64_t idx_210250;\n        bool loop_while_210251;\n        int64_t l_idx_210252;\n        int64_t r_idx_210253;\n        int64_t span_210254;\n        \n        loop_while_210251 = loop_cond_204088;\n        l_idx_210252 = init_idx_210227;\n        r_idx_210253 = init_idx_210227;\n        span_210254 = (int64_t) 1;\n        while (loop_while_210251) {\n            int64_t max_arg_210255 = sub64(l_idx_210252, (int64_t) 1);\n            int64_t max_res_210256 = smax64((int64_t) 0, max_arg_210255);\n            int64_t min_arg_210257 = add64((int64_t) 1, r_idx_210253);\n            int64_t min_res_210258 = smin64(min_arg_210218, min_arg_210257);\n            bool x_210259 = sle64((int64_t) 0, max_res_210256);\n            bool y_210260 = slt64(max_res_210256, n_203572);\n            bool bounds_check_210261 = x_210259 && y_210260;\n            bool index_certs_210262;\n            \n            if (!bounds_check_210261) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 33) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_210256;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_210263;\n            \n            x_210263 = ((__global int64_t *) mem_229545)[gtid_210213 *\n                                                         n_203572 +\n                                                         max_res_210256];\n            \n            int64_t abs_arg_210264 = sub64(x_210263, defunc_0_g_res_210225);\n            int64_t abs_res_210265 = abs64(abs_arg",
                   "_210264);\n            bool x_210266 = sle64((int64_t) 0, min_res_210258);\n            bool y_210267 = slt64(min_res_210258, n_203572);\n            bool bounds_check_210268 = x_210266 && y_210267;\n            bool index_certs_210269;\n            \n            if (!bounds_check_210268) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 34) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_210258;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_210270;\n            \n            x_210270 = ((__global int64_t *) mem_229545)[gtid_210213 *\n                                                         n_203572 +\n                                                         min_res_210258];\n            \n            int64_t abs_arg_210271 = sub64(x_210270, defunc_0_g_res_210225);\n            int64_t abs_res_210272 = abs64(abs_arg_210271);\n            bool cond_210273 = max_res_210256 == l_idx_210252;\n            int64_t loopres_210274;\n            int64_t loopres_210275;\n            int64_t loopres_210276;\n            \n            if (cond_210273) {\n                loopres_210274 = l_idx_210252;\n                loopres_210275 = r_idx_210253;\n                loopres_210276 = min_res_204083;\n            } else {\n                bool cond_210277 = slt64(abs_res_210265, abs_res_210272);\n                bool cond_f_res_210278 = min_res_210258 == r_idx_210253;\n                bool x_210279 = !cond_210277;\n                bool y_210280 = cond_f_res_210278 && x_210279;\n                bool cond_210281 = cond_210277 || y_210280;\n                int64_t loopres_f_res_210282;\n                \n                if (cond_210281) {\n                    loopres_f_res_210282 = max_res_210256;\n                } else {\n                    loopres_f_res_210282 ",
                   "= l_idx_210252;\n                }\n                \n                int64_t loopres_f_res_210283;\n                \n                if (cond_210281) {\n                    loopres_f_res_210283 = r_idx_210253;\n                } else {\n                    loopres_f_res_210283 = min_res_210258;\n                }\n                \n                int64_t loopres_f_res_210284;\n                \n                if (cond_210281) {\n                    int64_t loopres_f_res_t_res_210285 = add64((int64_t) 1,\n                                                               span_210254);\n                    \n                    loopres_f_res_210284 = loopres_f_res_t_res_210285;\n                } else {\n                    int64_t loopres_f_res_f_res_210286 = add64((int64_t) 1,\n                                                               span_210254);\n                    \n                    loopres_f_res_210284 = loopres_f_res_f_res_210286;\n                }\n                loopres_210274 = loopres_f_res_210282;\n                loopres_210275 = loopres_f_res_210283;\n                loopres_210276 = loopres_f_res_210284;\n            }\n            \n            bool loop_cond_210287 = slt64(loopres_210276, min_res_204083);\n            bool loop_while_tmp_232942 = loop_cond_210287;\n            int64_t l_idx_tmp_232943 = loopres_210274;\n            int64_t r_idx_tmp_232944 = loopres_210275;\n            int64_t span_tmp_232945 = loopres_210276;\n            \n            loop_while_210251 = loop_while_tmp_232942;\n            l_idx_210252 = l_idx_tmp_232943;\n            r_idx_210253 = r_idx_tmp_232944;\n            span_210254 = span_tmp_232945;\n        }\n        idx_210247 = loop_while_210251;\n        idx_210248 = l_idx_210252;\n        idx_210249 = r_idx_210253;\n        idx_210250 = span_210254;\n        \n        int64_t min_res_210288 = smin64(min_arg_210219, idx_210248);\n        int64_t max_res_210289 = smax64((int64_t) 0, min_res_210288);\n        int64_t x_210290 = add64(min_res_210220, ma",
                   "x_res_210289);\n        int64_t r_210291 = sub64(x_210290, (int64_t) 1);\n        bool x_210292 = sle64((int64_t) 0, r_210291);\n        bool y_210293 = slt64(r_210291, n_203572);\n        bool bounds_check_210294 = x_210292 && y_210293;\n        bool index_certs_210295;\n        \n        if (!bounds_check_210294) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 35) == -1) {\n                    global_failure_args[0] = (int64_t) r_210291;\n                    global_failure_args[1] = (int64_t) n_203572;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_210296;\n        \n        x_210296 = ((__global int64_t *) ext_mem_229305)[gtid_210213 *\n                                                         n_203572 + r_210291];\n        \n        int64_t abs_arg_210297 = sub64(x_210296, min_res_210224);\n        int64_t abs_res_210298 = abs64(abs_arg_210297);\n        bool x_210299 = sle64((int64_t) 0, max_res_210289);\n        bool y_210300 = slt64(max_res_210289, n_203572);\n        bool bounds_check_210301 = x_210299 && y_210300;\n        bool index_certs_210302;\n        \n        if (!bounds_check_210301) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 36) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_210289;\n                    global_failure_args[1] = (int64_t) n_203572;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_210303;\n        \n        x_210303 = ((__global int64_t *) ext_mem_229305)[gtid_210213 *\n                                                         n_203572 +\n                                                         max_res_210289];\n        \n        int64_t abs_arg_210304 = sub64(x_210303, min_res_210224);\n        int64_t abs_res_210305 = abs64(abs_arg_210304);\n        int64_t max_res_210306 = smax64(abs_res_210298, abs_res_210305);\n        double defunc_",
                   "0_f_res_210307 = sitofp_i64_f64(max_res_210306);\n        double defunc_1_f_res_210308 = max_res_210221 + defunc_0_f_res_210307;\n        \n        ((__global double *) mem_229563)[gtid_210213 * t_n_m_203740 +\n                                         gtid_210214] = defunc_1_f_res_210308;\n        ((__global int64_t *) mem_229567)[gtid_210213 * t_n_m_203740 +\n                                          gtid_210214] = max_res_210289;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_210209\n}\n__kernel void mainzisegmap_210357(__global int *global_failure,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667,\n                                  int64_t ctx_param_ext_229619, __global\n                                  unsigned char *mem_229269, __global\n                                  unsigned char *mem_param_229623, __global\n                                  unsigned char *mem_229628)\n{\n    #define segmap_group_sizze_210352 (mainzisegmap_group_sizze_210326)\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_232986;\n    int32_t local_tid_232987;\n    int64_t group_sizze_232990;\n    int32_t wave_sizze_232989;\n    int32_t group_tid_232988;\n    \n    global_tid_232986 = get_global_id(0);\n    local_tid_232987 = get_local_id(0);\n    group_sizze_232990 = get_local_size(0);\n    wave_sizze_232989 = LOCKSTEP_WIDTH;\n    group_tid_232988 = get_group_id(0);\n    \n    int32_t phys_tid_210357 = global_tid_232986;\n    int64_t global_tid_232991 = sext_i32_i64(group_tid_232988) *\n            segmap_group_sizze_210352 + sext_i32_i64(local_tid_232987);\n    int64_t slice_232992 = n_203572;\n    int64_t slice_232993 = partition_sizze_203667 * slice_232992;\n    int64_t gtid_210355 = squot64(global_tid_232991, slice_232992);\n    int64_t remnant_232994 = global_tid_232991 - gtid_210355 * slice_232992;\n    in",
                   "t64_t gtid_210356 = remnant_232994;\n    int64_t remnant_232995 = remnant_232994 - gtid_210356;\n    \n    if (slt64(gtid_210355, partition_sizze_203667) && slt64(gtid_210356,\n                                                            n_203572)) {\n        double x_210358;\n        \n        x_210358 = ((__global double *) mem_229269)[gtid_210355 * n_203572 +\n                                                    gtid_210356];\n        \n        double x_210359;\n        \n        x_210359 = ((__global double *) mem_param_229623)[gtid_210355 *\n                                                          ctx_param_ext_229619 +\n                                                          gtid_210356];\n        \n        double defunc_1_f_res_210360 = x_210358 - x_210359;\n        \n        ((__global double *) mem_229628)[gtid_210355 * n_203572 + gtid_210356] =\n            defunc_1_f_res_210360;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_210352\n}\n__kernel void mainzisegmap_210502(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572, int64_t n_p_203574,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t i_203760,\n                                  int64_t ctx_param_ext_229596,\n                                  int64_t ctx_param_ext_229597,\n                                  int64_t ctx_param_ext_229599, __global\n                                  unsigned char *ext_mem_229373, __global\n                                  unsigned char *mem_param_229601, __global\n                                  unsigned char *mem_229628, __global\n                                  unsigned char *mem_229634, __global\n                                  unsigned char *mem_229639)\n{\n    #define segmap_group_sizze_21049",
                   "5 (mainzisegmap_group_sizze_210389)\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_232996;\n    int32_t local_tid_232997;\n    int64_t group_sizze_233000;\n    int32_t wave_sizze_232999;\n    int32_t group_tid_232998;\n    \n    global_tid_232996 = get_global_id(0);\n    local_tid_232997 = get_local_id(0);\n    group_sizze_233000 = get_local_size(0);\n    wave_sizze_232999 = LOCKSTEP_WIDTH;\n    group_tid_232998 = get_group_id(0);\n    \n    int32_t phys_tid_210502 = global_tid_232996;\n    int64_t global_tid_233001 = sext_i32_i64(group_tid_232998) *\n            segmap_group_sizze_210495 + sext_i32_i64(local_tid_232997);\n    int64_t slice_233002 = defunc_0_f_res_203721;\n    int64_t slice_233003 = n_p_203574 * slice_233002;\n    int64_t slice_233004 = partition_sizze_203667 * slice_233003;\n    int64_t gtid_210499 = squot64(global_tid_233001, slice_233003);\n    int64_t remnant_233005 = global_tid_233001 - gtid_210499 * slice_233003;\n    int64_t gtid_210500 = squot64(remnant_233005, slice_233002);\n    int64_t remnant_233006 = remnant_233005 - gtid_210500 * slice_233002;\n    int64_t gtid_210501 = remnant_233006;\n    int64_t remnant_233007 = remnant_233006 - gtid_210501;\n    \n    if ((slt64(gtid_210499, partition_sizze_203667) && slt64(gtid_210500,\n                                                             n_p_203574)) &&\n        slt64(gtid_210501, defunc_0_f_res_203721)) {\n        int64_t x_210506;\n        \n        x_210506 = ((__global int64_t *) ext_mem_229373)[gtid_210499 *\n                                                         (defunc_0_f_res_203721 *\n                                                          n_p_203574) +\n                                                         gtid_210500 *\n                                                         defunc_0_f_res_203721 +\n                                                         gtid_210501];\n        \n ",
                   "       int64_t x_210507 = mul64(n_p_203574, x_210506);\n        int64_t idx_210508 = add64(gtid_210500, x_210507);\n        bool cond_210509 = slt64(i_203760, idx_210508);\n        bool cond_f_res_210510 = slt64(x_210506, (int64_t) 0);\n        bool x_210511 = !cond_210509;\n        bool y_210512 = cond_f_res_210510 && x_210511;\n        bool cond_210513 = cond_210509 || y_210512;\n        double defunc_0_f_res_210514;\n        double defunc_0_f_res_210515;\n        \n        if (cond_210513) {\n            defunc_0_f_res_210514 = 0.0;\n            defunc_0_f_res_210515 = 0.0;\n        } else {\n            bool x_210516 = sle64((int64_t) 0, idx_210508);\n            bool y_210517 = slt64(idx_210508, n_203572);\n            bool bounds_check_210518 = x_210516 && y_210517;\n            bool index_certs_210519;\n            \n            if (!bounds_check_210518) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 37) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) idx_210508;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_f_res_210520;\n            \n            defunc_0_f_res_f_res_210520 = ((__global\n                                            double *) mem_229628)[gtid_210499 *\n                                                                  n_203572 +\n                                                                  idx_210508];\n            \n            double defunc_0_f_res_f_res_210521;\n            \n            defunc_0_f_res_f_res_210521 = ((__global\n                                            double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                        (gtid_210499 *\n                                                                         ctx_param_ext_229597 +\n  ",
                   "                                                                       idx_210508 *\n                                                                         ctx_param_ext_229599)];\n            defunc_0_f_res_210514 = defunc_0_f_res_f_res_210520;\n            defunc_0_f_res_210515 = defunc_0_f_res_f_res_210521;\n        }\n        ((__global double *) mem_229634)[gtid_210499 * (defunc_0_f_res_203721 *\n                                                        n_p_203574) +\n                                         gtid_210500 * defunc_0_f_res_203721 +\n                                         gtid_210501] = defunc_0_f_res_210514;\n        ((__global double *) mem_229639)[gtid_210499 * (defunc_0_f_res_203721 *\n                                                        n_p_203574) +\n                                         gtid_210500 * defunc_0_f_res_203721 +\n                                         gtid_210501] = defunc_0_f_res_210515;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_210495\n}\n__kernel void mainzisegmap_210632(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t q_s_203575,\n                                  int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726,\n                                  int64_t num_groups_210628,\n                                  int64_t num_threads_232221, __global\n                                  unsigned char *mem_229648, __global\n                                  unsigned char *mem_229651, __global\n                                  unsigned char *mem_229655, __global\n                                  unsigned char *mem_229659, __global\n                                  unsigned char *mem_229663, __global\n                                  unsigned char *mem_229667, __g",
                   "lobal\n                                  unsigned char *mem_229716, __global\n                                  unsigned char *color_232097)\n{\n    #define segmap_group_sizze_210627 (mainzisegmap_group_sizze_210531)\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_233012;\n    int32_t local_tid_233013;\n    int64_t group_sizze_233016;\n    int32_t wave_sizze_233015;\n    int32_t group_tid_233014;\n    \n    global_tid_233012 = get_global_id(0);\n    local_tid_233013 = get_local_id(0);\n    group_sizze_233016 = get_local_size(0);\n    wave_sizze_233015 = LOCKSTEP_WIDTH;\n    group_tid_233014 = get_group_id(0);\n    \n    int32_t phys_tid_210632 = global_tid_233012;\n    int32_t phys_group_id_233017;\n    \n    phys_group_id_233017 = get_group_id(0);\n    for (int32_t i_233018 = 0; i_233018 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667,\n                                          segmap_group_sizze_210627)) -\n                   phys_group_id_233017, sext_i64_i32(num_groups_210628));\n         i_233018++) {\n        int32_t virt_group_id_233019 = phys_group_id_233017 + i_233018 *\n                sext_i64_i32(num_groups_210628);\n        int64_t global_tid_233020 = sext_i32_i64(virt_group_id_233019) *\n                segmap_group_sizze_210627 + sext_i32_i64(local_tid_233013);\n        int64_t slice_233021 = partition_sizze_203667;\n        int64_t gtid_210631 = global_tid_233020;\n        int64_t remnant_233022 = global_tid_233020 - gtid_210631;\n        \n        if (slt64(gtid_210631, partition_sizze_203667)) {\n            for (int64_t i_229019 = 0; i_229019 < n_p_203574; i_229019++) {\n                int64_t x_210643;\n                \n                x_210643 = ((__global int64_t *) mem_229651)[i_229019 *\n                                                             partition_sizze_203667 +\n                                                             gt",
                   "id_210631];\n                for (int64_t i_229023 = 0; i_229023 < s_n_m_203726;\n                     i_229023++) {\n                    int64_t x_210648;\n                    \n                    x_210648 = ((__global int64_t *) mem_229659)[i_229019 *\n                                                                 (partition_sizze_203667 *\n                                                                  s_n_m_203726) +\n                                                                 i_229023 *\n                                                                 partition_sizze_203667 +\n                                                                 gtid_210631];\n                    \n                    double x_210649;\n                    \n                    x_210649 = ((__global double *) mem_229648)[i_229019 *\n                                                                (partition_sizze_203667 *\n                                                                 s_n_m_203726) +\n                                                                i_229023 *\n                                                                partition_sizze_203667 +\n                                                                gtid_210631];\n                    \n                    bool cond_210650 = i_229023 == (int64_t) 0;\n                    int64_t defunc_0_m_fun_res_210651;\n                    \n                    if (cond_210650) {\n                        defunc_0_m_fun_res_210651 = (int64_t) 0;\n                    } else {\n                        int64_t y_210652 = sub64(s_n_m_203726, (int64_t) 1);\n                        bool cond_210653 = i_229023 == y_210652;\n                        int64_t defunc_0_m_fun_res_f_res_210654;\n                        \n                        if (cond_210653) {\n                            int64_t defunc_0_m_fun_res_f_res_t_res_210655 =\n                                    sub64(pad_css_len_203722, (int64_t) 1);\n                            \n               ",
                   "             defunc_0_m_fun_res_f_res_210654 =\n                                defunc_0_m_fun_res_f_res_t_res_210655;\n                        } else {\n                            int64_t x_210656 = sub64(i_229023, (int64_t) 1);\n                            int64_t x_210657 = mul64(jump_s_203581, x_210656);\n                            int64_t min_arg_210658 = add64((int64_t) 1,\n                                                           x_210657);\n                            int64_t min_res_210659 =\n                                    smin64(defunc_0_f_res_203721,\n                                           min_arg_210658);\n                            \n                            defunc_0_m_fun_res_f_res_210654 = min_res_210659;\n                        }\n                        defunc_0_m_fun_res_210651 =\n                            defunc_0_m_fun_res_f_res_210654;\n                    }\n                    \n                    double defunc_2_reduce_res_210660;\n                    double redout_228537 = 0.0;\n                    \n                    for (int64_t i_228538 = 0; i_228538 < q_s_203575;\n                         i_228538++) {\n                        bool cond_210665 = sle64(x_210643, i_228538);\n                        int64_t defunc_0_f_res_210666;\n                        \n                        if (cond_210665) {\n                            defunc_0_f_res_210666 = (int64_t) 0;\n                        } else {\n                            int64_t i_210667 = add64(x_210648, i_228538);\n                            int64_t defunc_0_add_arg_210668;\n                            \n                            defunc_0_add_arg_210668 = ((__global\n                                                        int64_t *) mem_229667)[i_229019 *\n                                                                               (partition_sizze_203667 *\n                                                                                defunc_0_f_res_203721) +\n                              ",
                   "                                                 i_210667 *\n                                                                               partition_sizze_203667 +\n                                                                               gtid_210631];\n                            \n                            int64_t defunc_1_add_res_210669 = add64((int64_t) 1,\n                                                                    defunc_0_add_arg_210668);\n                            \n                            defunc_0_f_res_210666 = defunc_1_add_res_210669;\n                        }\n                        \n                        double defunc_0_f_res_210670;\n                        \n                        if (cond_210665) {\n                            defunc_0_f_res_210670 = 0.0;\n                        } else {\n                            int64_t i_210671 = add64(x_210648, i_228538);\n                            double defunc_0_add_arg_210672;\n                            \n                            defunc_0_add_arg_210672 = ((__global\n                                                        double *) mem_229655)[i_229019 *\n                                                                              (partition_sizze_203667 *\n                                                                               defunc_0_f_res_203721) +\n                                                                              i_210671 *\n                                                                              partition_sizze_203667 +\n                                                                              gtid_210631];\n                            defunc_0_f_res_210670 = defunc_0_add_arg_210672;\n                        }\n                        \n                        int64_t binop_p_210673 = sub64(defunc_0_f_res_210666,\n                                                       defunc_0_m_fun_res_210651);\n                        double defunc_0_f_res_210674 =\n                 ",
                   "              sitofp_i64_f64(binop_p_210673);\n                        double abs_res_210675 = fabs(defunc_0_f_res_210674);\n                        double tmp1_210676 = abs_res_210675 / x_210649;\n                        double x_210677 = tmp1_210676 * tmp1_210676;\n                        double y_210678 = tmp1_210676 * x_210677;\n                        double tmp2_210679 = 1.0 - y_210678;\n                        double x_210680 = tmp2_210679 * tmp2_210679;\n                        double tmp3_210681 = tmp2_210679 * x_210680;\n                        double w_j_210682 = defunc_0_f_res_210670 * tmp3_210681;\n                        double defunc_1_op_res_210663 = w_j_210682 +\n                               redout_228537;\n                        double redout_tmp_233025 = defunc_1_op_res_210663;\n                        \n                        redout_228537 = redout_tmp_233025;\n                    }\n                    defunc_2_reduce_res_210660 = redout_228537;\n                    \n                    double a0_210683 = 1.0 / defunc_2_reduce_res_210660;\n                    int64_t defunc_0_m_fun_res_210684;\n                    \n                    if (cond_210650) {\n                        defunc_0_m_fun_res_210684 = (int64_t) 0;\n                    } else {\n                        int64_t y_210685 = sub64(s_n_m_203726, (int64_t) 1);\n                        bool cond_210686 = i_229023 == y_210685;\n                        int64_t defunc_0_m_fun_res_f_res_210687;\n                        \n                        if (cond_210686) {\n                            int64_t defunc_0_m_fun_res_f_res_t_res_210688 =\n                                    sub64(pad_css_len_203722, (int64_t) 1);\n                            \n                            defunc_0_m_fun_res_f_res_210687 =\n                                defunc_0_m_fun_res_f_res_t_res_210688;\n                        } else {\n                            int64_t x_210689 = sub64(i_229023, (int64_t) 1);\n                            ",
                   "int64_t x_210690 = mul64(jump_s_203581, x_210689);\n                            int64_t min_arg_210691 = add64((int64_t) 1,\n                                                           x_210690);\n                            int64_t min_res_210692 =\n                                    smin64(defunc_0_f_res_203721,\n                                           min_arg_210691);\n                            \n                            defunc_0_m_fun_res_f_res_210687 = min_res_210692;\n                        }\n                        defunc_0_m_fun_res_210684 =\n                            defunc_0_m_fun_res_f_res_210687;\n                    }\n                    \n                    double defunc_2_reduce_res_210693;\n                    double redout_228539 = 0.0;\n                    \n                    for (int64_t i_228540 = 0; i_228540 < q_s_203575;\n                         i_228540++) {\n                        bool cond_210698 = sle64(x_210643, i_228540);\n                        int64_t defunc_0_f_res_210699;\n                        \n                        if (cond_210698) {\n                            defunc_0_f_res_210699 = (int64_t) 0;\n                        } else {\n                            int64_t i_210700 = add64(x_210648, i_228540);\n                            int64_t defunc_0_add_arg_210701;\n                            \n                            defunc_0_add_arg_210701 = ((__global\n                                                        int64_t *) mem_229667)[i_229019 *\n                                                                               (partition_sizze_203667 *\n                                                                                defunc_0_f_res_203721) +\n                                                                               i_210700 *\n                                                                               partition_sizze_203667 +\n                                                                               gtid_210631];",
                   "\n                            \n                            int64_t defunc_1_add_res_210702 = add64((int64_t) 1,\n                                                                    defunc_0_add_arg_210701);\n                            \n                            defunc_0_f_res_210699 = defunc_1_add_res_210702;\n                        }\n                        \n                        double defunc_0_f_res_210703;\n                        \n                        if (cond_210698) {\n                            defunc_0_f_res_210703 = 0.0;\n                        } else {\n                            int64_t i_210704 = add64(x_210648, i_228540);\n                            double defunc_0_add_arg_210705;\n                            \n                            defunc_0_add_arg_210705 = ((__global\n                                                        double *) mem_229655)[i_229019 *\n                                                                              (partition_sizze_203667 *\n                                                                               defunc_0_f_res_203721) +\n                                                                              i_210704 *\n                                                                              partition_sizze_203667 +\n                                                                              gtid_210631];\n                            defunc_0_f_res_210703 = defunc_0_add_arg_210705;\n                        }\n                        \n                        int64_t binop_p_210706 = sub64(defunc_0_f_res_210699,\n                                                       defunc_0_m_fun_res_210684);\n                        double defunc_0_f_res_210707 =\n                               sitofp_i64_f64(binop_p_210706);\n                        double abs_res_210708 = fabs(defunc_0_f_res_210707);\n                        double tmp1_210709 = abs_res_210708 / x_210649;\n                        double x_210710 = tmp1_210709 * tmp1_",
                   "210709;\n                        double y_210711 = tmp1_210709 * x_210710;\n                        double tmp2_210712 = 1.0 - y_210711;\n                        double x_210713 = tmp2_210712 * tmp2_210712;\n                        double tmp3_210714 = tmp2_210712 * x_210713;\n                        double tmp4_210715 = defunc_0_f_res_210703 *\n                               tmp3_210714;\n                        double defunc_0_f_res_210716;\n                        \n                        if (cond_210698) {\n                            defunc_0_f_res_210716 = 0.0;\n                        } else {\n                            int64_t i_210717 = add64(x_210648, i_228540);\n                            double defunc_0_add_arg_210718;\n                            \n                            defunc_0_add_arg_210718 = ((__global\n                                                        double *) mem_229663)[i_229019 *\n                                                                              (partition_sizze_203667 *\n                                                                               defunc_0_f_res_203721) +\n                                                                              i_210717 *\n                                                                              partition_sizze_203667 +\n                                                                              gtid_210631];\n                            defunc_0_f_res_210716 = defunc_0_add_arg_210718;\n                        }\n                        \n                        double x_210719 = a0_210683 * tmp4_210715;\n                        double defunc_9_fit_fun_res_210720 =\n                               defunc_0_f_res_210716 * x_210719;\n                        double defunc_1_op_res_210696 =\n                               defunc_9_fit_fun_res_210720 + redout_228539;\n                        double redout_tmp_233026 = defunc_1_op_res_210696;\n                        \n                        redout_228539 = ",
                   "redout_tmp_233026;\n                    }\n                    defunc_2_reduce_res_210693 = redout_228539;\n                    ((__global double *) color_232097)[phys_tid_210632 +\n                                                       (i_229019 *\n                                                        (num_threads_232221 *\n                                                         s_n_m_203726) +\n                                                        i_229023 *\n                                                        num_threads_232221)] =\n                        defunc_2_reduce_res_210693;\n                }\n            }\n            for (int64_t i_233027 = 0; i_233027 < n_p_203574; i_233027++) {\n                for (int64_t i_233028 = 0; i_233028 < s_n_m_203726;\n                     i_233028++) {\n                    double tmp_233029;\n                    \n                    tmp_233029 = ((__global\n                                   double *) color_232097)[phys_tid_210632 +\n                                                           (i_233027 *\n                                                            (num_threads_232221 *\n                                                             s_n_m_203726) +\n                                                            i_233028 *\n                                                            num_threads_232221)];\n                    ((__global double *) mem_229716)[gtid_210631 + (i_233027 *\n                                                                    (partition_sizze_203667 *\n                                                                     s_n_m_203726) +\n                                                                    i_233028 *\n                                                                    partition_sizze_203667)] =\n                        tmp_233029;\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_si",
                   "zze_210627\n}\n__kernel void mainzisegmap_211772(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t q_s_203575,\n                                  int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726,\n                                  int64_t num_groups_211752,\n                                  int64_t num_threads_232223, __global\n                                  unsigned char *ext_mem_229372, __global\n                                  unsigned char *mem_229720, __global\n                                  unsigned char *mem_229724, __global\n                                  unsigned char *mem_229728, __global\n                                  unsigned char *mem_229732, __global\n                                  unsigned char *mem_229736, __global\n                                  unsigned char *mem_229756, __global\n                                  unsigned char *color_232098)\n{\n    #define segmap_group_sizze_211751 (mainzisegmap_group_sizze_210726)\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_233030;\n    int32_t local_tid_233031;\n    int64_t group_sizze_233034;\n    int32_t wave_sizze_233033;\n    int32_t group_tid_233032;\n    \n    global_tid_233030 = get_global_id(0);\n    local_tid_233031 = get_local_id(0);\n    group_sizze_233034 = get_local_size(0);\n    wave_sizze_233033 = LOCKSTEP_WIDTH;\n    group_tid_233032 = get_group_id(0);\n    \n    int32_t phys_tid_211772 = global_tid_233030;\n    int32_t phys_group_id_233035;\n    \n    phys_group_id_233035 = get_group_id(0);\n    for (int32_t i_233036 = 0; i_233036 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * n_p_203574,\n      ",
                   "                                    segmap_group_sizze_211751)) -\n                   phys_group_id_233035, sext_i64_i32(num_groups_211752));\n         i_233036++) {\n        int32_t virt_group_id_233037 = phys_group_id_233035 + i_233036 *\n                sext_i64_i32(num_groups_211752);\n        int64_t global_tid_233038 = sext_i32_i64(virt_group_id_233037) *\n                segmap_group_sizze_211751 + sext_i32_i64(local_tid_233031);\n        int64_t slice_233039 = n_p_203574;\n        int64_t slice_233040 = partition_sizze_203667 * slice_233039;\n        int64_t gtid_211770 = squot64(global_tid_233038, slice_233039);\n        int64_t remnant_233041 = global_tid_233038 - gtid_211770 * slice_233039;\n        int64_t gtid_211771 = remnant_233041;\n        int64_t remnant_233042 = remnant_233041 - gtid_211771;\n        \n        if (slt64(gtid_211770, partition_sizze_203667) && slt64(gtid_211771,\n                                                                n_p_203574)) {\n            int64_t x_211776;\n            \n            x_211776 = ((__global int64_t *) ext_mem_229372)[gtid_211770 *\n                                                             n_p_203574 +\n                                                             gtid_211771];\n            for (int64_t i_229027 = 0; i_229027 < s_n_m_203726; i_229027++) {\n                int64_t x_211781;\n                \n                x_211781 = ((__global int64_t *) mem_229720)[i_229027 *\n                                                             (n_p_203574 *\n                                                              partition_sizze_203667) +\n                                                             gtid_211770 *\n                                                             n_p_203574 +\n                                                             gtid_211771];\n                \n                double x_211782;\n                \n                x_211782 = ((__global double *) mem_229724)[i_229027 *\n                                ",
                   "                            (n_p_203574 *\n                                                             partition_sizze_203667) +\n                                                            gtid_211770 *\n                                                            n_p_203574 +\n                                                            gtid_211771];\n                \n                bool cond_211783 = i_229027 == (int64_t) 0;\n                int64_t defunc_0_m_fun_res_211784;\n                \n                if (cond_211783) {\n                    defunc_0_m_fun_res_211784 = (int64_t) 0;\n                } else {\n                    int64_t y_211785 = sub64(s_n_m_203726, (int64_t) 1);\n                    bool cond_211786 = i_229027 == y_211785;\n                    int64_t defunc_0_m_fun_res_f_res_211787;\n                    \n                    if (cond_211786) {\n                        int64_t defunc_0_m_fun_res_f_res_t_res_211788 =\n                                sub64(pad_css_len_203722, (int64_t) 1);\n                        \n                        defunc_0_m_fun_res_f_res_211787 =\n                            defunc_0_m_fun_res_f_res_t_res_211788;\n                    } else {\n                        int64_t x_211789 = sub64(i_229027, (int64_t) 1);\n                        int64_t x_211790 = mul64(jump_s_203581, x_211789);\n                        int64_t min_arg_211791 = add64((int64_t) 1, x_211790);\n                        int64_t min_res_211792 = smin64(defunc_0_f_res_203721,\n                                                        min_arg_211791);\n                        \n                        defunc_0_m_fun_res_f_res_211787 = min_res_211792;\n                    }\n                    defunc_0_m_fun_res_211784 = defunc_0_m_fun_res_f_res_211787;\n                }\n                \n                double defunc_2_reduce_res_211793;\n                double redout_228545 = 0.0;\n                \n                for (int64_t i_228546 = 0; i_228546 < q_s_203575; i_228546++) ",
                   "{\n                    bool cond_211798 = sle64(x_211776, i_228546);\n                    int64_t defunc_0_f_res_211799;\n                    \n                    if (cond_211798) {\n                        defunc_0_f_res_211799 = (int64_t) 0;\n                    } else {\n                        int64_t i_211800 = add64(x_211781, i_228546);\n                        int64_t defunc_0_add_arg_211801;\n                        \n                        defunc_0_add_arg_211801 = ((__global\n                                                    int64_t *) mem_229728)[i_211800 *\n                                                                           (n_p_203574 *\n                                                                            partition_sizze_203667) +\n                                                                           gtid_211770 *\n                                                                           n_p_203574 +\n                                                                           gtid_211771];\n                        \n                        int64_t defunc_1_add_res_211802 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_211801);\n                        \n                        defunc_0_f_res_211799 = defunc_1_add_res_211802;\n                    }\n                    \n                    double defunc_0_f_res_211803;\n                    \n                    if (cond_211798) {\n                        defunc_0_f_res_211803 = 0.0;\n                    } else {\n                        int64_t i_211804 = add64(x_211781, i_228546);\n                        double defunc_0_add_arg_211805;\n                        \n                        defunc_0_add_arg_211805 = ((__global\n                                                    double *) mem_229732)[i_211804 *\n                                                                          (n_p_203574 *\n                                                                 ",
                   "          partition_sizze_203667) +\n                                                                          gtid_211770 *\n                                                                          n_p_203574 +\n                                                                          gtid_211771];\n                        defunc_0_f_res_211803 = defunc_0_add_arg_211805;\n                    }\n                    \n                    int64_t binop_p_211806 = sub64(defunc_0_f_res_211799,\n                                                   defunc_0_m_fun_res_211784);\n                    double defunc_0_f_res_211807 =\n                           sitofp_i64_f64(binop_p_211806);\n                    double abs_res_211808 = fabs(defunc_0_f_res_211807);\n                    double tmp1_211809 = abs_res_211808 / x_211782;\n                    double x_211810 = tmp1_211809 * tmp1_211809;\n                    double y_211811 = tmp1_211809 * x_211810;\n                    double tmp2_211812 = 1.0 - y_211811;\n                    double x_211813 = tmp2_211812 * tmp2_211812;\n                    double tmp3_211814 = tmp2_211812 * x_211813;\n                    double w_j_211815 = defunc_0_f_res_211803 * tmp3_211814;\n                    double defunc_1_op_res_211796 = w_j_211815 + redout_228545;\n                    double redout_tmp_233044 = defunc_1_op_res_211796;\n                    \n                    redout_228545 = redout_tmp_233044;\n                }\n                defunc_2_reduce_res_211793 = redout_228545;\n                \n                double a0_211816 = 1.0 / defunc_2_reduce_res_211793;\n                int64_t defunc_0_m_fun_res_211817;\n                \n                if (cond_211783) {\n                    defunc_0_m_fun_res_211817 = (int64_t) 0;\n                } else {\n                    int64_t y_211818 = sub64(s_n_m_203726, (int64_t) 1);\n                    bool cond_211819 = i_229027 == y_211818;\n                    int64_t defunc_0_m_fun_res_f_res_211820;\n               ",
                   "     \n                    if (cond_211819) {\n                        int64_t defunc_0_m_fun_res_f_res_t_res_211821 =\n                                sub64(pad_css_len_203722, (int64_t) 1);\n                        \n                        defunc_0_m_fun_res_f_res_211820 =\n                            defunc_0_m_fun_res_f_res_t_res_211821;\n                    } else {\n                        int64_t x_211822 = sub64(i_229027, (int64_t) 1);\n                        int64_t x_211823 = mul64(jump_s_203581, x_211822);\n                        int64_t min_arg_211824 = add64((int64_t) 1, x_211823);\n                        int64_t min_res_211825 = smin64(defunc_0_f_res_203721,\n                                                        min_arg_211824);\n                        \n                        defunc_0_m_fun_res_f_res_211820 = min_res_211825;\n                    }\n                    defunc_0_m_fun_res_211817 = defunc_0_m_fun_res_f_res_211820;\n                }\n                \n                double defunc_2_reduce_res_211826;\n                double redout_228547 = 0.0;\n                \n                for (int64_t i_228548 = 0; i_228548 < q_s_203575; i_228548++) {\n                    bool cond_211831 = sle64(x_211776, i_228548);\n                    int64_t defunc_0_f_res_211832;\n                    \n                    if (cond_211831) {\n                        defunc_0_f_res_211832 = (int64_t) 0;\n                    } else {\n                        int64_t i_211833 = add64(x_211781, i_228548);\n                        int64_t defunc_0_add_arg_211834;\n                        \n                        defunc_0_add_arg_211834 = ((__global\n                                                    int64_t *) mem_229728)[i_211833 *\n                                                                           (n_p_203574 *\n                                                                            partition_sizze_203667) +\n                                                                   ",
                   "        gtid_211770 *\n                                                                           n_p_203574 +\n                                                                           gtid_211771];\n                        \n                        int64_t defunc_1_add_res_211835 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_211834);\n                        \n                        defunc_0_f_res_211832 = defunc_1_add_res_211835;\n                    }\n                    \n                    double defunc_0_f_res_211836;\n                    \n                    if (cond_211831) {\n                        defunc_0_f_res_211836 = 0.0;\n                    } else {\n                        int64_t i_211837 = add64(x_211781, i_228548);\n                        double defunc_0_add_arg_211838;\n                        \n                        defunc_0_add_arg_211838 = ((__global\n                                                    double *) mem_229732)[i_211837 *\n                                                                          (n_p_203574 *\n                                                                           partition_sizze_203667) +\n                                                                          gtid_211770 *\n                                                                          n_p_203574 +\n                                                                          gtid_211771];\n                        defunc_0_f_res_211836 = defunc_0_add_arg_211838;\n                    }\n                    \n                    int64_t binop_p_211839 = sub64(defunc_0_f_res_211832,\n                                                   defunc_0_m_fun_res_211817);\n                    double defunc_0_f_res_211840 =\n                           sitofp_i64_f64(binop_p_211839);\n                    double abs_res_211841 = fabs(defunc_0_f_res_211840);\n                    double tmp1_211842 = abs_res_211841 / x_211782;\n       ",
                   "             double x_211843 = tmp1_211842 * tmp1_211842;\n                    double y_211844 = tmp1_211842 * x_211843;\n                    double tmp2_211845 = 1.0 - y_211844;\n                    double x_211846 = tmp2_211845 * tmp2_211845;\n                    double tmp3_211847 = tmp2_211845 * x_211846;\n                    double tmp4_211848 = defunc_0_f_res_211836 * tmp3_211847;\n                    double defunc_0_f_res_211849;\n                    \n                    if (cond_211831) {\n                        defunc_0_f_res_211849 = 0.0;\n                    } else {\n                        int64_t i_211850 = add64(x_211781, i_228548);\n                        double defunc_0_add_arg_211851;\n                        \n                        defunc_0_add_arg_211851 = ((__global\n                                                    double *) mem_229736)[i_211850 *\n                                                                          (n_p_203574 *\n                                                                           partition_sizze_203667) +\n                                                                          gtid_211770 *\n                                                                          n_p_203574 +\n                                                                          gtid_211771];\n                        defunc_0_f_res_211849 = defunc_0_add_arg_211851;\n                    }\n                    \n                    double x_211852 = a0_211816 * tmp4_211848;\n                    double defunc_9_fit_fun_res_211853 = defunc_0_f_res_211849 *\n                           x_211852;\n                    double defunc_1_op_res_211829 =\n                           defunc_9_fit_fun_res_211853 + redout_228547;\n                    double redout_tmp_233045 = defunc_1_op_res_211829;\n                    \n                    redout_228547 = redout_tmp_233045;\n                }\n                defunc_2_reduce_res_211826 = redout_228547;\n                ((__global d",
                   "ouble *) color_232098)[phys_tid_211772 + i_229027 *\n                                                   num_threads_232223] =\n                    defunc_2_reduce_res_211826;\n            }\n            for (int64_t i_233046 = 0; i_233046 < s_n_m_203726; i_233046++) {\n                double tmp_233047;\n                \n                tmp_233047 = ((__global\n                               double *) color_232098)[phys_tid_211772 +\n                                                       i_233046 *\n                                                       num_threads_232223];\n                ((__global double *) mem_229756)[gtid_211770 * n_p_203574 +\n                                                 gtid_211771 + i_233046 *\n                                                 (n_p_203574 *\n                                                  partition_sizze_203667)] =\n                    tmp_233047;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_211751\n}\n__kernel void mainzisegmap_211980(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t q_s_203575,\n                                  int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726, __global\n                                  unsigned char *ext_mem_229372, __global\n                                  unsigned char *ext_mem_229373, __global\n                                  unsigned char *ext_mem_229470, __global\n                                  unsigned char *ext_mem_229471, __global\n                                  unsigned char *mem_229634, __global\n                                  unsigned char *mem_229639, __global\n                                  unsigned char *mem_229789",
                   ")\n{\n    #define segmap_group_sizze_211969 (mainzisegmap_group_sizze_211061)\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_233104;\n    int32_t local_tid_233105;\n    int64_t group_sizze_233108;\n    int32_t wave_sizze_233107;\n    int32_t group_tid_233106;\n    \n    global_tid_233104 = get_global_id(0);\n    local_tid_233105 = get_local_id(0);\n    group_sizze_233108 = get_local_size(0);\n    wave_sizze_233107 = LOCKSTEP_WIDTH;\n    group_tid_233106 = get_group_id(0);\n    \n    int32_t phys_tid_211980 = global_tid_233104;\n    int64_t global_tid_233109 = sext_i32_i64(group_tid_233106) *\n            segmap_group_sizze_211969 + sext_i32_i64(local_tid_233105);\n    int64_t slice_233110 = s_n_m_203726;\n    int64_t slice_233111 = n_p_203574 * slice_233110;\n    int64_t slice_233112 = partition_sizze_203667 * slice_233111;\n    int64_t gtid_211977 = squot64(global_tid_233109, slice_233111);\n    int64_t remnant_233113 = global_tid_233109 - gtid_211977 * slice_233111;\n    int64_t gtid_211978 = squot64(remnant_233113, slice_233110);\n    int64_t remnant_233114 = remnant_233113 - gtid_211978 * slice_233110;\n    int64_t gtid_211979 = remnant_233114;\n    int64_t remnant_233115 = remnant_233114 - gtid_211979;\n    \n    if ((slt64(gtid_211977, partition_sizze_203667) && slt64(gtid_211978,\n                                                             n_p_203574)) &&\n        slt64(gtid_211979, s_n_m_203726)) {\n        int64_t x_211984;\n        \n        x_211984 = ((__global int64_t *) ext_mem_229372)[gtid_211977 *\n                                                         n_p_203574 +\n                                                         gtid_211978];\n        \n        int64_t x_211986;\n        \n        x_211986 = ((__global int64_t *) ext_mem_229471)[gtid_211977 *\n                                                         (s_n_m_203726 *\n                                    ",
                   "                      n_p_203574) +\n                                                         gtid_211978 *\n                                                         s_n_m_203726 +\n                                                         gtid_211979];\n        \n        double x_211987;\n        \n        x_211987 = ((__global double *) ext_mem_229470)[gtid_211977 *\n                                                        (s_n_m_203726 *\n                                                         n_p_203574) +\n                                                        gtid_211978 *\n                                                        s_n_m_203726 +\n                                                        gtid_211979];\n        \n        bool cond_211988 = gtid_211979 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_211989;\n        \n        if (cond_211988) {\n            defunc_0_m_fun_res_211989 = (int64_t) 0;\n        } else {\n            int64_t y_211990 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_211991 = gtid_211979 == y_211990;\n            int64_t defunc_0_m_fun_res_f_res_211992;\n            \n            if (cond_211991) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_211993 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_211992 =\n                    defunc_0_m_fun_res_f_res_t_res_211993;\n            } else {\n                int64_t x_211994 = sub64(gtid_211979, (int64_t) 1);\n                int64_t x_211995 = mul64(jump_s_203581, x_211994);\n                int64_t min_arg_211996 = add64((int64_t) 1, x_211995);\n                int64_t min_res_211997 = smin64(defunc_0_f_res_203721,\n                                                min_arg_211996);\n                \n                defunc_0_m_fun_res_f_res_211992 = min_res_211997;\n            }\n            defunc_0_m_fun_res_211989 = defunc_0_m_fun_res_f_res_211992;\n        }\n        \n        double defunc_2_reduce_res_211998;\n   ",
                   "     double redout_228561 = 0.0;\n        \n        for (int64_t i_228562 = 0; i_228562 < q_s_203575; i_228562++) {\n            bool cond_212003 = sle64(x_211984, i_228562);\n            int64_t defunc_0_f_res_212004;\n            \n            if (cond_212003) {\n                defunc_0_f_res_212004 = (int64_t) 0;\n            } else {\n                int64_t i_212005 = add64(x_211986, i_228562);\n                int64_t defunc_0_add_arg_212006;\n                \n                defunc_0_add_arg_212006 = ((__global\n                                            int64_t *) ext_mem_229373)[gtid_211977 *\n                                                                       (defunc_0_f_res_203721 *\n                                                                        n_p_203574) +\n                                                                       gtid_211978 *\n                                                                       defunc_0_f_res_203721 +\n                                                                       i_212005];\n                \n                int64_t defunc_1_add_res_212007 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_212006);\n                \n                defunc_0_f_res_212004 = defunc_1_add_res_212007;\n            }\n            \n            double defunc_0_f_res_212008;\n            \n            if (cond_212003) {\n                defunc_0_f_res_212008 = 0.0;\n            } else {\n                int64_t i_212009 = add64(x_211986, i_228562);\n                double defunc_0_add_arg_212010;\n                \n                defunc_0_add_arg_212010 = ((__global\n                                            double *) mem_229639)[gtid_211977 *\n                                                                  (defunc_0_f_res_203721 *\n                                                                   n_p_203574) +\n                                                                  gtid_211978 *\n                ",
                   "                                                  defunc_0_f_res_203721 +\n                                                                  i_212009];\n                defunc_0_f_res_212008 = defunc_0_add_arg_212010;\n            }\n            \n            int64_t binop_p_212011 = sub64(defunc_0_f_res_212004,\n                                           defunc_0_m_fun_res_211989);\n            double defunc_0_f_res_212012 = sitofp_i64_f64(binop_p_212011);\n            double abs_res_212013 = fabs(defunc_0_f_res_212012);\n            double tmp1_212014 = abs_res_212013 / x_211987;\n            double x_212015 = tmp1_212014 * tmp1_212014;\n            double y_212016 = tmp1_212014 * x_212015;\n            double tmp2_212017 = 1.0 - y_212016;\n            double x_212018 = tmp2_212017 * tmp2_212017;\n            double tmp3_212019 = tmp2_212017 * x_212018;\n            double w_j_212020 = defunc_0_f_res_212008 * tmp3_212019;\n            double defunc_1_op_res_212001 = w_j_212020 + redout_228561;\n            double redout_tmp_233116 = defunc_1_op_res_212001;\n            \n            redout_228561 = redout_tmp_233116;\n        }\n        defunc_2_reduce_res_211998 = redout_228561;\n        \n        double a0_212021 = 1.0 / defunc_2_reduce_res_211998;\n        int64_t defunc_0_m_fun_res_212022;\n        \n        if (cond_211988) {\n            defunc_0_m_fun_res_212022 = (int64_t) 0;\n        } else {\n            int64_t y_212023 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_212024 = gtid_211979 == y_212023;\n            int64_t defunc_0_m_fun_res_f_res_212025;\n            \n            if (cond_212024) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_212026 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_212025 =\n                    defunc_0_m_fun_res_f_res_t_res_212026;\n            } else {\n                int64_t x_212027 = sub64(gtid_211979, (int64_t) 1);\n                int64_t x_212028 = mul64",
                   "(jump_s_203581, x_212027);\n                int64_t min_arg_212029 = add64((int64_t) 1, x_212028);\n                int64_t min_res_212030 = smin64(defunc_0_f_res_203721,\n                                                min_arg_212029);\n                \n                defunc_0_m_fun_res_f_res_212025 = min_res_212030;\n            }\n            defunc_0_m_fun_res_212022 = defunc_0_m_fun_res_f_res_212025;\n        }\n        \n        double defunc_2_reduce_res_212031;\n        double redout_228563 = 0.0;\n        \n        for (int64_t i_228564 = 0; i_228564 < q_s_203575; i_228564++) {\n            bool cond_212036 = sle64(x_211984, i_228564);\n            int64_t defunc_0_f_res_212037;\n            \n            if (cond_212036) {\n                defunc_0_f_res_212037 = (int64_t) 0;\n            } else {\n                int64_t i_212038 = add64(x_211986, i_228564);\n                int64_t defunc_0_add_arg_212039;\n                \n                defunc_0_add_arg_212039 = ((__global\n                                            int64_t *) ext_mem_229373)[gtid_211977 *\n                                                                       (defunc_0_f_res_203721 *\n                                                                        n_p_203574) +\n                                                                       gtid_211978 *\n                                                                       defunc_0_f_res_203721 +\n                                                                       i_212038];\n                \n                int64_t defunc_1_add_res_212040 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_212039);\n                \n                defunc_0_f_res_212037 = defunc_1_add_res_212040;\n            }\n            \n            double defunc_0_f_res_212041;\n            \n            if (cond_212036) {\n                defunc_0_f_res_212041 = 0.0;\n            } else {\n                int64_t i_212042 = add64(x_211986, i_228564",
                   ");\n                double defunc_0_add_arg_212043;\n                \n                defunc_0_add_arg_212043 = ((__global\n                                            double *) mem_229639)[gtid_211977 *\n                                                                  (defunc_0_f_res_203721 *\n                                                                   n_p_203574) +\n                                                                  gtid_211978 *\n                                                                  defunc_0_f_res_203721 +\n                                                                  i_212042];\n                defunc_0_f_res_212041 = defunc_0_add_arg_212043;\n            }\n            \n            int64_t binop_p_212044 = sub64(defunc_0_f_res_212037,\n                                           defunc_0_m_fun_res_212022);\n            double defunc_0_f_res_212045 = sitofp_i64_f64(binop_p_212044);\n            double abs_res_212046 = fabs(defunc_0_f_res_212045);\n            double tmp1_212047 = abs_res_212046 / x_211987;\n            double x_212048 = tmp1_212047 * tmp1_212047;\n            double y_212049 = tmp1_212047 * x_212048;\n            double tmp2_212050 = 1.0 - y_212049;\n            double x_212051 = tmp2_212050 * tmp2_212050;\n            double tmp3_212052 = tmp2_212050 * x_212051;\n            double tmp4_212053 = defunc_0_f_res_212041 * tmp3_212052;\n            double defunc_0_f_res_212054;\n            \n            if (cond_212036) {\n                defunc_0_f_res_212054 = 0.0;\n            } else {\n                int64_t i_212055 = add64(x_211986, i_228564);\n                double defunc_0_add_arg_212056;\n                \n                defunc_0_add_arg_212056 = ((__global\n                                            double *) mem_229634)[gtid_211977 *\n                                                                  (defunc_0_f_res_203721 *\n                                                                   n_p_203574) +\n                       ",
                   "                                           gtid_211978 *\n                                                                  defunc_0_f_res_203721 +\n                                                                  i_212055];\n                defunc_0_f_res_212054 = defunc_0_add_arg_212056;\n            }\n            \n            double x_212057 = a0_212021 * tmp4_212053;\n            double defunc_9_fit_fun_res_212058 = defunc_0_f_res_212054 *\n                   x_212057;\n            double defunc_1_op_res_212034 = defunc_9_fit_fun_res_212058 +\n                   redout_228563;\n            double redout_tmp_233117 = defunc_1_op_res_212034;\n            \n            redout_228563 = redout_tmp_233117;\n        }\n        defunc_2_reduce_res_212031 = redout_228563;\n        ((__global double *) mem_229789)[gtid_211977 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_211978 * s_n_m_203726 +\n                                         gtid_211979] =\n            defunc_2_reduce_res_212031;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_211969\n}\n__kernel void mainzisegmap_212069(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726, __global\n                                  unsigned char *mem_229795, __global\n                                  unsigned char *mem_229799)\n{\n    #define segmap_group_sizze_212062 (mainzisegmap_group_sizze_211322)\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_233118;\n    int32_t local_tid_233119;\n    int64_t group_sizze_233122;\n    in",
                   "t32_t wave_sizze_233121;\n    int32_t group_tid_233120;\n    \n    global_tid_233118 = get_global_id(0);\n    local_tid_233119 = get_local_id(0);\n    group_sizze_233122 = get_local_size(0);\n    wave_sizze_233121 = LOCKSTEP_WIDTH;\n    group_tid_233120 = get_group_id(0);\n    \n    int32_t phys_tid_212069 = global_tid_233118;\n    int64_t global_tid_233123 = sext_i32_i64(group_tid_233120) *\n            segmap_group_sizze_212062 + sext_i32_i64(local_tid_233119);\n    int64_t slice_233124 = s_n_m_203726;\n    int64_t slice_233125 = n_p_203574 * slice_233124;\n    int64_t slice_233126 = partition_sizze_203667 * slice_233125;\n    int64_t gtid_212066 = squot64(global_tid_233123, slice_233125);\n    int64_t remnant_233127 = global_tid_233123 - gtid_212066 * slice_233125;\n    int64_t gtid_212067 = squot64(remnant_233127, slice_233124);\n    int64_t remnant_233128 = remnant_233127 - gtid_212067 * slice_233124;\n    int64_t gtid_212068 = remnant_233128;\n    int64_t remnant_233129 = remnant_233128 - gtid_212068;\n    \n    if ((slt64(gtid_212066, partition_sizze_203667) && slt64(gtid_212067,\n                                                             n_p_203574)) &&\n        slt64(gtid_212068, s_n_m_203726)) {\n        bool cond_212071 = gtid_212068 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_212072;\n        \n        if (cond_212071) {\n            defunc_0_m_fun_res_212072 = (int64_t) 0;\n        } else {\n            int64_t y_212073 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_212074 = gtid_212068 == y_212073;\n            int64_t defunc_0_m_fun_res_f_res_212075;\n            \n            if (cond_212074) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_212076 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_212075 =\n                    defunc_0_m_fun_res_f_res_t_res_212076;\n            } else {\n                int64_t x_212077 = sub64(gtid_212068, (int64_t) 1);\n                int64_t x_212078",
                   " = mul64(jump_s_203581, x_212077);\n                int64_t min_arg_212079 = add64((int64_t) 1, x_212078);\n                int64_t min_res_212080 = smin64(defunc_0_f_res_203721,\n                                                min_arg_212079);\n                \n                defunc_0_m_fun_res_f_res_212075 = min_res_212080;\n            }\n            defunc_0_m_fun_res_212072 = defunc_0_m_fun_res_f_res_212075;\n        }\n        ((__global int64_t *) mem_229795)[gtid_212066 * (s_n_m_203726 *\n                                                         n_p_203574) +\n                                          gtid_212067 * s_n_m_203726 +\n                                          gtid_212068] =\n            defunc_0_m_fun_res_212072;\n        ((__global bool *) mem_229799)[gtid_212066 * (s_n_m_203726 *\n                                                      n_p_203574) +\n                                       gtid_212067 * s_n_m_203726 +\n                                       gtid_212068] = cond_212071;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_212062\n}\n__kernel void mainzisegmap_212141(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726, __global\n                                  unsigned char *mem_229805, __global\n                                  unsigned char *mem_229811, __global\n                                  unsigned char *mem_229816)\n{\n    #define segmap_group_sizze_212134 (mainzisegmap_group_sizze_211236)\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_233206;\n    int32_t local_tid_233207;\n    int64_t group_sizze_233210;\n    i",
                   "nt32_t wave_sizze_233209;\n    int32_t group_tid_233208;\n    \n    global_tid_233206 = get_global_id(0);\n    local_tid_233207 = get_local_id(0);\n    group_sizze_233210 = get_local_size(0);\n    wave_sizze_233209 = LOCKSTEP_WIDTH;\n    group_tid_233208 = get_group_id(0);\n    \n    int32_t phys_tid_212141 = global_tid_233206;\n    int64_t global_tid_233211 = sext_i32_i64(group_tid_233208) *\n            segmap_group_sizze_212134 + sext_i32_i64(local_tid_233207);\n    int64_t slice_233212 = s_n_m_203726;\n    int64_t slice_233213 = n_p_203574 * slice_233212;\n    int64_t slice_233214 = partition_sizze_203667 * slice_233213;\n    int64_t gtid_212138 = squot64(global_tid_233211, slice_233213);\n    int64_t remnant_233215 = global_tid_233211 - gtid_212138 * slice_233213;\n    int64_t gtid_212139 = squot64(remnant_233215, slice_233212);\n    int64_t remnant_233216 = remnant_233215 - gtid_212139 * slice_233212;\n    int64_t gtid_212140 = remnant_233216;\n    int64_t remnant_233217 = remnant_233216 - gtid_212140;\n    \n    if ((slt64(gtid_212138, partition_sizze_203667) && slt64(gtid_212139,\n                                                             n_p_203574)) &&\n        slt64(gtid_212140, s_n_m_203726)) {\n        bool index_primexp_228808 = gtid_212140 == (int64_t) 0;\n        double defunc_2_reduce_res_212144;\n        \n        defunc_2_reduce_res_212144 = ((__global\n                                       double *) mem_229805)[gtid_212138 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_212139 *\n                                                             s_n_m_203726 +\n                                                             gtid_212140];\n        \n        double a0_212145 = 1.0 / defunc_2_reduce_res_212144;\n        int64_t defunc_0_m_fun_res_212146;\n        \n        if (index_primexp_228808) {\n            defunc_0",
                   "_m_fun_res_212146 = (int64_t) 0;\n        } else {\n            int64_t y_212147 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_212148 = gtid_212140 == y_212147;\n            int64_t defunc_0_m_fun_res_f_res_212149;\n            \n            if (cond_212148) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_212150 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_212149 =\n                    defunc_0_m_fun_res_f_res_t_res_212150;\n            } else {\n                int64_t x_212151 = sub64(gtid_212140, (int64_t) 1);\n                int64_t x_212152 = mul64(jump_s_203581, x_212151);\n                int64_t min_arg_212153 = add64((int64_t) 1, x_212152);\n                int64_t min_res_212154 = smin64(defunc_0_f_res_203721,\n                                                min_arg_212153);\n                \n                defunc_0_m_fun_res_f_res_212149 = min_res_212154;\n            }\n            defunc_0_m_fun_res_212146 = defunc_0_m_fun_res_f_res_212149;\n        }\n        ((__global double *) mem_229811)[gtid_212138 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_212139 * s_n_m_203726 +\n                                         gtid_212140] = a0_212145;\n        ((__global int64_t *) mem_229816)[gtid_212138 * (s_n_m_203726 *\n                                                         n_p_203574) +\n                                          gtid_212139 * s_n_m_203726 +\n                                          gtid_212140] =\n            defunc_0_m_fun_res_212146;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_212134\n}\n__kernel void mainzisegmap_212355(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t q_s_203575,\n                                  int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n             ",
                   "                     int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726,\n                                  int64_t num_groups_212350,\n                                  int64_t num_threads_232231, __global\n                                  unsigned char *mem_229842, __global\n                                  unsigned char *mem_229845, __global\n                                  unsigned char *mem_229849, __global\n                                  unsigned char *mem_229853, __global\n                                  unsigned char *mem_229857, __global\n                                  unsigned char *mem_229861, __global\n                                  unsigned char *mem_229954, __global\n                                  unsigned char *mem_229958, __global\n                                  unsigned char *color_232103, __global\n                                  unsigned char *color_232104)\n{\n    #define segmap_group_sizze_212349 (mainzisegmap_group_sizze_212223)\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_233302;\n    int32_t local_tid_233303;\n    int64_t group_sizze_233306;\n    int32_t wave_sizze_233305;\n    int32_t group_tid_233304;\n    \n    global_tid_233302 = get_global_id(0);\n    local_tid_233303 = get_local_id(0);\n    group_sizze_233306 = get_local_size(0);\n    wave_sizze_233305 = LOCKSTEP_WIDTH;\n    group_tid_233304 = get_group_id(0);\n    \n    int32_t phys_tid_212355 = global_tid_233302;\n    int32_t phys_group_id_233307;\n    \n    phys_group_id_233307 = get_group_id(0);\n    for (int32_t i_233308 = 0; i_233308 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667,\n                                          segmap_group_sizze_212349)) -\n                   phys_group_id_233307, sext_i64_i32(num_groups_212350));\n         i_233308++) ",
                   "{\n        int32_t virt_group_id_233309 = phys_group_id_233307 + i_233308 *\n                sext_i64_i32(num_groups_212350);\n        int64_t global_tid_233310 = sext_i32_i64(virt_group_id_233309) *\n                segmap_group_sizze_212349 + sext_i32_i64(local_tid_233303);\n        int64_t slice_233311 = partition_sizze_203667;\n        int64_t gtid_212354 = global_tid_233310;\n        int64_t remnant_233312 = global_tid_233310 - gtid_212354;\n        \n        if (slt64(gtid_212354, partition_sizze_203667)) {\n            for (int64_t i_229033 = 0; i_229033 < n_p_203574; i_229033++) {\n                int64_t x_212367;\n                \n                x_212367 = ((__global int64_t *) mem_229845)[i_229033 *\n                                                             partition_sizze_203667 +\n                                                             gtid_212354];\n                for (int64_t i_229040 = 0; i_229040 < s_n_m_203726;\n                     i_229040++) {\n                    int64_t x_212373;\n                    \n                    x_212373 = ((__global int64_t *) mem_229853)[i_229033 *\n                                                                 (partition_sizze_203667 *\n                                                                  s_n_m_203726) +\n                                                                 i_229040 *\n                                                                 partition_sizze_203667 +\n                                                                 gtid_212354];\n                    \n                    double x_212374;\n                    \n                    x_212374 = ((__global double *) mem_229842)[i_229033 *\n                                                                (partition_sizze_203667 *\n                                                                 s_n_m_203726) +\n                                                                i_229040 *\n                                                                partition_",
                   "sizze_203667 +\n                                                                gtid_212354];\n                    \n                    bool cond_212375 = i_229040 == (int64_t) 0;\n                    int64_t defunc_0_m_fun_res_212376;\n                    \n                    if (cond_212375) {\n                        defunc_0_m_fun_res_212376 = (int64_t) 0;\n                    } else {\n                        int64_t y_212377 = sub64(s_n_m_203726, (int64_t) 1);\n                        bool cond_212378 = i_229040 == y_212377;\n                        int64_t defunc_0_m_fun_res_f_res_212379;\n                        \n                        if (cond_212378) {\n                            int64_t defunc_0_m_fun_res_f_res_t_res_212380 =\n                                    sub64(pad_css_len_203722, (int64_t) 1);\n                            \n                            defunc_0_m_fun_res_f_res_212379 =\n                                defunc_0_m_fun_res_f_res_t_res_212380;\n                        } else {\n                            int64_t x_212381 = sub64(i_229040, (int64_t) 1);\n                            int64_t x_212382 = mul64(jump_s_203581, x_212381);\n                            int64_t min_arg_212383 = add64((int64_t) 1,\n                                                           x_212382);\n                            int64_t min_res_212384 =\n                                    smin64(defunc_0_f_res_203721,\n                                           min_arg_212383);\n                            \n                            defunc_0_m_fun_res_f_res_212379 = min_res_212384;\n                        }\n                        defunc_0_m_fun_res_212376 =\n                            defunc_0_m_fun_res_f_res_212379;\n                    }\n                    \n                    double defunc_2_reduce_res_212385;\n                    double defunc_2_reduce_res_212386;\n                    double defunc_2_reduce_res_212387;\n                    double redout_228579;\n                  ",
                   "  double redout_228580;\n                    double redout_228581;\n                    \n                    redout_228579 = 0.0;\n                    redout_228580 = 0.0;\n                    redout_228581 = 0.0;\n                    for (int64_t i_228582 = 0; i_228582 < q_s_203575;\n                         i_228582++) {\n                        bool cond_212398 = sle64(x_212367, i_228582);\n                        int64_t defunc_0_f_res_212399;\n                        \n                        if (cond_212398) {\n                            defunc_0_f_res_212399 = (int64_t) 0;\n                        } else {\n                            int64_t i_212400 = add64(x_212373, i_228582);\n                            int64_t defunc_0_add_arg_212401;\n                            \n                            defunc_0_add_arg_212401 = ((__global\n                                                        int64_t *) mem_229861)[i_229033 *\n                                                                               (partition_sizze_203667 *\n                                                                                defunc_0_f_res_203721) +\n                                                                               i_212400 *\n                                                                               partition_sizze_203667 +\n                                                                               gtid_212354];\n                            \n                            int64_t defunc_1_add_res_212402 = add64((int64_t) 1,\n                                                                    defunc_0_add_arg_212401);\n                            \n                            defunc_0_f_res_212399 = defunc_1_add_res_212402;\n                        }\n                        \n                        double defunc_0_f_res_212403;\n                        \n                        if (cond_212398) {\n                            defunc_0_f_res_212403 = 0.0;\n                        } else {\n ",
                   "                           int64_t i_212404 = add64(x_212373, i_228582);\n                            double defunc_0_add_arg_212405;\n                            \n                            defunc_0_add_arg_212405 = ((__global\n                                                        double *) mem_229849)[i_229033 *\n                                                                              (partition_sizze_203667 *\n                                                                               defunc_0_f_res_203721) +\n                                                                              i_212404 *\n                                                                              partition_sizze_203667 +\n                                                                              gtid_212354];\n                            defunc_0_f_res_212403 = defunc_0_add_arg_212405;\n                        }\n                        \n                        int64_t binop_p_212406 = sub64(defunc_0_f_res_212399,\n                                                       defunc_0_m_fun_res_212376);\n                        double defunc_0_f_res_212407 =\n                               sitofp_i64_f64(binop_p_212406);\n                        double abs_res_212408 = fabs(defunc_0_f_res_212407);\n                        double tmp1_212409 = abs_res_212408 / x_212374;\n                        double x_212410 = tmp1_212409 * tmp1_212409;\n                        double y_212411 = tmp1_212409 * x_212410;\n                        double tmp2_212412 = 1.0 - y_212411;\n                        double x_212413 = tmp2_212412 * tmp2_212412;\n                        double tmp3_212414 = tmp2_212412 * x_212413;\n                        double w_j_212415 = defunc_0_f_res_212403 * tmp3_212414;\n                        double xw_j_212416 = defunc_0_f_res_212407 * w_j_212415;\n                        double x2w_j_212417 = defunc_0_f_res_212407 *\n                               xw_j_212416;\n                        do",
                   "uble defunc_1_op_res_212390 = w_j_212415 +\n                               redout_228579;\n                        double defunc_1_op_res_212393 = xw_j_212416 +\n                               redout_228580;\n                        double defunc_1_op_res_212396 = x2w_j_212417 +\n                               redout_228581;\n                        double redout_tmp_233317 = defunc_1_op_res_212390;\n                        double redout_tmp_233318 = defunc_1_op_res_212393;\n                        double redout_tmp_233319 = defunc_1_op_res_212396;\n                        \n                        redout_228579 = redout_tmp_233317;\n                        redout_228580 = redout_tmp_233318;\n                        redout_228581 = redout_tmp_233319;\n                    }\n                    defunc_2_reduce_res_212385 = redout_228579;\n                    defunc_2_reduce_res_212386 = redout_228580;\n                    defunc_2_reduce_res_212387 = redout_228581;\n                    \n                    double x_212418 = defunc_2_reduce_res_212385 *\n                           defunc_2_reduce_res_212387;\n                    double y_212419 = defunc_2_reduce_res_212386 *\n                           defunc_2_reduce_res_212386;\n                    double y_212420 = x_212418 - y_212419;\n                    double det1_212421 = 1.0 / y_212420;\n                    double a11_212422 = defunc_2_reduce_res_212387 *\n                           det1_212421;\n                    double x_212423 = 0.0 - defunc_2_reduce_res_212386;\n                    double b11_212424 = det1_212421 * x_212423;\n                    double c11_212425 = defunc_2_reduce_res_212385 *\n                           det1_212421;\n                    int64_t defunc_0_m_fun_res_212426;\n                    \n                    if (cond_212375) {\n                        defunc_0_m_fun_res_212426 = (int64_t) 0;\n                    } else {\n                        int64_t y_212427 = sub64(s_n_m_203726, (int64_t) 1);\n                ",
                   "        bool cond_212428 = i_229040 == y_212427;\n                        int64_t defunc_0_m_fun_res_f_res_212429;\n                        \n                        if (cond_212428) {\n                            int64_t defunc_0_m_fun_res_f_res_t_res_212430 =\n                                    sub64(pad_css_len_203722, (int64_t) 1);\n                            \n                            defunc_0_m_fun_res_f_res_212429 =\n                                defunc_0_m_fun_res_f_res_t_res_212430;\n                        } else {\n                            int64_t x_212431 = sub64(i_229040, (int64_t) 1);\n                            int64_t x_212432 = mul64(jump_s_203581, x_212431);\n                            int64_t min_arg_212433 = add64((int64_t) 1,\n                                                           x_212432);\n                            int64_t min_res_212434 =\n                                    smin64(defunc_0_f_res_203721,\n                                           min_arg_212433);\n                            \n                            defunc_0_m_fun_res_f_res_212429 = min_res_212434;\n                        }\n                        defunc_0_m_fun_res_212426 =\n                            defunc_0_m_fun_res_f_res_212429;\n                    }\n                    \n                    double defunc_2_reduce_res_212435;\n                    double defunc_2_reduce_res_212436;\n                    double redout_228583;\n                    double redout_228584;\n                    \n                    redout_228583 = 0.0;\n                    redout_228584 = 0.0;\n                    for (int64_t i_228585 = 0; i_228585 < q_s_203575;\n                         i_228585++) {\n                        bool cond_212444 = sle64(x_212367, i_228585);\n                        int64_t defunc_0_f_res_212445;\n                        \n                        if (cond_212444) {\n                            defunc_0_f_res_212445 = (int64_t) 0;\n                        } else {\n        ",
                   "                    int64_t i_212446 = add64(x_212373, i_228585);\n                            int64_t defunc_0_add_arg_212447;\n                            \n                            defunc_0_add_arg_212447 = ((__global\n                                                        int64_t *) mem_229861)[i_229033 *\n                                                                               (partition_sizze_203667 *\n                                                                                defunc_0_f_res_203721) +\n                                                                               i_212446 *\n                                                                               partition_sizze_203667 +\n                                                                               gtid_212354];\n                            \n                            int64_t defunc_1_add_res_212448 = add64((int64_t) 1,\n                                                                    defunc_0_add_arg_212447);\n                            \n                            defunc_0_f_res_212445 = defunc_1_add_res_212448;\n                        }\n                        \n                        double defunc_0_f_res_212449;\n                        \n                        if (cond_212444) {\n                            defunc_0_f_res_212449 = 0.0;\n                        } else {\n                            int64_t i_212450 = add64(x_212373, i_228585);\n                            double defunc_0_add_arg_212451;\n                            \n                            defunc_0_add_arg_212451 = ((__global\n                                                        double *) mem_229849)[i_229033 *\n                                                                              (partition_sizze_203667 *\n                                                                               defunc_0_f_res_203721) +\n                                                                              i_212450 *\n     ",
                   "                                                                         partition_sizze_203667 +\n                                                                              gtid_212354];\n                            defunc_0_f_res_212449 = defunc_0_add_arg_212451;\n                        }\n                        \n                        int64_t binop_p_212452 = sub64(defunc_0_f_res_212445,\n                                                       defunc_0_m_fun_res_212426);\n                        double defunc_0_f_res_212453 =\n                               sitofp_i64_f64(binop_p_212452);\n                        double abs_res_212454 = fabs(defunc_0_f_res_212453);\n                        double tmp1_212455 = abs_res_212454 / x_212374;\n                        double x_212456 = tmp1_212455 * tmp1_212455;\n                        double y_212457 = tmp1_212455 * x_212456;\n                        double tmp2_212458 = 1.0 - y_212457;\n                        double x_212459 = tmp2_212458 * tmp2_212458;\n                        double tmp3_212460 = tmp2_212458 * x_212459;\n                        double tmp4_212461 = defunc_0_f_res_212449 *\n                               tmp3_212460;\n                        double defunc_1_f_res_212462 = defunc_0_f_res_212453 *\n                               tmp4_212461;\n                        double defunc_0_f_res_212463;\n                        \n                        if (cond_212444) {\n                            defunc_0_f_res_212463 = 0.0;\n                        } else {\n                            int64_t i_212464 = add64(x_212373, i_228585);\n                            double defunc_0_add_arg_212465;\n                            \n                            defunc_0_add_arg_212465 = ((__global\n                                                        double *) mem_229857)[i_229033 *\n                                                                              (partition_sizze_203667 *\n                                                   ",
                   "                            defunc_0_f_res_203721) +\n                                                                              i_212464 *\n                                                                              partition_sizze_203667 +\n                                                                              gtid_212354];\n                            defunc_0_f_res_212463 = defunc_0_add_arg_212465;\n                        }\n                        \n                        double x_212466 = a11_212422 * tmp4_212461;\n                        double y_212467 = b11_212424 * defunc_1_f_res_212462;\n                        double x_212468 = x_212466 + y_212467;\n                        double defunc_9_fit_fun_res_212469 =\n                               defunc_0_f_res_212463 * x_212468;\n                        double x_212470 = b11_212424 * tmp4_212461;\n                        double y_212471 = c11_212425 * defunc_1_f_res_212462;\n                        double x_212472 = x_212470 + y_212471;\n                        double defunc_9_slope_fun_res_212473 =\n                               defunc_0_f_res_212463 * x_212472;\n                        double defunc_1_op_res_212439 =\n                               defunc_9_fit_fun_res_212469 + redout_228583;\n                        double defunc_1_op_res_212442 =\n                               defunc_9_slope_fun_res_212473 + redout_228584;\n                        double redout_tmp_233320 = defunc_1_op_res_212439;\n                        double redout_tmp_233321 = defunc_1_op_res_212442;\n                        \n                        redout_228583 = redout_tmp_233320;\n                        redout_228584 = redout_tmp_233321;\n                    }\n                    defunc_2_reduce_res_212435 = redout_228583;\n                    defunc_2_reduce_res_212436 = redout_228584;\n                    ((__global double *) color_232104)[phys_tid_212355 +\n                                                       (i_229033 *\n              ",
                   "                                          (num_threads_232231 *\n                                                         s_n_m_203726) +\n                                                        i_229040 *\n                                                        num_threads_232231)] =\n                        defunc_2_reduce_res_212435;\n                    ((__global double *) color_232103)[phys_tid_212355 +\n                                                       (i_229033 *\n                                                        (num_threads_232231 *\n                                                         s_n_m_203726) +\n                                                        i_229040 *\n                                                        num_threads_232231)] =\n                        defunc_2_reduce_res_212436;\n                }\n            }\n            for (int64_t i_233322 = 0; i_233322 < n_p_203574; i_233322++) {\n                for (int64_t i_233323 = 0; i_233323 < s_n_m_203726;\n                     i_233323++) {\n                    double tmp_233324;\n                    \n                    tmp_233324 = ((__global\n                                   double *) color_232104)[phys_tid_212355 +\n                                                           (i_233322 *\n                                                            (num_threads_232231 *\n                                                             s_n_m_203726) +\n                                                            i_233323 *\n                                                            num_threads_232231)];\n                    ((__global double *) mem_229954)[gtid_212354 + (i_233322 *\n                                                                    (partition_sizze_203667 *\n                                                                     s_n_m_203726) +\n                                                                    i_233323 *\n                                                                ",
                   "    partition_sizze_203667)] =\n                        tmp_233324;\n                }\n            }\n            for (int64_t i_233325 = 0; i_233325 < n_p_203574; i_233325++) {\n                for (int64_t i_233326 = 0; i_233326 < s_n_m_203726;\n                     i_233326++) {\n                    double tmp_233327;\n                    \n                    tmp_233327 = ((__global\n                                   double *) color_232103)[phys_tid_212355 +\n                                                           (i_233325 *\n                                                            (num_threads_232231 *\n                                                             s_n_m_203726) +\n                                                            i_233326 *\n                                                            num_threads_232231)];\n                    ((__global double *) mem_229958)[gtid_212354 + (i_233325 *\n                                                                    (partition_sizze_203667 *\n                                                                     s_n_m_203726) +\n                                                                    i_233326 *\n                                                                    partition_sizze_203667)] =\n                        tmp_233327;\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_212349\n}\n__kernel void mainzisegmap_213809(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t q_s_203575,\n                                  int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726,\n                                  int64_t num_groups_213787,\n         ",
                   "                         int64_t num_threads_232234, __global\n                                  unsigned char *ext_mem_229372, __global\n                                  unsigned char *mem_229962, __global\n                                  unsigned char *mem_229966, __global\n                                  unsigned char *mem_229970, __global\n                                  unsigned char *mem_229974, __global\n                                  unsigned char *mem_229978, __global\n                                  unsigned char *mem_230013, __global\n                                  unsigned char *mem_230017, __global\n                                  unsigned char *color_232105, __global\n                                  unsigned char *color_232106)\n{\n    #define segmap_group_sizze_213786 (mainzisegmap_group_sizze_212479)\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_233328;\n    int32_t local_tid_233329;\n    int64_t group_sizze_233332;\n    int32_t wave_sizze_233331;\n    int32_t group_tid_233330;\n    \n    global_tid_233328 = get_global_id(0);\n    local_tid_233329 = get_local_id(0);\n    group_sizze_233332 = get_local_size(0);\n    wave_sizze_233331 = LOCKSTEP_WIDTH;\n    group_tid_233330 = get_group_id(0);\n    \n    int32_t phys_tid_213809 = global_tid_233328;\n    int32_t phys_group_id_233333;\n    \n    phys_group_id_233333 = get_group_id(0);\n    for (int32_t i_233334 = 0; i_233334 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * n_p_203574,\n                                          segmap_group_sizze_213786)) -\n                   phys_group_id_233333, sext_i64_i32(num_groups_213787));\n         i_233334++) {\n        int32_t virt_group_id_233335 = phys_group_id_233333 + i_233334 *\n                sext_i64_i32(num_groups_213787);\n        int64_t global_tid_233336 = sext_i32_i64(virt_group_id_233335) *\n                segmap_gro",
                   "up_sizze_213786 + sext_i32_i64(local_tid_233329);\n        int64_t slice_233337 = n_p_203574;\n        int64_t slice_233338 = partition_sizze_203667 * slice_233337;\n        int64_t gtid_213807 = squot64(global_tid_233336, slice_233337);\n        int64_t remnant_233339 = global_tid_233336 - gtid_213807 * slice_233337;\n        int64_t gtid_213808 = remnant_233339;\n        int64_t remnant_233340 = remnant_233339 - gtid_213808;\n        \n        if (slt64(gtid_213807, partition_sizze_203667) && slt64(gtid_213808,\n                                                                n_p_203574)) {\n            int64_t x_213813;\n            \n            x_213813 = ((__global int64_t *) ext_mem_229372)[gtid_213807 *\n                                                             n_p_203574 +\n                                                             gtid_213808];\n            for (int64_t i_229047 = 0; i_229047 < s_n_m_203726; i_229047++) {\n                int64_t x_213819;\n                \n                x_213819 = ((__global int64_t *) mem_229962)[i_229047 *\n                                                             (n_p_203574 *\n                                                              partition_sizze_203667) +\n                                                             gtid_213807 *\n                                                             n_p_203574 +\n                                                             gtid_213808];\n                \n                double x_213820;\n                \n                x_213820 = ((__global double *) mem_229966)[i_229047 *\n                                                            (n_p_203574 *\n                                                             partition_sizze_203667) +\n                                                            gtid_213807 *\n                                                            n_p_203574 +\n                                                            gtid_213808];\n                \n                bo",
                   "ol cond_213821 = i_229047 == (int64_t) 0;\n                int64_t defunc_0_m_fun_res_213822;\n                \n                if (cond_213821) {\n                    defunc_0_m_fun_res_213822 = (int64_t) 0;\n                } else {\n                    int64_t y_213823 = sub64(s_n_m_203726, (int64_t) 1);\n                    bool cond_213824 = i_229047 == y_213823;\n                    int64_t defunc_0_m_fun_res_f_res_213825;\n                    \n                    if (cond_213824) {\n                        int64_t defunc_0_m_fun_res_f_res_t_res_213826 =\n                                sub64(pad_css_len_203722, (int64_t) 1);\n                        \n                        defunc_0_m_fun_res_f_res_213825 =\n                            defunc_0_m_fun_res_f_res_t_res_213826;\n                    } else {\n                        int64_t x_213827 = sub64(i_229047, (int64_t) 1);\n                        int64_t x_213828 = mul64(jump_s_203581, x_213827);\n                        int64_t min_arg_213829 = add64((int64_t) 1, x_213828);\n                        int64_t min_res_213830 = smin64(defunc_0_f_res_203721,\n                                                        min_arg_213829);\n                        \n                        defunc_0_m_fun_res_f_res_213825 = min_res_213830;\n                    }\n                    defunc_0_m_fun_res_213822 = defunc_0_m_fun_res_f_res_213825;\n                }\n                \n                double defunc_2_reduce_res_213831;\n                double defunc_2_reduce_res_213832;\n                double defunc_2_reduce_res_213833;\n                double redout_228590;\n                double redout_228591;\n                double redout_228592;\n                \n                redout_228590 = 0.0;\n                redout_228591 = 0.0;\n                redout_228592 = 0.0;\n                for (int64_t i_228593 = 0; i_228593 < q_s_203575; i_228593++) {\n                    bool cond_213844 = sle64(x_213813, i_228593);\n                    int64_t defunc",
                   "_0_f_res_213845;\n                    \n                    if (cond_213844) {\n                        defunc_0_f_res_213845 = (int64_t) 0;\n                    } else {\n                        int64_t i_213846 = add64(x_213819, i_228593);\n                        int64_t defunc_0_add_arg_213847;\n                        \n                        defunc_0_add_arg_213847 = ((__global\n                                                    int64_t *) mem_229970)[i_213846 *\n                                                                           (n_p_203574 *\n                                                                            partition_sizze_203667) +\n                                                                           gtid_213807 *\n                                                                           n_p_203574 +\n                                                                           gtid_213808];\n                        \n                        int64_t defunc_1_add_res_213848 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_213847);\n                        \n                        defunc_0_f_res_213845 = defunc_1_add_res_213848;\n                    }\n                    \n                    double defunc_0_f_res_213849;\n                    \n                    if (cond_213844) {\n                        defunc_0_f_res_213849 = 0.0;\n                    } else {\n                        int64_t i_213850 = add64(x_213819, i_228593);\n                        double defunc_0_add_arg_213851;\n                        \n                        defunc_0_add_arg_213851 = ((__global\n                                                    double *) mem_229974)[i_213850 *\n                                                                          (n_p_203574 *\n                                                                           partition_sizze_203667) +\n                                                                  ",
                   "        gtid_213807 *\n                                                                          n_p_203574 +\n                                                                          gtid_213808];\n                        defunc_0_f_res_213849 = defunc_0_add_arg_213851;\n                    }\n                    \n                    int64_t binop_p_213852 = sub64(defunc_0_f_res_213845,\n                                                   defunc_0_m_fun_res_213822);\n                    double defunc_0_f_res_213853 =\n                           sitofp_i64_f64(binop_p_213852);\n                    double abs_res_213854 = fabs(defunc_0_f_res_213853);\n                    double tmp1_213855 = abs_res_213854 / x_213820;\n                    double x_213856 = tmp1_213855 * tmp1_213855;\n                    double y_213857 = tmp1_213855 * x_213856;\n                    double tmp2_213858 = 1.0 - y_213857;\n                    double x_213859 = tmp2_213858 * tmp2_213858;\n                    double tmp3_213860 = tmp2_213858 * x_213859;\n                    double w_j_213861 = defunc_0_f_res_213849 * tmp3_213860;\n                    double xw_j_213862 = defunc_0_f_res_213853 * w_j_213861;\n                    double x2w_j_213863 = defunc_0_f_res_213853 * xw_j_213862;\n                    double defunc_1_op_res_213836 = w_j_213861 + redout_228590;\n                    double defunc_1_op_res_213839 = xw_j_213862 + redout_228591;\n                    double defunc_1_op_res_213842 = x2w_j_213863 +\n                           redout_228592;\n                    double redout_tmp_233343 = defunc_1_op_res_213836;\n                    double redout_tmp_233344 = defunc_1_op_res_213839;\n                    double redout_tmp_233345 = defunc_1_op_res_213842;\n                    \n                    redout_228590 = redout_tmp_233343;\n                    redout_228591 = redout_tmp_233344;\n                    redout_228592 = redout_tmp_233345;\n                }\n                defunc_2_reduce_res_213831 = redo",
                   "ut_228590;\n                defunc_2_reduce_res_213832 = redout_228591;\n                defunc_2_reduce_res_213833 = redout_228592;\n                \n                double x_213864 = defunc_2_reduce_res_213831 *\n                       defunc_2_reduce_res_213833;\n                double y_213865 = defunc_2_reduce_res_213832 *\n                       defunc_2_reduce_res_213832;\n                double y_213866 = x_213864 - y_213865;\n                double det1_213867 = 1.0 / y_213866;\n                double a11_213868 = defunc_2_reduce_res_213833 * det1_213867;\n                double x_213869 = 0.0 - defunc_2_reduce_res_213832;\n                double b11_213870 = det1_213867 * x_213869;\n                double c11_213871 = defunc_2_reduce_res_213831 * det1_213867;\n                int64_t defunc_0_m_fun_res_213872;\n                \n                if (cond_213821) {\n                    defunc_0_m_fun_res_213872 = (int64_t) 0;\n                } else {\n                    int64_t y_213873 = sub64(s_n_m_203726, (int64_t) 1);\n                    bool cond_213874 = i_229047 == y_213873;\n                    int64_t defunc_0_m_fun_res_f_res_213875;\n                    \n                    if (cond_213874) {\n                        int64_t defunc_0_m_fun_res_f_res_t_res_213876 =\n                                sub64(pad_css_len_203722, (int64_t) 1);\n                        \n                        defunc_0_m_fun_res_f_res_213875 =\n                            defunc_0_m_fun_res_f_res_t_res_213876;\n                    } else {\n                        int64_t x_213877 = sub64(i_229047, (int64_t) 1);\n                        int64_t x_213878 = mul64(jump_s_203581, x_213877);\n                        int64_t min_arg_213879 = add64((int64_t) 1, x_213878);\n                        int64_t min_res_213880 = smin64(defunc_0_f_res_203721,\n                                                        min_arg_213879);\n                        \n                        defunc_0_m_fun_res_f_res_213875 = min",
                   "_res_213880;\n                    }\n                    defunc_0_m_fun_res_213872 = defunc_0_m_fun_res_f_res_213875;\n                }\n                \n                double defunc_2_reduce_res_213881;\n                double defunc_2_reduce_res_213882;\n                double redout_228594;\n                double redout_228595;\n                \n                redout_228594 = 0.0;\n                redout_228595 = 0.0;\n                for (int64_t i_228596 = 0; i_228596 < q_s_203575; i_228596++) {\n                    bool cond_213890 = sle64(x_213813, i_228596);\n                    int64_t defunc_0_f_res_213891;\n                    \n                    if (cond_213890) {\n                        defunc_0_f_res_213891 = (int64_t) 0;\n                    } else {\n                        int64_t i_213892 = add64(x_213819, i_228596);\n                        int64_t defunc_0_add_arg_213893;\n                        \n                        defunc_0_add_arg_213893 = ((__global\n                                                    int64_t *) mem_229970)[i_213892 *\n                                                                           (n_p_203574 *\n                                                                            partition_sizze_203667) +\n                                                                           gtid_213807 *\n                                                                           n_p_203574 +\n                                                                           gtid_213808];\n                        \n                        int64_t defunc_1_add_res_213894 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_213893);\n                        \n                        defunc_0_f_res_213891 = defunc_1_add_res_213894;\n                    }\n                    \n                    double defunc_0_f_res_213895;\n                    \n                    if (cond_213890) {\n                        defunc_0_f",
                   "_res_213895 = 0.0;\n                    } else {\n                        int64_t i_213896 = add64(x_213819, i_228596);\n                        double defunc_0_add_arg_213897;\n                        \n                        defunc_0_add_arg_213897 = ((__global\n                                                    double *) mem_229974)[i_213896 *\n                                                                          (n_p_203574 *\n                                                                           partition_sizze_203667) +\n                                                                          gtid_213807 *\n                                                                          n_p_203574 +\n                                                                          gtid_213808];\n                        defunc_0_f_res_213895 = defunc_0_add_arg_213897;\n                    }\n                    \n                    int64_t binop_p_213898 = sub64(defunc_0_f_res_213891,\n                                                   defunc_0_m_fun_res_213872);\n                    double defunc_0_f_res_213899 =\n                           sitofp_i64_f64(binop_p_213898);\n                    double abs_res_213900 = fabs(defunc_0_f_res_213899);\n                    double tmp1_213901 = abs_res_213900 / x_213820;\n                    double x_213902 = tmp1_213901 * tmp1_213901;\n                    double y_213903 = tmp1_213901 * x_213902;\n                    double tmp2_213904 = 1.0 - y_213903;\n                    double x_213905 = tmp2_213904 * tmp2_213904;\n                    double tmp3_213906 = tmp2_213904 * x_213905;\n                    double tmp4_213907 = defunc_0_f_res_213895 * tmp3_213906;\n                    double defunc_1_f_res_213908 = defunc_0_f_res_213899 *\n                           tmp4_213907;\n                    double defunc_0_f_res_213909;\n                    \n                    if (cond_213890) {\n                        defunc_0_f_res_213909 = 0.0;\n             ",
                   "       } else {\n                        int64_t i_213910 = add64(x_213819, i_228596);\n                        double defunc_0_add_arg_213911;\n                        \n                        defunc_0_add_arg_213911 = ((__global\n                                                    double *) mem_229978)[i_213910 *\n                                                                          (n_p_203574 *\n                                                                           partition_sizze_203667) +\n                                                                          gtid_213807 *\n                                                                          n_p_203574 +\n                                                                          gtid_213808];\n                        defunc_0_f_res_213909 = defunc_0_add_arg_213911;\n                    }\n                    \n                    double x_213912 = a11_213868 * tmp4_213907;\n                    double y_213913 = b11_213870 * defunc_1_f_res_213908;\n                    double x_213914 = x_213912 + y_213913;\n                    double defunc_9_fit_fun_res_213915 = defunc_0_f_res_213909 *\n                           x_213914;\n                    double x_213916 = b11_213870 * tmp4_213907;\n                    double y_213917 = c11_213871 * defunc_1_f_res_213908;\n                    double x_213918 = x_213916 + y_213917;\n                    double defunc_9_slope_fun_res_213919 =\n                           defunc_0_f_res_213909 * x_213918;\n                    double defunc_1_op_res_213885 =\n                           defunc_9_fit_fun_res_213915 + redout_228594;\n                    double defunc_1_op_res_213888 =\n                           defunc_9_slope_fun_res_213919 + redout_228595;\n                    double redout_tmp_233346 = defunc_1_op_res_213885;\n                    double redout_tmp_233347 = defunc_1_op_res_213888;\n                    \n                    redout_228594 = redout_tmp_233346;\n                   ",
                   " redout_228595 = redout_tmp_233347;\n                }\n                defunc_2_reduce_res_213881 = redout_228594;\n                defunc_2_reduce_res_213882 = redout_228595;\n                ((__global double *) color_232106)[phys_tid_213809 + i_229047 *\n                                                   num_threads_232234] =\n                    defunc_2_reduce_res_213881;\n                ((__global double *) color_232105)[phys_tid_213809 + i_229047 *\n                                                   num_threads_232234] =\n                    defunc_2_reduce_res_213882;\n            }\n            for (int64_t i_233348 = 0; i_233348 < s_n_m_203726; i_233348++) {\n                double tmp_233349;\n                \n                tmp_233349 = ((__global\n                               double *) color_232106)[phys_tid_213809 +\n                                                       i_233348 *\n                                                       num_threads_232234];\n                ((__global double *) mem_230013)[gtid_213807 * n_p_203574 +\n                                                 gtid_213808 + i_233348 *\n                                                 (n_p_203574 *\n                                                  partition_sizze_203667)] =\n                    tmp_233349;\n            }\n            for (int64_t i_233350 = 0; i_233350 < s_n_m_203726; i_233350++) {\n                double tmp_233351;\n                \n                tmp_233351 = ((__global\n                               double *) color_232105)[phys_tid_213809 +\n                                                       i_233350 *\n                                                       num_threads_232234];\n                ((__global double *) mem_230017)[gtid_213807 * n_p_203574 +\n                                                 gtid_213808 + i_233350 *\n                                                 (n_p_203574 *\n                                                  partition_sizze_203667)] =\n              ",
                   "      tmp_233351;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_213786\n}\n__kernel void mainzisegmap_214084(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t q_s_203575,\n                                  int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726, __global\n                                  unsigned char *ext_mem_229372, __global\n                                  unsigned char *ext_mem_229373, __global\n                                  unsigned char *ext_mem_229470, __global\n                                  unsigned char *ext_mem_229471, __global\n                                  unsigned char *mem_229634, __global\n                                  unsigned char *mem_229639, __global\n                                  unsigned char *mem_230070, __global\n                                  unsigned char *mem_230075)\n{\n    #define segmap_group_sizze_214071 (mainzisegmap_group_sizze_212912)\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_233434;\n    int32_t local_tid_233435;\n    int64_t group_sizze_233438;\n    int32_t wave_sizze_233437;\n    int32_t group_tid_233436;\n    \n    global_tid_233434 = get_global_id(0);\n    local_tid_233435 = get_local_id(0);\n    group_sizze_233438 = get_local_size(0);\n    wave_sizze_233437 = LOCKSTEP_WIDTH;\n    group_tid_233436 = get_group_id(0);\n    \n    int32_t phys_tid_214084 = global_tid_233434;\n    int64_t global_tid_233439 = sext_i32_i64(group_tid_233436) *\n            segmap_group_sizze_214071 + sext_i32_i64(local_tid_233435);\n    int64_t slice_23344",
                   "0 = s_n_m_203726;\n    int64_t slice_233441 = n_p_203574 * slice_233440;\n    int64_t slice_233442 = partition_sizze_203667 * slice_233441;\n    int64_t gtid_214081 = squot64(global_tid_233439, slice_233441);\n    int64_t remnant_233443 = global_tid_233439 - gtid_214081 * slice_233441;\n    int64_t gtid_214082 = squot64(remnant_233443, slice_233440);\n    int64_t remnant_233444 = remnant_233443 - gtid_214082 * slice_233440;\n    int64_t gtid_214083 = remnant_233444;\n    int64_t remnant_233445 = remnant_233444 - gtid_214083;\n    \n    if ((slt64(gtid_214081, partition_sizze_203667) && slt64(gtid_214082,\n                                                             n_p_203574)) &&\n        slt64(gtid_214083, s_n_m_203726)) {\n        int64_t x_214088;\n        \n        x_214088 = ((__global int64_t *) ext_mem_229372)[gtid_214081 *\n                                                         n_p_203574 +\n                                                         gtid_214082];\n        \n        int64_t x_214090;\n        \n        x_214090 = ((__global int64_t *) ext_mem_229471)[gtid_214081 *\n                                                         (s_n_m_203726 *\n                                                          n_p_203574) +\n                                                         gtid_214082 *\n                                                         s_n_m_203726 +\n                                                         gtid_214083];\n        \n        double x_214091;\n        \n        x_214091 = ((__global double *) ext_mem_229470)[gtid_214081 *\n                                                        (s_n_m_203726 *\n                                                         n_p_203574) +\n                                                        gtid_214082 *\n                                                        s_n_m_203726 +\n                                                        gtid_214083];\n        \n        bool cond_214092 = gtid_214083 == (int64_t) 0;\n        int64_t defunc_0_",
                   "m_fun_res_214093;\n        \n        if (cond_214092) {\n            defunc_0_m_fun_res_214093 = (int64_t) 0;\n        } else {\n            int64_t y_214094 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_214095 = gtid_214083 == y_214094;\n            int64_t defunc_0_m_fun_res_f_res_214096;\n            \n            if (cond_214095) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_214097 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_214096 =\n                    defunc_0_m_fun_res_f_res_t_res_214097;\n            } else {\n                int64_t x_214098 = sub64(gtid_214083, (int64_t) 1);\n                int64_t x_214099 = mul64(jump_s_203581, x_214098);\n                int64_t min_arg_214100 = add64((int64_t) 1, x_214099);\n                int64_t min_res_214101 = smin64(defunc_0_f_res_203721,\n                                                min_arg_214100);\n                \n                defunc_0_m_fun_res_f_res_214096 = min_res_214101;\n            }\n            defunc_0_m_fun_res_214093 = defunc_0_m_fun_res_f_res_214096;\n        }\n        \n        double defunc_2_reduce_res_214102;\n        double defunc_2_reduce_res_214103;\n        double defunc_2_reduce_res_214104;\n        double redout_228609;\n        double redout_228610;\n        double redout_228611;\n        \n        redout_228609 = 0.0;\n        redout_228610 = 0.0;\n        redout_228611 = 0.0;\n        for (int64_t i_228612 = 0; i_228612 < q_s_203575; i_228612++) {\n            bool cond_214115 = sle64(x_214088, i_228612);\n            int64_t defunc_0_f_res_214116;\n            \n            if (cond_214115) {\n                defunc_0_f_res_214116 = (int64_t) 0;\n            } else {\n                int64_t i_214117 = add64(x_214090, i_228612);\n                int64_t defunc_0_add_arg_214118;\n                \n                defunc_0_add_arg_214118 = ((__global\n                                            int64_t *) ext_mem_22",
                   "9373)[gtid_214081 *\n                                                                       (defunc_0_f_res_203721 *\n                                                                        n_p_203574) +\n                                                                       gtid_214082 *\n                                                                       defunc_0_f_res_203721 +\n                                                                       i_214117];\n                \n                int64_t defunc_1_add_res_214119 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_214118);\n                \n                defunc_0_f_res_214116 = defunc_1_add_res_214119;\n            }\n            \n            double defunc_0_f_res_214120;\n            \n            if (cond_214115) {\n                defunc_0_f_res_214120 = 0.0;\n            } else {\n                int64_t i_214121 = add64(x_214090, i_228612);\n                double defunc_0_add_arg_214122;\n                \n                defunc_0_add_arg_214122 = ((__global\n                                            double *) mem_229639)[gtid_214081 *\n                                                                  (defunc_0_f_res_203721 *\n                                                                   n_p_203574) +\n                                                                  gtid_214082 *\n                                                                  defunc_0_f_res_203721 +\n                                                                  i_214121];\n                defunc_0_f_res_214120 = defunc_0_add_arg_214122;\n            }\n            \n            int64_t binop_p_214123 = sub64(defunc_0_f_res_214116,\n                                           defunc_0_m_fun_res_214093);\n            double defunc_0_f_res_214124 = sitofp_i64_f64(binop_p_214123);\n            double abs_res_214125 = fabs(defunc_0_f_res_214124);\n            double tmp1_214126 = abs_res_214125 / x_214091;",
                   "\n            double x_214127 = tmp1_214126 * tmp1_214126;\n            double y_214128 = tmp1_214126 * x_214127;\n            double tmp2_214129 = 1.0 - y_214128;\n            double x_214130 = tmp2_214129 * tmp2_214129;\n            double tmp3_214131 = tmp2_214129 * x_214130;\n            double w_j_214132 = defunc_0_f_res_214120 * tmp3_214131;\n            double xw_j_214133 = defunc_0_f_res_214124 * w_j_214132;\n            double x2w_j_214134 = defunc_0_f_res_214124 * xw_j_214133;\n            double defunc_1_op_res_214107 = w_j_214132 + redout_228609;\n            double defunc_1_op_res_214110 = xw_j_214133 + redout_228610;\n            double defunc_1_op_res_214113 = x2w_j_214134 + redout_228611;\n            double redout_tmp_233446 = defunc_1_op_res_214107;\n            double redout_tmp_233447 = defunc_1_op_res_214110;\n            double redout_tmp_233448 = defunc_1_op_res_214113;\n            \n            redout_228609 = redout_tmp_233446;\n            redout_228610 = redout_tmp_233447;\n            redout_228611 = redout_tmp_233448;\n        }\n        defunc_2_reduce_res_214102 = redout_228609;\n        defunc_2_reduce_res_214103 = redout_228610;\n        defunc_2_reduce_res_214104 = redout_228611;\n        \n        double x_214135 = defunc_2_reduce_res_214102 *\n               defunc_2_reduce_res_214104;\n        double y_214136 = defunc_2_reduce_res_214103 *\n               defunc_2_reduce_res_214103;\n        double y_214137 = x_214135 - y_214136;\n        double det1_214138 = 1.0 / y_214137;\n        double a11_214139 = defunc_2_reduce_res_214104 * det1_214138;\n        double x_214140 = 0.0 - defunc_2_reduce_res_214103;\n        double b11_214141 = det1_214138 * x_214140;\n        double c11_214142 = defunc_2_reduce_res_214102 * det1_214138;\n        int64_t defunc_0_m_fun_res_214143;\n        \n        if (cond_214092) {\n            defunc_0_m_fun_res_214143 = (int64_t) 0;\n        } else {\n            int64_t y_214144 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_214",
                   "145 = gtid_214083 == y_214144;\n            int64_t defunc_0_m_fun_res_f_res_214146;\n            \n            if (cond_214145) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_214147 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_214146 =\n                    defunc_0_m_fun_res_f_res_t_res_214147;\n            } else {\n                int64_t x_214148 = sub64(gtid_214083, (int64_t) 1);\n                int64_t x_214149 = mul64(jump_s_203581, x_214148);\n                int64_t min_arg_214150 = add64((int64_t) 1, x_214149);\n                int64_t min_res_214151 = smin64(defunc_0_f_res_203721,\n                                                min_arg_214150);\n                \n                defunc_0_m_fun_res_f_res_214146 = min_res_214151;\n            }\n            defunc_0_m_fun_res_214143 = defunc_0_m_fun_res_f_res_214146;\n        }\n        \n        double defunc_2_reduce_res_214152;\n        double defunc_2_reduce_res_214153;\n        double redout_228613;\n        double redout_228614;\n        \n        redout_228613 = 0.0;\n        redout_228614 = 0.0;\n        for (int64_t i_228615 = 0; i_228615 < q_s_203575; i_228615++) {\n            bool cond_214161 = sle64(x_214088, i_228615);\n            int64_t defunc_0_f_res_214162;\n            \n            if (cond_214161) {\n                defunc_0_f_res_214162 = (int64_t) 0;\n            } else {\n                int64_t i_214163 = add64(x_214090, i_228615);\n                int64_t defunc_0_add_arg_214164;\n                \n                defunc_0_add_arg_214164 = ((__global\n                                            int64_t *) ext_mem_229373)[gtid_214081 *\n                                                                       (defunc_0_f_res_203721 *\n                                                                        n_p_203574) +\n                                                                       gtid_214082 *\n                             ",
                   "                                          defunc_0_f_res_203721 +\n                                                                       i_214163];\n                \n                int64_t defunc_1_add_res_214165 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_214164);\n                \n                defunc_0_f_res_214162 = defunc_1_add_res_214165;\n            }\n            \n            double defunc_0_f_res_214166;\n            \n            if (cond_214161) {\n                defunc_0_f_res_214166 = 0.0;\n            } else {\n                int64_t i_214167 = add64(x_214090, i_228615);\n                double defunc_0_add_arg_214168;\n                \n                defunc_0_add_arg_214168 = ((__global\n                                            double *) mem_229639)[gtid_214081 *\n                                                                  (defunc_0_f_res_203721 *\n                                                                   n_p_203574) +\n                                                                  gtid_214082 *\n                                                                  defunc_0_f_res_203721 +\n                                                                  i_214167];\n                defunc_0_f_res_214166 = defunc_0_add_arg_214168;\n            }\n            \n            int64_t binop_p_214169 = sub64(defunc_0_f_res_214162,\n                                           defunc_0_m_fun_res_214143);\n            double defunc_0_f_res_214170 = sitofp_i64_f64(binop_p_214169);\n            double abs_res_214171 = fabs(defunc_0_f_res_214170);\n            double tmp1_214172 = abs_res_214171 / x_214091;\n            double x_214173 = tmp1_214172 * tmp1_214172;\n            double y_214174 = tmp1_214172 * x_214173;\n            double tmp2_214175 = 1.0 - y_214174;\n            double x_214176 = tmp2_214175 * tmp2_214175;\n            double tmp3_214177 = tmp2_214175 * x_214176;\n            double tmp4_214178 = defunc_0",
                   "_f_res_214166 * tmp3_214177;\n            double defunc_1_f_res_214179 = defunc_0_f_res_214170 * tmp4_214178;\n            double defunc_0_f_res_214180;\n            \n            if (cond_214161) {\n                defunc_0_f_res_214180 = 0.0;\n            } else {\n                int64_t i_214181 = add64(x_214090, i_228615);\n                double defunc_0_add_arg_214182;\n                \n                defunc_0_add_arg_214182 = ((__global\n                                            double *) mem_229634)[gtid_214081 *\n                                                                  (defunc_0_f_res_203721 *\n                                                                   n_p_203574) +\n                                                                  gtid_214082 *\n                                                                  defunc_0_f_res_203721 +\n                                                                  i_214181];\n                defunc_0_f_res_214180 = defunc_0_add_arg_214182;\n            }\n            \n            double x_214183 = a11_214139 * tmp4_214178;\n            double y_214184 = b11_214141 * defunc_1_f_res_214179;\n            double x_214185 = x_214183 + y_214184;\n            double defunc_9_fit_fun_res_214186 = defunc_0_f_res_214180 *\n                   x_214185;\n            double x_214187 = b11_214141 * tmp4_214178;\n            double y_214188 = c11_214142 * defunc_1_f_res_214179;\n            double x_214189 = x_214187 + y_214188;\n            double defunc_9_slope_fun_res_214190 = defunc_0_f_res_214180 *\n                   x_214189;\n            double defunc_1_op_res_214156 = defunc_9_fit_fun_res_214186 +\n                   redout_228613;\n            double defunc_1_op_res_214159 = defunc_9_slope_fun_res_214190 +\n                   redout_228614;\n            double redout_tmp_233449 = defunc_1_op_res_214156;\n            double redout_tmp_233450 = defunc_1_op_res_214159;\n            \n            redout_228613 = redout_tmp_233449;\n            ",
                   "redout_228614 = redout_tmp_233450;\n        }\n        defunc_2_reduce_res_214152 = redout_228613;\n        defunc_2_reduce_res_214153 = redout_228614;\n        ((__global double *) mem_230070)[gtid_214081 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_214082 * s_n_m_203726 +\n                                         gtid_214083] =\n            defunc_2_reduce_res_214152;\n        ((__global double *) mem_230075)[gtid_214081 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_214082 * s_n_m_203726 +\n                                         gtid_214083] =\n            defunc_2_reduce_res_214153;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_214071\n}\n__kernel void mainzisegmap_214201(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726, __global\n                                  unsigned char *mem_230081, __global\n                                  unsigned char *mem_230085)\n{\n    #define segmap_group_sizze_214194 (mainzisegmap_group_sizze_213247)\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_233451;\n    int32_t local_tid_233452;\n    int64_t group_sizze_233455;\n    int32_t wave_sizze_233454;\n    int32_t group_tid_233453;\n    \n    global_tid_233451 = get_global_id(0);\n    local_tid_233452 = get_local_id(0);\n    group_sizze_233455 = get_local_size(0);\n    wave_sizze_233454 = LOCKSTEP_WIDTH;\n    group_tid_233453 = get_group_id(0);\n    \n    int32_t phys_tid_214201 = global_ti",
                   "d_233451;\n    int64_t global_tid_233456 = sext_i32_i64(group_tid_233453) *\n            segmap_group_sizze_214194 + sext_i32_i64(local_tid_233452);\n    int64_t slice_233457 = s_n_m_203726;\n    int64_t slice_233458 = n_p_203574 * slice_233457;\n    int64_t slice_233459 = partition_sizze_203667 * slice_233458;\n    int64_t gtid_214198 = squot64(global_tid_233456, slice_233458);\n    int64_t remnant_233460 = global_tid_233456 - gtid_214198 * slice_233458;\n    int64_t gtid_214199 = squot64(remnant_233460, slice_233457);\n    int64_t remnant_233461 = remnant_233460 - gtid_214199 * slice_233457;\n    int64_t gtid_214200 = remnant_233461;\n    int64_t remnant_233462 = remnant_233461 - gtid_214200;\n    \n    if ((slt64(gtid_214198, partition_sizze_203667) && slt64(gtid_214199,\n                                                             n_p_203574)) &&\n        slt64(gtid_214200, s_n_m_203726)) {\n        bool cond_214203 = gtid_214200 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_214204;\n        \n        if (cond_214203) {\n            defunc_0_m_fun_res_214204 = (int64_t) 0;\n        } else {\n            int64_t y_214205 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_214206 = gtid_214200 == y_214205;\n            int64_t defunc_0_m_fun_res_f_res_214207;\n            \n            if (cond_214206) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_214208 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_214207 =\n                    defunc_0_m_fun_res_f_res_t_res_214208;\n            } else {\n                int64_t x_214209 = sub64(gtid_214200, (int64_t) 1);\n                int64_t x_214210 = mul64(jump_s_203581, x_214209);\n                int64_t min_arg_214211 = add64((int64_t) 1, x_214210);\n                int64_t min_res_214212 = smin64(defunc_0_f_res_203721,\n                                                min_arg_214211);\n                \n                defunc_0_m_fun_res_f_res_214207 = m",
                   "in_res_214212;\n            }\n            defunc_0_m_fun_res_214204 = defunc_0_m_fun_res_f_res_214207;\n        }\n        ((__global int64_t *) mem_230081)[gtid_214198 * (s_n_m_203726 *\n                                                         n_p_203574) +\n                                          gtid_214199 * s_n_m_203726 +\n                                          gtid_214200] =\n            defunc_0_m_fun_res_214204;\n        ((__global bool *) mem_230085)[gtid_214198 * (s_n_m_203726 *\n                                                      n_p_203574) +\n                                       gtid_214199 * s_n_m_203726 +\n                                       gtid_214200] = cond_214203;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_214194\n}\n__kernel void mainzisegmap_214285(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726, __global\n                                  unsigned char *mem_230091, __global\n                                  unsigned char *mem_230096, __global\n                                  unsigned char *mem_230101, __global\n                                  unsigned char *mem_230107, __global\n                                  unsigned char *mem_230112, __global\n                                  unsigned char *mem_230117, __global\n                                  unsigned char *mem_230122)\n{\n    #define segmap_group_sizze_214276 (mainzisegmap_group_sizze_213144)\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_233567;\n    int32_t local_tid_233568;\n    int64_t group_sizze_233571;\n    int32_t wave_sizze_233570;\n    ",
                   "int32_t group_tid_233569;\n    \n    global_tid_233567 = get_global_id(0);\n    local_tid_233568 = get_local_id(0);\n    group_sizze_233571 = get_local_size(0);\n    wave_sizze_233570 = LOCKSTEP_WIDTH;\n    group_tid_233569 = get_group_id(0);\n    \n    int32_t phys_tid_214285 = global_tid_233567;\n    int64_t global_tid_233572 = sext_i32_i64(group_tid_233569) *\n            segmap_group_sizze_214276 + sext_i32_i64(local_tid_233568);\n    int64_t slice_233573 = s_n_m_203726;\n    int64_t slice_233574 = n_p_203574 * slice_233573;\n    int64_t slice_233575 = partition_sizze_203667 * slice_233574;\n    int64_t gtid_214282 = squot64(global_tid_233572, slice_233574);\n    int64_t remnant_233576 = global_tid_233572 - gtid_214282 * slice_233574;\n    int64_t gtid_214283 = squot64(remnant_233576, slice_233573);\n    int64_t remnant_233577 = remnant_233576 - gtid_214283 * slice_233573;\n    int64_t gtid_214284 = remnant_233577;\n    int64_t remnant_233578 = remnant_233577 - gtid_214284;\n    \n    if ((slt64(gtid_214282, partition_sizze_203667) && slt64(gtid_214283,\n                                                             n_p_203574)) &&\n        slt64(gtid_214284, s_n_m_203726)) {\n        bool index_primexp_228814 = gtid_214284 == (int64_t) 0;\n        double defunc_2_reduce_res_214288;\n        \n        defunc_2_reduce_res_214288 = ((__global\n                                       double *) mem_230091)[gtid_214282 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_214283 *\n                                                             s_n_m_203726 +\n                                                             gtid_214284];\n        \n        double defunc_2_reduce_res_214289;\n        \n        defunc_2_reduce_res_214289 = ((__global\n                                       double *) mem_230096)[gtid_214282 *\n                        ",
                   "                                     (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_214283 *\n                                                             s_n_m_203726 +\n                                                             gtid_214284];\n        \n        double defunc_2_reduce_res_214290;\n        \n        defunc_2_reduce_res_214290 = ((__global\n                                       double *) mem_230101)[gtid_214282 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_214283 *\n                                                             s_n_m_203726 +\n                                                             gtid_214284];\n        \n        double x_214291 = defunc_2_reduce_res_214288 *\n               defunc_2_reduce_res_214290;\n        double y_214292 = defunc_2_reduce_res_214289 *\n               defunc_2_reduce_res_214289;\n        double y_214293 = x_214291 - y_214292;\n        double det1_214294 = 1.0 / y_214293;\n        double a11_214295 = defunc_2_reduce_res_214290 * det1_214294;\n        double x_214296 = 0.0 - defunc_2_reduce_res_214289;\n        double b11_214297 = det1_214294 * x_214296;\n        double c11_214298 = defunc_2_reduce_res_214288 * det1_214294;\n        int64_t defunc_0_m_fun_res_214299;\n        \n        if (index_primexp_228814) {\n            defunc_0_m_fun_res_214299 = (int64_t) 0;\n        } else {\n            int64_t y_214300 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_214301 = gtid_214284 == y_214300;\n            int64_t defunc_0_m_fun_res_f_res_214302;\n            \n            if (cond_214301) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_214303 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n            ",
                   "    defunc_0_m_fun_res_f_res_214302 =\n                    defunc_0_m_fun_res_f_res_t_res_214303;\n            } else {\n                int64_t x_214304 = sub64(gtid_214284, (int64_t) 1);\n                int64_t x_214305 = mul64(jump_s_203581, x_214304);\n                int64_t min_arg_214306 = add64((int64_t) 1, x_214305);\n                int64_t min_res_214307 = smin64(defunc_0_f_res_203721,\n                                                min_arg_214306);\n                \n                defunc_0_m_fun_res_f_res_214302 = min_res_214307;\n            }\n            defunc_0_m_fun_res_214299 = defunc_0_m_fun_res_f_res_214302;\n        }\n        ((__global double *) mem_230107)[gtid_214282 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_214283 * s_n_m_203726 +\n                                         gtid_214284] = a11_214295;\n        ((__global double *) mem_230112)[gtid_214282 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_214283 * s_n_m_203726 +\n                                         gtid_214284] = b11_214297;\n        ((__global double *) mem_230117)[gtid_214282 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_214283 * s_n_m_203726 +\n                                         gtid_214284] = c11_214298;\n        ((__global int64_t *) mem_230122)[gtid_214282 * (s_n_m_203726 *\n                                                         n_p_203574) +\n                                          gtid_214283 * s_n_m_203726 +\n                                          gtid_214284] =\n            defunc_0_m_fun_res_214299;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_214276\n}\n__kernel void mainzisegmap_214560(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t q_s_203575,\n  ",
                   "                                int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726,\n                                  int64_t num_groups_214555,\n                                  int64_t num_threads_232243, __global\n                                  unsigned char *mem_230169, __global\n                                  unsigned char *mem_230172, __global\n                                  unsigned char *mem_230176, __global\n                                  unsigned char *mem_230180, __global\n                                  unsigned char *mem_230184, __global\n                                  unsigned char *mem_230188, __global\n                                  unsigned char *mem_230281, __global\n                                  unsigned char *mem_230285, __global\n                                  unsigned char *color_232115, __global\n                                  unsigned char *color_232116)\n{\n    #define segmap_group_sizze_214554 (mainzisegmap_group_sizze_214396)\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_233677;\n    int32_t local_tid_233678;\n    int64_t group_sizze_233681;\n    int32_t wave_sizze_233680;\n    int32_t group_tid_233679;\n    \n    global_tid_233677 = get_global_id(0);\n    local_tid_233678 = get_local_id(0);\n    group_sizze_233681 = get_local_size(0);\n    wave_sizze_233680 = LOCKSTEP_WIDTH;\n    group_tid_233679 = get_group_id(0);\n    \n    int32_t phys_tid_214560 = global_tid_233677;\n    int32_t phys_group_id_233682;\n    \n    phys_group_id_233682 = get_group_id(0);\n    for (int32_t i_233683 = 0; i_233683 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667,\n                                  ",
                   "        segmap_group_sizze_214554)) -\n                   phys_group_id_233682, sext_i64_i32(num_groups_214555));\n         i_233683++) {\n        int32_t virt_group_id_233684 = phys_group_id_233682 + i_233683 *\n                sext_i64_i32(num_groups_214555);\n        int64_t global_tid_233685 = sext_i32_i64(virt_group_id_233684) *\n                segmap_group_sizze_214554 + sext_i32_i64(local_tid_233678);\n        int64_t slice_233686 = partition_sizze_203667;\n        int64_t gtid_214559 = global_tid_233685;\n        int64_t remnant_233687 = global_tid_233685 - gtid_214559;\n        \n        if (slt64(gtid_214559, partition_sizze_203667)) {\n            for (int64_t i_229054 = 0; i_229054 < n_p_203574; i_229054++) {\n                int64_t x_214572;\n                \n                x_214572 = ((__global int64_t *) mem_230172)[i_229054 *\n                                                             partition_sizze_203667 +\n                                                             gtid_214559];\n                for (int64_t i_229061 = 0; i_229061 < s_n_m_203726;\n                     i_229061++) {\n                    int64_t x_214578;\n                    \n                    x_214578 = ((__global int64_t *) mem_230180)[i_229054 *\n                                                                 (partition_sizze_203667 *\n                                                                  s_n_m_203726) +\n                                                                 i_229061 *\n                                                                 partition_sizze_203667 +\n                                                                 gtid_214559];\n                    \n                    double x_214579;\n                    \n                    x_214579 = ((__global double *) mem_230169)[i_229054 *\n                                                                (partition_sizze_203667 *\n                                                                 s_n_m_203726) +\n               ",
                   "                                                 i_229061 *\n                                                                partition_sizze_203667 +\n                                                                gtid_214559];\n                    \n                    bool cond_214580 = i_229061 == (int64_t) 0;\n                    int64_t defunc_0_m_fun_res_214581;\n                    \n                    if (cond_214580) {\n                        defunc_0_m_fun_res_214581 = (int64_t) 0;\n                    } else {\n                        int64_t y_214582 = sub64(s_n_m_203726, (int64_t) 1);\n                        bool cond_214583 = i_229061 == y_214582;\n                        int64_t defunc_0_m_fun_res_f_res_214584;\n                        \n                        if (cond_214583) {\n                            int64_t defunc_0_m_fun_res_f_res_t_res_214585 =\n                                    sub64(pad_css_len_203722, (int64_t) 1);\n                            \n                            defunc_0_m_fun_res_f_res_214584 =\n                                defunc_0_m_fun_res_f_res_t_res_214585;\n                        } else {\n                            int64_t x_214586 = sub64(i_229061, (int64_t) 1);\n                            int64_t x_214587 = mul64(jump_s_203581, x_214586);\n                            int64_t min_arg_214588 = add64((int64_t) 1,\n                                                           x_214587);\n                            int64_t min_res_214589 =\n                                    smin64(defunc_0_f_res_203721,\n                                           min_arg_214588);\n                            \n                            defunc_0_m_fun_res_f_res_214584 = min_res_214589;\n                        }\n                        defunc_0_m_fun_res_214581 =\n                            defunc_0_m_fun_res_f_res_214584;\n                    }\n                    \n                    double defunc_2_reduce_res_214590;\n                    double defunc_2_",
                   "reduce_res_214591;\n                    double defunc_2_reduce_res_214592;\n                    double defunc_2_reduce_res_214593;\n                    double defunc_2_reduce_res_214594;\n                    double redout_228630;\n                    double redout_228631;\n                    double redout_228632;\n                    double redout_228633;\n                    double redout_228634;\n                    \n                    redout_228630 = 0.0;\n                    redout_228631 = 0.0;\n                    redout_228632 = 0.0;\n                    redout_228633 = 0.0;\n                    redout_228634 = 0.0;\n                    for (int64_t i_228635 = 0; i_228635 < q_s_203575;\n                         i_228635++) {\n                        bool cond_214611 = sle64(x_214572, i_228635);\n                        int64_t defunc_0_f_res_214612;\n                        \n                        if (cond_214611) {\n                            defunc_0_f_res_214612 = (int64_t) 0;\n                        } else {\n                            int64_t i_214613 = add64(x_214578, i_228635);\n                            int64_t defunc_0_add_arg_214614;\n                            \n                            defunc_0_add_arg_214614 = ((__global\n                                                        int64_t *) mem_230188)[i_229054 *\n                                                                               (partition_sizze_203667 *\n                                                                                defunc_0_f_res_203721) +\n                                                                               i_214613 *\n                                                                               partition_sizze_203667 +\n                                                                               gtid_214559];\n                            \n                            int64_t defunc_1_add_res_214615 = add64((int64_t) 1,\n                                                      ",
                   "              defunc_0_add_arg_214614);\n                            \n                            defunc_0_f_res_214612 = defunc_1_add_res_214615;\n                        }\n                        \n                        double defunc_0_f_res_214616;\n                        \n                        if (cond_214611) {\n                            defunc_0_f_res_214616 = 0.0;\n                        } else {\n                            int64_t i_214617 = add64(x_214578, i_228635);\n                            double defunc_0_add_arg_214618;\n                            \n                            defunc_0_add_arg_214618 = ((__global\n                                                        double *) mem_230176)[i_229054 *\n                                                                              (partition_sizze_203667 *\n                                                                               defunc_0_f_res_203721) +\n                                                                              i_214617 *\n                                                                              partition_sizze_203667 +\n                                                                              gtid_214559];\n                            defunc_0_f_res_214616 = defunc_0_add_arg_214618;\n                        }\n                        \n                        int64_t binop_p_214619 = sub64(defunc_0_f_res_214612,\n                                                       defunc_0_m_fun_res_214581);\n                        double defunc_0_f_res_214620 =\n                               sitofp_i64_f64(binop_p_214619);\n                        double abs_res_214621 = fabs(defunc_0_f_res_214620);\n                        double tmp1_214622 = abs_res_214621 / x_214579;\n                        double x_214623 = tmp1_214622 * tmp1_214622;\n                        double y_214624 = tmp1_214622 * x_214623;\n                        double tmp2_214625 = 1.0 - y_214624;\n                        double",
                   " x_214626 = tmp2_214625 * tmp2_214625;\n                        double tmp3_214627 = tmp2_214625 * x_214626;\n                        double w_j_214628 = defunc_0_f_res_214616 * tmp3_214627;\n                        double xw_j_214629 = defunc_0_f_res_214620 * w_j_214628;\n                        double x2w_j_214630 = defunc_0_f_res_214620 *\n                               xw_j_214629;\n                        double x3w_j_214631 = defunc_0_f_res_214620 *\n                               x2w_j_214630;\n                        double x4w_j_214632 = defunc_0_f_res_214620 *\n                               x3w_j_214631;\n                        double defunc_1_op_res_214597 = w_j_214628 +\n                               redout_228630;\n                        double defunc_1_op_res_214600 = xw_j_214629 +\n                               redout_228631;\n                        double defunc_1_op_res_214603 = x2w_j_214630 +\n                               redout_228632;\n                        double defunc_1_op_res_214606 = x3w_j_214631 +\n                               redout_228633;\n                        double defunc_1_op_res_214609 = x4w_j_214632 +\n                               redout_228634;\n                        double redout_tmp_233692 = defunc_1_op_res_214597;\n                        double redout_tmp_233693 = defunc_1_op_res_214600;\n                        double redout_tmp_233694 = defunc_1_op_res_214603;\n                        double redout_tmp_233695 = defunc_1_op_res_214606;\n                        double redout_tmp_233696 = defunc_1_op_res_214609;\n                        \n                        redout_228630 = redout_tmp_233692;\n                        redout_228631 = redout_tmp_233693;\n                        redout_228632 = redout_tmp_233694;\n                        redout_228633 = redout_tmp_233695;\n                        redout_228634 = redout_tmp_233696;\n                    }\n                    defunc_2_reduce_res_214590 = redout_228630;\n                    def",
                   "unc_2_reduce_res_214591 = redout_228631;\n                    defunc_2_reduce_res_214592 = redout_228632;\n                    defunc_2_reduce_res_214593 = redout_228633;\n                    defunc_2_reduce_res_214594 = redout_228634;\n                    \n                    double x_214633 = defunc_2_reduce_res_214592 *\n                           defunc_2_reduce_res_214594;\n                    double y_214634 = defunc_2_reduce_res_214593 *\n                           defunc_2_reduce_res_214593;\n                    double a12_214635 = x_214633 - y_214634;\n                    double x_214636 = defunc_2_reduce_res_214592 *\n                           defunc_2_reduce_res_214593;\n                    double y_214637 = defunc_2_reduce_res_214591 *\n                           defunc_2_reduce_res_214594;\n                    double b12_214638 = x_214636 - y_214637;\n                    double x_214639 = defunc_2_reduce_res_214591 *\n                           defunc_2_reduce_res_214593;\n                    double y_214640 = defunc_2_reduce_res_214592 *\n                           defunc_2_reduce_res_214592;\n                    double c12_214641 = x_214639 - y_214640;\n                    double x_214642 = defunc_2_reduce_res_214590 *\n                           defunc_2_reduce_res_214594;\n                    double b2_214643 = x_214642 - y_214640;\n                    double x_214644 = defunc_2_reduce_res_214591 *\n                           defunc_2_reduce_res_214592;\n                    double y_214645 = defunc_2_reduce_res_214590 *\n                           defunc_2_reduce_res_214593;\n                    double c2_214646 = x_214644 - y_214645;\n                    double x_214647 = defunc_2_reduce_res_214590 * a12_214635;\n                    double y_214648 = defunc_2_reduce_res_214591 * b12_214638;\n                    double x_214649 = x_214647 + y_214648;\n                    double y_214650 = defunc_2_reduce_res_214592 * c12_214641;\n                    double y_214651 = x_214649 + ",
                   "y_214650;\n                    double det_214652 = 1.0 / y_214651;\n                    double a12_214653 = a12_214635 * det_214652;\n                    double b12_214654 = b12_214638 * det_214652;\n                    double c12_214655 = c12_214641 * det_214652;\n                    double b2_214656 = b2_214643 * det_214652;\n                    double c2_214657 = c2_214646 * det_214652;\n                    int64_t defunc_0_m_fun_res_214658;\n                    \n                    if (cond_214580) {\n                        defunc_0_m_fun_res_214658 = (int64_t) 0;\n                    } else {\n                        int64_t y_214659 = sub64(s_n_m_203726, (int64_t) 1);\n                        bool cond_214660 = i_229061 == y_214659;\n                        int64_t defunc_0_m_fun_res_f_res_214661;\n                        \n                        if (cond_214660) {\n                            int64_t defunc_0_m_fun_res_f_res_t_res_214662 =\n                                    sub64(pad_css_len_203722, (int64_t) 1);\n                            \n                            defunc_0_m_fun_res_f_res_214661 =\n                                defunc_0_m_fun_res_f_res_t_res_214662;\n                        } else {\n                            int64_t x_214663 = sub64(i_229061, (int64_t) 1);\n                            int64_t x_214664 = mul64(jump_s_203581, x_214663);\n                            int64_t min_arg_214665 = add64((int64_t) 1,\n                                                           x_214664);\n                            int64_t min_res_214666 =\n                                    smin64(defunc_0_f_res_203721,\n                                           min_arg_214665);\n                            \n                            defunc_0_m_fun_res_f_res_214661 = min_res_214666;\n                        }\n                        defunc_0_m_fun_res_214658 =\n                            defunc_0_m_fun_res_f_res_214661;\n                    }\n                    \n                ",
                   "    double defunc_2_reduce_res_214667;\n                    double defunc_2_reduce_res_214668;\n                    double redout_228636;\n                    double redout_228637;\n                    \n                    redout_228636 = 0.0;\n                    redout_228637 = 0.0;\n                    for (int64_t i_228638 = 0; i_228638 < q_s_203575;\n                         i_228638++) {\n                        bool cond_214676 = sle64(x_214572, i_228638);\n                        int64_t defunc_0_f_res_214677;\n                        \n                        if (cond_214676) {\n                            defunc_0_f_res_214677 = (int64_t) 0;\n                        } else {\n                            int64_t i_214678 = add64(x_214578, i_228638);\n                            int64_t defunc_0_add_arg_214679;\n                            \n                            defunc_0_add_arg_214679 = ((__global\n                                                        int64_t *) mem_230188)[i_229054 *\n                                                                               (partition_sizze_203667 *\n                                                                                defunc_0_f_res_203721) +\n                                                                               i_214678 *\n                                                                               partition_sizze_203667 +\n                                                                               gtid_214559];\n                            \n                            int64_t defunc_1_add_res_214680 = add64((int64_t) 1,\n                                                                    defunc_0_add_arg_214679);\n                            \n                            defunc_0_f_res_214677 = defunc_1_add_res_214680;\n                        }\n                        \n                        double defunc_0_f_res_214681;\n                        \n                        if (cond_214676) {\n                    ",
                   "        defunc_0_f_res_214681 = 0.0;\n                        } else {\n                            int64_t i_214682 = add64(x_214578, i_228638);\n                            double defunc_0_add_arg_214683;\n                            \n                            defunc_0_add_arg_214683 = ((__global\n                                                        double *) mem_230176)[i_229054 *\n                                                                              (partition_sizze_203667 *\n                                                                               defunc_0_f_res_203721) +\n                                                                              i_214682 *\n                                                                              partition_sizze_203667 +\n                                                                              gtid_214559];\n                            defunc_0_f_res_214681 = defunc_0_add_arg_214683;\n                        }\n                        \n                        int64_t binop_p_214684 = sub64(defunc_0_f_res_214677,\n                                                       defunc_0_m_fun_res_214658);\n                        double defunc_0_f_res_214685 =\n                               sitofp_i64_f64(binop_p_214684);\n                        double abs_res_214686 = fabs(defunc_0_f_res_214685);\n                        double tmp1_214687 = abs_res_214686 / x_214579;\n                        double x_214688 = tmp1_214687 * tmp1_214687;\n                        double y_214689 = tmp1_214687 * x_214688;\n                        double tmp2_214690 = 1.0 - y_214689;\n                        double x_214691 = tmp2_214690 * tmp2_214690;\n                        double tmp3_214692 = tmp2_214690 * x_214691;\n                        double tmp4_214693 = defunc_0_f_res_214681 *\n                               tmp3_214692;\n                        double defunc_1_f_res_214694 = defunc_0_f_res_214685 *\n                               tmp4_214",
                   "693;\n                        double defunc_1_f_res_214695 = defunc_0_f_res_214685 *\n                               defunc_1_f_res_214694;\n                        double defunc_0_f_res_214696;\n                        \n                        if (cond_214676) {\n                            defunc_0_f_res_214696 = 0.0;\n                        } else {\n                            int64_t i_214697 = add64(x_214578, i_228638);\n                            double defunc_0_add_arg_214698;\n                            \n                            defunc_0_add_arg_214698 = ((__global\n                                                        double *) mem_230184)[i_229054 *\n                                                                              (partition_sizze_203667 *\n                                                                               defunc_0_f_res_203721) +\n                                                                              i_214697 *\n                                                                              partition_sizze_203667 +\n                                                                              gtid_214559];\n                            defunc_0_f_res_214696 = defunc_0_add_arg_214698;\n                        }\n                        \n                        double x_214699 = a12_214653 * tmp4_214693;\n                        double y_214700 = b12_214654 * defunc_1_f_res_214694;\n                        double x_214701 = x_214699 + y_214700;\n                        double y_214702 = c12_214655 * defunc_1_f_res_214695;\n                        double x_214703 = x_214701 + y_214702;\n                        double defunc_9_fit_fun_res_214704 =\n                               defunc_0_f_res_214696 * x_214703;\n                        double x_214705 = b12_214654 * tmp4_214693;\n                        double y_214706 = b2_214656 * defunc_1_f_res_214694;\n                        double x_214707 = x_214705 + y_214706;\n                        doubl",
                   "e y_214708 = c2_214657 * defunc_1_f_res_214695;\n                        double x_214709 = x_214707 + y_214708;\n                        double defunc_9_slope_fun_res_214710 =\n                               defunc_0_f_res_214696 * x_214709;\n                        double defunc_1_op_res_214671 =\n                               defunc_9_fit_fun_res_214704 + redout_228636;\n                        double defunc_1_op_res_214674 =\n                               defunc_9_slope_fun_res_214710 + redout_228637;\n                        double redout_tmp_233697 = defunc_1_op_res_214671;\n                        double redout_tmp_233698 = defunc_1_op_res_214674;\n                        \n                        redout_228636 = redout_tmp_233697;\n                        redout_228637 = redout_tmp_233698;\n                    }\n                    defunc_2_reduce_res_214667 = redout_228636;\n                    defunc_2_reduce_res_214668 = redout_228637;\n                    ((__global double *) color_232116)[phys_tid_214560 +\n                                                       (i_229054 *\n                                                        (num_threads_232243 *\n                                                         s_n_m_203726) +\n                                                        i_229061 *\n                                                        num_threads_232243)] =\n                        defunc_2_reduce_res_214667;\n                    ((__global double *) color_232115)[phys_tid_214560 +\n                                                       (i_229054 *\n                                                        (num_threads_232243 *\n                                                         s_n_m_203726) +\n                                                        i_229061 *\n                                                        num_threads_232243)] =\n                        defunc_2_reduce_res_214668;\n                }\n            }\n            for (int64_t i_233699 = 0; i_2",
                   "33699 < n_p_203574; i_233699++) {\n                for (int64_t i_233700 = 0; i_233700 < s_n_m_203726;\n                     i_233700++) {\n                    double tmp_233701;\n                    \n                    tmp_233701 = ((__global\n                                   double *) color_232116)[phys_tid_214560 +\n                                                           (i_233699 *\n                                                            (num_threads_232243 *\n                                                             s_n_m_203726) +\n                                                            i_233700 *\n                                                            num_threads_232243)];\n                    ((__global double *) mem_230281)[gtid_214559 + (i_233699 *\n                                                                    (partition_sizze_203667 *\n                                                                     s_n_m_203726) +\n                                                                    i_233700 *\n                                                                    partition_sizze_203667)] =\n                        tmp_233701;\n                }\n            }\n            for (int64_t i_233702 = 0; i_233702 < n_p_203574; i_233702++) {\n                for (int64_t i_233703 = 0; i_233703 < s_n_m_203726;\n                     i_233703++) {\n                    double tmp_233704;\n                    \n                    tmp_233704 = ((__global\n                                   double *) color_232115)[phys_tid_214560 +\n                                                           (i_233702 *\n                                                            (num_threads_232243 *\n                                                             s_n_m_203726) +\n                                                            i_233703 *\n                                                            num_threads_232243)];\n                    ((__global double *) mem_230285)[gti",
                   "d_214559 + (i_233702 *\n                                                                    (partition_sizze_203667 *\n                                                                     s_n_m_203726) +\n                                                                    i_233703 *\n                                                                    partition_sizze_203667)] =\n                        tmp_233704;\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_214554\n}\n__kernel void mainzisegmap_216352(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t q_s_203575,\n                                  int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726,\n                                  int64_t num_groups_216330,\n                                  int64_t num_threads_232246, __global\n                                  unsigned char *ext_mem_229372, __global\n                                  unsigned char *mem_230289, __global\n                                  unsigned char *mem_230293, __global\n                                  unsigned char *mem_230297, __global\n                                  unsigned char *mem_230301, __global\n                                  unsigned char *mem_230305, __global\n                                  unsigned char *mem_230340, __global\n                                  unsigned char *mem_230344, __global\n                                  unsigned char *color_232117, __global\n                                  unsigned char *color_232118)\n{\n    #define segmap_group_sizze_216329 (mainzisegmap_group_sizze_214716)\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_233705;\n    int32_t local_tid_233706;\n    int64_t group_sizze_233709;\n    int32_t wave_sizze_233708;\n    int32_t group_tid_233707;\n    \n    global_tid_233705 = get_global_id(0);\n    local_tid_233706 = get_local_id(0);\n    group_sizze_233709 = get_local_size(0);\n    wave_sizze_233708 = LOCKSTEP_WIDTH;\n    group_tid_233707 = get_group_id(0);\n    \n    int32_t phys_tid_216352 = global_tid_233705;\n    int32_t phys_group_id_233710;\n    \n    phys_group_id_233710 = get_group_id(0);\n    for (int32_t i_233711 = 0; i_233711 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * n_p_203574,\n                                          segmap_group_sizze_216329)) -\n                   phys_group_id_233710, sext_i64_i32(num_groups_216330));\n         i_233711++) {\n        int32_t virt_group_id_233712 = phys_group_id_233710 + i_233711 *\n                sext_i64_i32(num_groups_216330);\n        int64_t global_tid_233713 = sext_i32_i64(virt_group_id_233712) *\n                segmap_group_sizze_216329 + sext_i32_i64(local_tid_233706);\n        int64_t slice_233714 = n_p_203574;\n        int64_t slice_233715 = partition_sizze_203667 * slice_233714;\n        int64_t gtid_216350 = squot64(global_tid_233713, slice_233714);\n        int64_t remnant_233716 = global_tid_233713 - gtid_216350 * slice_233714;\n        int64_t gtid_216351 = remnant_233716;\n        int64_t remnant_233717 = remnant_233716 - gtid_216351;\n        \n        if (slt64(gtid_216350, partition_sizze_203667) && slt64(gtid_216351,\n                                                                n_p_203574)) {\n            int64_t x_216356;\n            \n            x_216356 = ((__global int64_t *) ext_mem_229372)[gtid_216350 *\n                                                             n_p_203574 +\n                                                             gtid_216351];\n            for (int64_t i_229068 = 0; i_",
                   "229068 < s_n_m_203726; i_229068++) {\n                int64_t x_216362;\n                \n                x_216362 = ((__global int64_t *) mem_230289)[i_229068 *\n                                                             (n_p_203574 *\n                                                              partition_sizze_203667) +\n                                                             gtid_216350 *\n                                                             n_p_203574 +\n                                                             gtid_216351];\n                \n                double x_216363;\n                \n                x_216363 = ((__global double *) mem_230293)[i_229068 *\n                                                            (n_p_203574 *\n                                                             partition_sizze_203667) +\n                                                            gtid_216350 *\n                                                            n_p_203574 +\n                                                            gtid_216351];\n                \n                bool cond_216364 = i_229068 == (int64_t) 0;\n                int64_t defunc_0_m_fun_res_216365;\n                \n                if (cond_216364) {\n                    defunc_0_m_fun_res_216365 = (int64_t) 0;\n                } else {\n                    int64_t y_216366 = sub64(s_n_m_203726, (int64_t) 1);\n                    bool cond_216367 = i_229068 == y_216366;\n                    int64_t defunc_0_m_fun_res_f_res_216368;\n                    \n                    if (cond_216367) {\n                        int64_t defunc_0_m_fun_res_f_res_t_res_216369 =\n                                sub64(pad_css_len_203722, (int64_t) 1);\n                        \n                        defunc_0_m_fun_res_f_res_216368 =\n                            defunc_0_m_fun_res_f_res_t_res_216369;\n                    } else {\n                        int64_t x_216370 = sub64(i_229068, (int64_t) 1);\n                ",
                   "        int64_t x_216371 = mul64(jump_s_203581, x_216370);\n                        int64_t min_arg_216372 = add64((int64_t) 1, x_216371);\n                        int64_t min_res_216373 = smin64(defunc_0_f_res_203721,\n                                                        min_arg_216372);\n                        \n                        defunc_0_m_fun_res_f_res_216368 = min_res_216373;\n                    }\n                    defunc_0_m_fun_res_216365 = defunc_0_m_fun_res_f_res_216368;\n                }\n                \n                double defunc_2_reduce_res_216374;\n                double defunc_2_reduce_res_216375;\n                double defunc_2_reduce_res_216376;\n                double defunc_2_reduce_res_216377;\n                double defunc_2_reduce_res_216378;\n                double redout_228643;\n                double redout_228644;\n                double redout_228645;\n                double redout_228646;\n                double redout_228647;\n                \n                redout_228643 = 0.0;\n                redout_228644 = 0.0;\n                redout_228645 = 0.0;\n                redout_228646 = 0.0;\n                redout_228647 = 0.0;\n                for (int64_t i_228648 = 0; i_228648 < q_s_203575; i_228648++) {\n                    bool cond_216395 = sle64(x_216356, i_228648);\n                    int64_t defunc_0_f_res_216396;\n                    \n                    if (cond_216395) {\n                        defunc_0_f_res_216396 = (int64_t) 0;\n                    } else {\n                        int64_t i_216397 = add64(x_216362, i_228648);\n                        int64_t defunc_0_add_arg_216398;\n                        \n                        defunc_0_add_arg_216398 = ((__global\n                                                    int64_t *) mem_230297)[i_216397 *\n                                                                           (n_p_203574 *\n                                                                            partition_sizze",
                   "_203667) +\n                                                                           gtid_216350 *\n                                                                           n_p_203574 +\n                                                                           gtid_216351];\n                        \n                        int64_t defunc_1_add_res_216399 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_216398);\n                        \n                        defunc_0_f_res_216396 = defunc_1_add_res_216399;\n                    }\n                    \n                    double defunc_0_f_res_216400;\n                    \n                    if (cond_216395) {\n                        defunc_0_f_res_216400 = 0.0;\n                    } else {\n                        int64_t i_216401 = add64(x_216362, i_228648);\n                        double defunc_0_add_arg_216402;\n                        \n                        defunc_0_add_arg_216402 = ((__global\n                                                    double *) mem_230301)[i_216401 *\n                                                                          (n_p_203574 *\n                                                                           partition_sizze_203667) +\n                                                                          gtid_216350 *\n                                                                          n_p_203574 +\n                                                                          gtid_216351];\n                        defunc_0_f_res_216400 = defunc_0_add_arg_216402;\n                    }\n                    \n                    int64_t binop_p_216403 = sub64(defunc_0_f_res_216396,\n                                                   defunc_0_m_fun_res_216365);\n                    double defunc_0_f_res_216404 =\n                           sitofp_i64_f64(binop_p_216403);\n                    double abs_res_216405 = fabs(defunc_0_f_res_216404",
                   ");\n                    double tmp1_216406 = abs_res_216405 / x_216363;\n                    double x_216407 = tmp1_216406 * tmp1_216406;\n                    double y_216408 = tmp1_216406 * x_216407;\n                    double tmp2_216409 = 1.0 - y_216408;\n                    double x_216410 = tmp2_216409 * tmp2_216409;\n                    double tmp3_216411 = tmp2_216409 * x_216410;\n                    double w_j_216412 = defunc_0_f_res_216400 * tmp3_216411;\n                    double xw_j_216413 = defunc_0_f_res_216404 * w_j_216412;\n                    double x2w_j_216414 = defunc_0_f_res_216404 * xw_j_216413;\n                    double x3w_j_216415 = defunc_0_f_res_216404 * x2w_j_216414;\n                    double x4w_j_216416 = defunc_0_f_res_216404 * x3w_j_216415;\n                    double defunc_1_op_res_216381 = w_j_216412 + redout_228643;\n                    double defunc_1_op_res_216384 = xw_j_216413 + redout_228644;\n                    double defunc_1_op_res_216387 = x2w_j_216414 +\n                           redout_228645;\n                    double defunc_1_op_res_216390 = x3w_j_216415 +\n                           redout_228646;\n                    double defunc_1_op_res_216393 = x4w_j_216416 +\n                           redout_228647;\n                    double redout_tmp_233720 = defunc_1_op_res_216381;\n                    double redout_tmp_233721 = defunc_1_op_res_216384;\n                    double redout_tmp_233722 = defunc_1_op_res_216387;\n                    double redout_tmp_233723 = defunc_1_op_res_216390;\n                    double redout_tmp_233724 = defunc_1_op_res_216393;\n                    \n                    redout_228643 = redout_tmp_233720;\n                    redout_228644 = redout_tmp_233721;\n                    redout_228645 = redout_tmp_233722;\n                    redout_228646 = redout_tmp_233723;\n                    redout_228647 = redout_tmp_233724;\n                }\n                defunc_2_reduce_res_216374 = redout_228643;\n     ",
                   "           defunc_2_reduce_res_216375 = redout_228644;\n                defunc_2_reduce_res_216376 = redout_228645;\n                defunc_2_reduce_res_216377 = redout_228646;\n                defunc_2_reduce_res_216378 = redout_228647;\n                \n                double x_216417 = defunc_2_reduce_res_216376 *\n                       defunc_2_reduce_res_216378;\n                double y_216418 = defunc_2_reduce_res_216377 *\n                       defunc_2_reduce_res_216377;\n                double a12_216419 = x_216417 - y_216418;\n                double x_216420 = defunc_2_reduce_res_216376 *\n                       defunc_2_reduce_res_216377;\n                double y_216421 = defunc_2_reduce_res_216375 *\n                       defunc_2_reduce_res_216378;\n                double b12_216422 = x_216420 - y_216421;\n                double x_216423 = defunc_2_reduce_res_216375 *\n                       defunc_2_reduce_res_216377;\n                double y_216424 = defunc_2_reduce_res_216376 *\n                       defunc_2_reduce_res_216376;\n                double c12_216425 = x_216423 - y_216424;\n                double x_216426 = defunc_2_reduce_res_216374 *\n                       defunc_2_reduce_res_216378;\n                double b2_216427 = x_216426 - y_216424;\n                double x_216428 = defunc_2_reduce_res_216375 *\n                       defunc_2_reduce_res_216376;\n                double y_216429 = defunc_2_reduce_res_216374 *\n                       defunc_2_reduce_res_216377;\n                double c2_216430 = x_216428 - y_216429;\n                double x_216431 = defunc_2_reduce_res_216374 * a12_216419;\n                double y_216432 = defunc_2_reduce_res_216375 * b12_216422;\n                double x_216433 = x_216431 + y_216432;\n                double y_216434 = defunc_2_reduce_res_216376 * c12_216425;\n                double y_216435 = x_216433 + y_216434;\n                double det_216436 = 1.0 / y_216435;\n                double a12_216437 = a12_216419 * det",
                   "_216436;\n                double b12_216438 = b12_216422 * det_216436;\n                double c12_216439 = c12_216425 * det_216436;\n                double b2_216440 = b2_216427 * det_216436;\n                double c2_216441 = c2_216430 * det_216436;\n                int64_t defunc_0_m_fun_res_216442;\n                \n                if (cond_216364) {\n                    defunc_0_m_fun_res_216442 = (int64_t) 0;\n                } else {\n                    int64_t y_216443 = sub64(s_n_m_203726, (int64_t) 1);\n                    bool cond_216444 = i_229068 == y_216443;\n                    int64_t defunc_0_m_fun_res_f_res_216445;\n                    \n                    if (cond_216444) {\n                        int64_t defunc_0_m_fun_res_f_res_t_res_216446 =\n                                sub64(pad_css_len_203722, (int64_t) 1);\n                        \n                        defunc_0_m_fun_res_f_res_216445 =\n                            defunc_0_m_fun_res_f_res_t_res_216446;\n                    } else {\n                        int64_t x_216447 = sub64(i_229068, (int64_t) 1);\n                        int64_t x_216448 = mul64(jump_s_203581, x_216447);\n                        int64_t min_arg_216449 = add64((int64_t) 1, x_216448);\n                        int64_t min_res_216450 = smin64(defunc_0_f_res_203721,\n                                                        min_arg_216449);\n                        \n                        defunc_0_m_fun_res_f_res_216445 = min_res_216450;\n                    }\n                    defunc_0_m_fun_res_216442 = defunc_0_m_fun_res_f_res_216445;\n                }\n                \n                double defunc_2_reduce_res_216451;\n                double defunc_2_reduce_res_216452;\n                double redout_228649;\n                double redout_228650;\n                \n                redout_228649 = 0.0;\n                redout_228650 = 0.0;\n                for (int64_t i_228651 = 0; i_228651 < q_s_203575; i_228651++) {\n                   ",
                   " bool cond_216460 = sle64(x_216356, i_228651);\n                    int64_t defunc_0_f_res_216461;\n                    \n                    if (cond_216460) {\n                        defunc_0_f_res_216461 = (int64_t) 0;\n                    } else {\n                        int64_t i_216462 = add64(x_216362, i_228651);\n                        int64_t defunc_0_add_arg_216463;\n                        \n                        defunc_0_add_arg_216463 = ((__global\n                                                    int64_t *) mem_230297)[i_216462 *\n                                                                           (n_p_203574 *\n                                                                            partition_sizze_203667) +\n                                                                           gtid_216350 *\n                                                                           n_p_203574 +\n                                                                           gtid_216351];\n                        \n                        int64_t defunc_1_add_res_216464 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_216463);\n                        \n                        defunc_0_f_res_216461 = defunc_1_add_res_216464;\n                    }\n                    \n                    double defunc_0_f_res_216465;\n                    \n                    if (cond_216460) {\n                        defunc_0_f_res_216465 = 0.0;\n                    } else {\n                        int64_t i_216466 = add64(x_216362, i_228651);\n                        double defunc_0_add_arg_216467;\n                        \n                        defunc_0_add_arg_216467 = ((__global\n                                                    double *) mem_230301)[i_216466 *\n                                                                          (n_p_203574 *\n                                                                           partition_s",
                   "izze_203667) +\n                                                                          gtid_216350 *\n                                                                          n_p_203574 +\n                                                                          gtid_216351];\n                        defunc_0_f_res_216465 = defunc_0_add_arg_216467;\n                    }\n                    \n                    int64_t binop_p_216468 = sub64(defunc_0_f_res_216461,\n                                                   defunc_0_m_fun_res_216442);\n                    double defunc_0_f_res_216469 =\n                           sitofp_i64_f64(binop_p_216468);\n                    double abs_res_216470 = fabs(defunc_0_f_res_216469);\n                    double tmp1_216471 = abs_res_216470 / x_216363;\n                    double x_216472 = tmp1_216471 * tmp1_216471;\n                    double y_216473 = tmp1_216471 * x_216472;\n                    double tmp2_216474 = 1.0 - y_216473;\n                    double x_216475 = tmp2_216474 * tmp2_216474;\n                    double tmp3_216476 = tmp2_216474 * x_216475;\n                    double tmp4_216477 = defunc_0_f_res_216465 * tmp3_216476;\n                    double defunc_1_f_res_216478 = defunc_0_f_res_216469 *\n                           tmp4_216477;\n                    double defunc_1_f_res_216479 = defunc_0_f_res_216469 *\n                           defunc_1_f_res_216478;\n                    double defunc_0_f_res_216480;\n                    \n                    if (cond_216460) {\n                        defunc_0_f_res_216480 = 0.0;\n                    } else {\n                        int64_t i_216481 = add64(x_216362, i_228651);\n                        double defunc_0_add_arg_216482;\n                        \n                        defunc_0_add_arg_216482 = ((__global\n                                                    double *) mem_230305)[i_216481 *\n                                                                          (n_p_20",
                   "3574 *\n                                                                           partition_sizze_203667) +\n                                                                          gtid_216350 *\n                                                                          n_p_203574 +\n                                                                          gtid_216351];\n                        defunc_0_f_res_216480 = defunc_0_add_arg_216482;\n                    }\n                    \n                    double x_216483 = a12_216437 * tmp4_216477;\n                    double y_216484 = b12_216438 * defunc_1_f_res_216478;\n                    double x_216485 = x_216483 + y_216484;\n                    double y_216486 = c12_216439 * defunc_1_f_res_216479;\n                    double x_216487 = x_216485 + y_216486;\n                    double defunc_9_fit_fun_res_216488 = defunc_0_f_res_216480 *\n                           x_216487;\n                    double x_216489 = b12_216438 * tmp4_216477;\n                    double y_216490 = b2_216440 * defunc_1_f_res_216478;\n                    double x_216491 = x_216489 + y_216490;\n                    double y_216492 = c2_216441 * defunc_1_f_res_216479;\n                    double x_216493 = x_216491 + y_216492;\n                    double defunc_9_slope_fun_res_216494 =\n                           defunc_0_f_res_216480 * x_216493;\n                    double defunc_1_op_res_216455 =\n                           defunc_9_fit_fun_res_216488 + redout_228649;\n                    double defunc_1_op_res_216458 =\n                           defunc_9_slope_fun_res_216494 + redout_228650;\n                    double redout_tmp_233725 = defunc_1_op_res_216455;\n                    double redout_tmp_233726 = defunc_1_op_res_216458;\n                    \n                    redout_228649 = redout_tmp_233725;\n                    redout_228650 = redout_tmp_233726;\n                }\n                defunc_2_reduce_res_216451 = redout_228649;\n                ",
                   "defunc_2_reduce_res_216452 = redout_228650;\n                ((__global double *) color_232118)[phys_tid_216352 + i_229068 *\n                                                   num_threads_232246] =\n                    defunc_2_reduce_res_216451;\n                ((__global double *) color_232117)[phys_tid_216352 + i_229068 *\n                                                   num_threads_232246] =\n                    defunc_2_reduce_res_216452;\n            }\n            for (int64_t i_233727 = 0; i_233727 < s_n_m_203726; i_233727++) {\n                double tmp_233728;\n                \n                tmp_233728 = ((__global\n                               double *) color_232118)[phys_tid_216352 +\n                                                       i_233727 *\n                                                       num_threads_232246];\n                ((__global double *) mem_230340)[gtid_216350 * n_p_203574 +\n                                                 gtid_216351 + i_233727 *\n                                                 (n_p_203574 *\n                                                  partition_sizze_203667)] =\n                    tmp_233728;\n            }\n            for (int64_t i_233729 = 0; i_233729 < s_n_m_203726; i_233729++) {\n                double tmp_233730;\n                \n                tmp_233730 = ((__global\n                               double *) color_232117)[phys_tid_216352 +\n                                                       i_233729 *\n                                                       num_threads_232246];\n                ((__global double *) mem_230344)[gtid_216350 * n_p_203574 +\n                                                 gtid_216351 + i_233729 *\n                                                 (n_p_203574 *\n                                                  partition_sizze_203667)] =\n                    tmp_233730;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    r",
                   "eturn;\n    #undef segmap_group_sizze_216329\n}\n__kernel void mainzisegmap_216697(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t q_s_203575,\n                                  int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726, __global\n                                  unsigned char *ext_mem_229372, __global\n                                  unsigned char *ext_mem_229373, __global\n                                  unsigned char *ext_mem_229470, __global\n                                  unsigned char *ext_mem_229471, __global\n                                  unsigned char *mem_229634, __global\n                                  unsigned char *mem_229639, __global\n                                  unsigned char *mem_230409, __global\n                                  unsigned char *mem_230414)\n{\n    #define segmap_group_sizze_216684 (mainzisegmap_group_sizze_215257)\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_233829;\n    int32_t local_tid_233830;\n    int64_t group_sizze_233833;\n    int32_t wave_sizze_233832;\n    int32_t group_tid_233831;\n    \n    global_tid_233829 = get_global_id(0);\n    local_tid_233830 = get_local_id(0);\n    group_sizze_233833 = get_local_size(0);\n    wave_sizze_233832 = LOCKSTEP_WIDTH;\n    group_tid_233831 = get_group_id(0);\n    \n    int32_t phys_tid_216697 = global_tid_233829;\n    int64_t global_tid_233834 = sext_i32_i64(group_tid_233831) *\n            segmap_group_sizze_216684 + sext_i32_i64(local_tid_233830);\n    int64_t slice_233835 = s_n_m_203726;\n    int64_t slice_233836 = n_p_203574 * slice_233835;\n    int64_t slice_233837 = partition_sizze_203667 * slice_",
                   "233836;\n    int64_t gtid_216694 = squot64(global_tid_233834, slice_233836);\n    int64_t remnant_233838 = global_tid_233834 - gtid_216694 * slice_233836;\n    int64_t gtid_216695 = squot64(remnant_233838, slice_233835);\n    int64_t remnant_233839 = remnant_233838 - gtid_216695 * slice_233835;\n    int64_t gtid_216696 = remnant_233839;\n    int64_t remnant_233840 = remnant_233839 - gtid_216696;\n    \n    if ((slt64(gtid_216694, partition_sizze_203667) && slt64(gtid_216695,\n                                                             n_p_203574)) &&\n        slt64(gtid_216696, s_n_m_203726)) {\n        int64_t x_216701;\n        \n        x_216701 = ((__global int64_t *) ext_mem_229372)[gtid_216694 *\n                                                         n_p_203574 +\n                                                         gtid_216695];\n        \n        int64_t x_216703;\n        \n        x_216703 = ((__global int64_t *) ext_mem_229471)[gtid_216694 *\n                                                         (s_n_m_203726 *\n                                                          n_p_203574) +\n                                                         gtid_216695 *\n                                                         s_n_m_203726 +\n                                                         gtid_216696];\n        \n        double x_216704;\n        \n        x_216704 = ((__global double *) ext_mem_229470)[gtid_216694 *\n                                                        (s_n_m_203726 *\n                                                         n_p_203574) +\n                                                        gtid_216695 *\n                                                        s_n_m_203726 +\n                                                        gtid_216696];\n        \n        bool cond_216705 = gtid_216696 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_216706;\n        \n        if (cond_216705) {\n            defunc_0_m_fun_res_216706 = (int64_t) 0;\n        } else {\n      ",
                   "      int64_t y_216707 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_216708 = gtid_216696 == y_216707;\n            int64_t defunc_0_m_fun_res_f_res_216709;\n            \n            if (cond_216708) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_216710 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_216709 =\n                    defunc_0_m_fun_res_f_res_t_res_216710;\n            } else {\n                int64_t x_216711 = sub64(gtid_216696, (int64_t) 1);\n                int64_t x_216712 = mul64(jump_s_203581, x_216711);\n                int64_t min_arg_216713 = add64((int64_t) 1, x_216712);\n                int64_t min_res_216714 = smin64(defunc_0_f_res_203721,\n                                                min_arg_216713);\n                \n                defunc_0_m_fun_res_f_res_216709 = min_res_216714;\n            }\n            defunc_0_m_fun_res_216706 = defunc_0_m_fun_res_f_res_216709;\n        }\n        \n        double defunc_2_reduce_res_216715;\n        double defunc_2_reduce_res_216716;\n        double defunc_2_reduce_res_216717;\n        double defunc_2_reduce_res_216718;\n        double defunc_2_reduce_res_216719;\n        double redout_228664;\n        double redout_228665;\n        double redout_228666;\n        double redout_228667;\n        double redout_228668;\n        \n        redout_228664 = 0.0;\n        redout_228665 = 0.0;\n        redout_228666 = 0.0;\n        redout_228667 = 0.0;\n        redout_228668 = 0.0;\n        for (int64_t i_228669 = 0; i_228669 < q_s_203575; i_228669++) {\n            bool cond_216736 = sle64(x_216701, i_228669);\n            int64_t defunc_0_f_res_216737;\n            \n            if (cond_216736) {\n                defunc_0_f_res_216737 = (int64_t) 0;\n            } else {\n                int64_t i_216738 = add64(x_216703, i_228669);\n                int64_t defunc_0_add_arg_216739;\n                \n                defunc_0_add_arg_216739 = ((",
                   "__global\n                                            int64_t *) ext_mem_229373)[gtid_216694 *\n                                                                       (defunc_0_f_res_203721 *\n                                                                        n_p_203574) +\n                                                                       gtid_216695 *\n                                                                       defunc_0_f_res_203721 +\n                                                                       i_216738];\n                \n                int64_t defunc_1_add_res_216740 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_216739);\n                \n                defunc_0_f_res_216737 = defunc_1_add_res_216740;\n            }\n            \n            double defunc_0_f_res_216741;\n            \n            if (cond_216736) {\n                defunc_0_f_res_216741 = 0.0;\n            } else {\n                int64_t i_216742 = add64(x_216703, i_228669);\n                double defunc_0_add_arg_216743;\n                \n                defunc_0_add_arg_216743 = ((__global\n                                            double *) mem_229639)[gtid_216694 *\n                                                                  (defunc_0_f_res_203721 *\n                                                                   n_p_203574) +\n                                                                  gtid_216695 *\n                                                                  defunc_0_f_res_203721 +\n                                                                  i_216742];\n                defunc_0_f_res_216741 = defunc_0_add_arg_216743;\n            }\n            \n            int64_t binop_p_216744 = sub64(defunc_0_f_res_216737,\n                                           defunc_0_m_fun_res_216706);\n            double defunc_0_f_res_216745 = sitofp_i64_f64(binop_p_216744);\n            double abs_res_216746 = fabs(defunc_0_",
                   "f_res_216745);\n            double tmp1_216747 = abs_res_216746 / x_216704;\n            double x_216748 = tmp1_216747 * tmp1_216747;\n            double y_216749 = tmp1_216747 * x_216748;\n            double tmp2_216750 = 1.0 - y_216749;\n            double x_216751 = tmp2_216750 * tmp2_216750;\n            double tmp3_216752 = tmp2_216750 * x_216751;\n            double w_j_216753 = defunc_0_f_res_216741 * tmp3_216752;\n            double xw_j_216754 = defunc_0_f_res_216745 * w_j_216753;\n            double x2w_j_216755 = defunc_0_f_res_216745 * xw_j_216754;\n            double x3w_j_216756 = defunc_0_f_res_216745 * x2w_j_216755;\n            double x4w_j_216757 = defunc_0_f_res_216745 * x3w_j_216756;\n            double defunc_1_op_res_216722 = w_j_216753 + redout_228664;\n            double defunc_1_op_res_216725 = xw_j_216754 + redout_228665;\n            double defunc_1_op_res_216728 = x2w_j_216755 + redout_228666;\n            double defunc_1_op_res_216731 = x3w_j_216756 + redout_228667;\n            double defunc_1_op_res_216734 = x4w_j_216757 + redout_228668;\n            double redout_tmp_233841 = defunc_1_op_res_216722;\n            double redout_tmp_233842 = defunc_1_op_res_216725;\n            double redout_tmp_233843 = defunc_1_op_res_216728;\n            double redout_tmp_233844 = defunc_1_op_res_216731;\n            double redout_tmp_233845 = defunc_1_op_res_216734;\n            \n            redout_228664 = redout_tmp_233841;\n            redout_228665 = redout_tmp_233842;\n            redout_228666 = redout_tmp_233843;\n            redout_228667 = redout_tmp_233844;\n            redout_228668 = redout_tmp_233845;\n        }\n        defunc_2_reduce_res_216715 = redout_228664;\n        defunc_2_reduce_res_216716 = redout_228665;\n        defunc_2_reduce_res_216717 = redout_228666;\n        defunc_2_reduce_res_216718 = redout_228667;\n        defunc_2_reduce_res_216719 = redout_228668;\n        \n        double x_216758 = defunc_2_reduce_res_216717 *\n               defunc_2_reduce_res",
                   "_216719;\n        double y_216759 = defunc_2_reduce_res_216718 *\n               defunc_2_reduce_res_216718;\n        double a12_216760 = x_216758 - y_216759;\n        double x_216761 = defunc_2_reduce_res_216717 *\n               defunc_2_reduce_res_216718;\n        double y_216762 = defunc_2_reduce_res_216716 *\n               defunc_2_reduce_res_216719;\n        double b12_216763 = x_216761 - y_216762;\n        double x_216764 = defunc_2_reduce_res_216716 *\n               defunc_2_reduce_res_216718;\n        double y_216765 = defunc_2_reduce_res_216717 *\n               defunc_2_reduce_res_216717;\n        double c12_216766 = x_216764 - y_216765;\n        double x_216767 = defunc_2_reduce_res_216715 *\n               defunc_2_reduce_res_216719;\n        double b2_216768 = x_216767 - y_216765;\n        double x_216769 = defunc_2_reduce_res_216716 *\n               defunc_2_reduce_res_216717;\n        double y_216770 = defunc_2_reduce_res_216715 *\n               defunc_2_reduce_res_216718;\n        double c2_216771 = x_216769 - y_216770;\n        double x_216772 = defunc_2_reduce_res_216715 * a12_216760;\n        double y_216773 = defunc_2_reduce_res_216716 * b12_216763;\n        double x_216774 = x_216772 + y_216773;\n        double y_216775 = defunc_2_reduce_res_216717 * c12_216766;\n        double y_216776 = x_216774 + y_216775;\n        double det_216777 = 1.0 / y_216776;\n        double a12_216778 = a12_216760 * det_216777;\n        double b12_216779 = b12_216763 * det_216777;\n        double c12_216780 = c12_216766 * det_216777;\n        double b2_216781 = b2_216768 * det_216777;\n        double c2_216782 = c2_216771 * det_216777;\n        int64_t defunc_0_m_fun_res_216783;\n        \n        if (cond_216705) {\n            defunc_0_m_fun_res_216783 = (int64_t) 0;\n        } else {\n            int64_t y_216784 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_216785 = gtid_216696 == y_216784;\n            int64_t defunc_0_m_fun_res_f_res_216786;\n            \n            if (cond_216785)",
                   " {\n                int64_t defunc_0_m_fun_res_f_res_t_res_216787 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_216786 =\n                    defunc_0_m_fun_res_f_res_t_res_216787;\n            } else {\n                int64_t x_216788 = sub64(gtid_216696, (int64_t) 1);\n                int64_t x_216789 = mul64(jump_s_203581, x_216788);\n                int64_t min_arg_216790 = add64((int64_t) 1, x_216789);\n                int64_t min_res_216791 = smin64(defunc_0_f_res_203721,\n                                                min_arg_216790);\n                \n                defunc_0_m_fun_res_f_res_216786 = min_res_216791;\n            }\n            defunc_0_m_fun_res_216783 = defunc_0_m_fun_res_f_res_216786;\n        }\n        \n        double defunc_2_reduce_res_216792;\n        double defunc_2_reduce_res_216793;\n        double redout_228670;\n        double redout_228671;\n        \n        redout_228670 = 0.0;\n        redout_228671 = 0.0;\n        for (int64_t i_228672 = 0; i_228672 < q_s_203575; i_228672++) {\n            bool cond_216801 = sle64(x_216701, i_228672);\n            int64_t defunc_0_f_res_216802;\n            \n            if (cond_216801) {\n                defunc_0_f_res_216802 = (int64_t) 0;\n            } else {\n                int64_t i_216803 = add64(x_216703, i_228672);\n                int64_t defunc_0_add_arg_216804;\n                \n                defunc_0_add_arg_216804 = ((__global\n                                            int64_t *) ext_mem_229373)[gtid_216694 *\n                                                                       (defunc_0_f_res_203721 *\n                                                                        n_p_203574) +\n                                                                       gtid_216695 *\n                                                                       defunc_0_f_res_203721 +\n                                                           ",
                   "            i_216803];\n                \n                int64_t defunc_1_add_res_216805 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_216804);\n                \n                defunc_0_f_res_216802 = defunc_1_add_res_216805;\n            }\n            \n            double defunc_0_f_res_216806;\n            \n            if (cond_216801) {\n                defunc_0_f_res_216806 = 0.0;\n            } else {\n                int64_t i_216807 = add64(x_216703, i_228672);\n                double defunc_0_add_arg_216808;\n                \n                defunc_0_add_arg_216808 = ((__global\n                                            double *) mem_229639)[gtid_216694 *\n                                                                  (defunc_0_f_res_203721 *\n                                                                   n_p_203574) +\n                                                                  gtid_216695 *\n                                                                  defunc_0_f_res_203721 +\n                                                                  i_216807];\n                defunc_0_f_res_216806 = defunc_0_add_arg_216808;\n            }\n            \n            int64_t binop_p_216809 = sub64(defunc_0_f_res_216802,\n                                           defunc_0_m_fun_res_216783);\n            double defunc_0_f_res_216810 = sitofp_i64_f64(binop_p_216809);\n            double abs_res_216811 = fabs(defunc_0_f_res_216810);\n            double tmp1_216812 = abs_res_216811 / x_216704;\n            double x_216813 = tmp1_216812 * tmp1_216812;\n            double y_216814 = tmp1_216812 * x_216813;\n            double tmp2_216815 = 1.0 - y_216814;\n            double x_216816 = tmp2_216815 * tmp2_216815;\n            double tmp3_216817 = tmp2_216815 * x_216816;\n            double tmp4_216818 = defunc_0_f_res_216806 * tmp3_216817;\n            double defunc_1_f_res_216819 = defunc_0_f_res_216810 * tmp4_216818;\n            doub",
                   "le defunc_1_f_res_216820 = defunc_0_f_res_216810 *\n                   defunc_1_f_res_216819;\n            double defunc_0_f_res_216821;\n            \n            if (cond_216801) {\n                defunc_0_f_res_216821 = 0.0;\n            } else {\n                int64_t i_216822 = add64(x_216703, i_228672);\n                double defunc_0_add_arg_216823;\n                \n                defunc_0_add_arg_216823 = ((__global\n                                            double *) mem_229634)[gtid_216694 *\n                                                                  (defunc_0_f_res_203721 *\n                                                                   n_p_203574) +\n                                                                  gtid_216695 *\n                                                                  defunc_0_f_res_203721 +\n                                                                  i_216822];\n                defunc_0_f_res_216821 = defunc_0_add_arg_216823;\n            }\n            \n            double x_216824 = a12_216778 * tmp4_216818;\n            double y_216825 = b12_216779 * defunc_1_f_res_216819;\n            double x_216826 = x_216824 + y_216825;\n            double y_216827 = c12_216780 * defunc_1_f_res_216820;\n            double x_216828 = x_216826 + y_216827;\n            double defunc_9_fit_fun_res_216829 = defunc_0_f_res_216821 *\n                   x_216828;\n            double x_216830 = b12_216779 * tmp4_216818;\n            double y_216831 = b2_216781 * defunc_1_f_res_216819;\n            double x_216832 = x_216830 + y_216831;\n            double y_216833 = c2_216782 * defunc_1_f_res_216820;\n            double x_216834 = x_216832 + y_216833;\n            double defunc_9_slope_fun_res_216835 = defunc_0_f_res_216821 *\n                   x_216834;\n            double defunc_1_op_res_216796 = defunc_9_fit_fun_res_216829 +\n                   redout_228670;\n            double defunc_1_op_res_216799 = defunc_9_slope_fun_res_216835 +\n                ",
                   "   redout_228671;\n            double redout_tmp_233846 = defunc_1_op_res_216796;\n            double redout_tmp_233847 = defunc_1_op_res_216799;\n            \n            redout_228670 = redout_tmp_233846;\n            redout_228671 = redout_tmp_233847;\n        }\n        defunc_2_reduce_res_216792 = redout_228670;\n        defunc_2_reduce_res_216793 = redout_228671;\n        ((__global double *) mem_230409)[gtid_216694 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_216695 * s_n_m_203726 +\n                                         gtid_216696] =\n            defunc_2_reduce_res_216792;\n        ((__global double *) mem_230414)[gtid_216694 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_216695 * s_n_m_203726 +\n                                         gtid_216696] =\n            defunc_2_reduce_res_216793;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_216684\n}\n__kernel void mainzisegmap_216846(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726, __global\n                                  unsigned char *mem_230420, __global\n                                  unsigned char *mem_230424)\n{\n    #define segmap_group_sizze_216839 (mainzisegmap_group_sizze_215674)\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_233848;\n    int32_t local_tid_233849;\n    int64_t group_sizze_233852;\n    int32_t wave_sizze_233851;\n    int32_t group_tid_233850;\n    \n    global_tid_233848 = get_global",
                   "_id(0);\n    local_tid_233849 = get_local_id(0);\n    group_sizze_233852 = get_local_size(0);\n    wave_sizze_233851 = LOCKSTEP_WIDTH;\n    group_tid_233850 = get_group_id(0);\n    \n    int32_t phys_tid_216846 = global_tid_233848;\n    int64_t global_tid_233853 = sext_i32_i64(group_tid_233850) *\n            segmap_group_sizze_216839 + sext_i32_i64(local_tid_233849);\n    int64_t slice_233854 = s_n_m_203726;\n    int64_t slice_233855 = n_p_203574 * slice_233854;\n    int64_t slice_233856 = partition_sizze_203667 * slice_233855;\n    int64_t gtid_216843 = squot64(global_tid_233853, slice_233855);\n    int64_t remnant_233857 = global_tid_233853 - gtid_216843 * slice_233855;\n    int64_t gtid_216844 = squot64(remnant_233857, slice_233854);\n    int64_t remnant_233858 = remnant_233857 - gtid_216844 * slice_233854;\n    int64_t gtid_216845 = remnant_233858;\n    int64_t remnant_233859 = remnant_233858 - gtid_216845;\n    \n    if ((slt64(gtid_216843, partition_sizze_203667) && slt64(gtid_216844,\n                                                             n_p_203574)) &&\n        slt64(gtid_216845, s_n_m_203726)) {\n        bool cond_216848 = gtid_216845 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_216849;\n        \n        if (cond_216848) {\n            defunc_0_m_fun_res_216849 = (int64_t) 0;\n        } else {\n            int64_t y_216850 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_216851 = gtid_216845 == y_216850;\n            int64_t defunc_0_m_fun_res_f_res_216852;\n            \n            if (cond_216851) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_216853 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_216852 =\n                    defunc_0_m_fun_res_f_res_t_res_216853;\n            } else {\n                int64_t x_216854 = sub64(gtid_216845, (int64_t) 1);\n                int64_t x_216855 = mul64(jump_s_203581, x_216854);\n                int64_t min_arg_216856 = add64((int64_t) 1,",
                   " x_216855);\n                int64_t min_res_216857 = smin64(defunc_0_f_res_203721,\n                                                min_arg_216856);\n                \n                defunc_0_m_fun_res_f_res_216852 = min_res_216857;\n            }\n            defunc_0_m_fun_res_216849 = defunc_0_m_fun_res_f_res_216852;\n        }\n        ((__global int64_t *) mem_230420)[gtid_216843 * (s_n_m_203726 *\n                                                         n_p_203574) +\n                                          gtid_216844 * s_n_m_203726 +\n                                          gtid_216845] =\n            defunc_0_m_fun_res_216849;\n        ((__global bool *) mem_230424)[gtid_216843 * (s_n_m_203726 *\n                                                      n_p_203574) +\n                                       gtid_216844 * s_n_m_203726 +\n                                       gtid_216845] = cond_216848;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_216839\n}\n__kernel void mainzisegmap_216942(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726, __global\n                                  unsigned char *mem_230430, __global\n                                  unsigned char *mem_230435, __global\n                                  unsigned char *mem_230440, __global\n                                  unsigned char *mem_230445, __global\n                                  unsigned char *mem_230450, __global\n                                  unsigned char *mem_230456, __global\n                                  unsigned char *mem_230461, __global\n                                  unsigned char *mem_230466, __global\n                                  unsigned char *mem_23047",
                   "1, __global\n                                  unsigned char *mem_230476, __global\n                                  unsigned char *mem_230481)\n{\n    #define segmap_group_sizze_216931 (mainzisegmap_group_sizze_215544)\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_233992;\n    int32_t local_tid_233993;\n    int64_t group_sizze_233996;\n    int32_t wave_sizze_233995;\n    int32_t group_tid_233994;\n    \n    global_tid_233992 = get_global_id(0);\n    local_tid_233993 = get_local_id(0);\n    group_sizze_233996 = get_local_size(0);\n    wave_sizze_233995 = LOCKSTEP_WIDTH;\n    group_tid_233994 = get_group_id(0);\n    \n    int32_t phys_tid_216942 = global_tid_233992;\n    int64_t global_tid_233997 = sext_i32_i64(group_tid_233994) *\n            segmap_group_sizze_216931 + sext_i32_i64(local_tid_233993);\n    int64_t slice_233998 = s_n_m_203726;\n    int64_t slice_233999 = n_p_203574 * slice_233998;\n    int64_t slice_234000 = partition_sizze_203667 * slice_233999;\n    int64_t gtid_216939 = squot64(global_tid_233997, slice_233999);\n    int64_t remnant_234001 = global_tid_233997 - gtid_216939 * slice_233999;\n    int64_t gtid_216940 = squot64(remnant_234001, slice_233998);\n    int64_t remnant_234002 = remnant_234001 - gtid_216940 * slice_233998;\n    int64_t gtid_216941 = remnant_234002;\n    int64_t remnant_234003 = remnant_234002 - gtid_216941;\n    \n    if ((slt64(gtid_216939, partition_sizze_203667) && slt64(gtid_216940,\n                                                             n_p_203574)) &&\n        slt64(gtid_216941, s_n_m_203726)) {\n        bool index_primexp_228820 = gtid_216941 == (int64_t) 0;\n        double defunc_2_reduce_res_216945;\n        \n        defunc_2_reduce_res_216945 = ((__global\n                                       double *) mem_230430)[gtid_216939 *\n                                                             (s_n_m_203726 *\n              ",
                   "                                                n_p_203574) +\n                                                             gtid_216940 *\n                                                             s_n_m_203726 +\n                                                             gtid_216941];\n        \n        double defunc_2_reduce_res_216946;\n        \n        defunc_2_reduce_res_216946 = ((__global\n                                       double *) mem_230435)[gtid_216939 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_216940 *\n                                                             s_n_m_203726 +\n                                                             gtid_216941];\n        \n        double defunc_2_reduce_res_216947;\n        \n        defunc_2_reduce_res_216947 = ((__global\n                                       double *) mem_230440)[gtid_216939 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_216940 *\n                                                             s_n_m_203726 +\n                                                             gtid_216941];\n        \n        double defunc_2_reduce_res_216948;\n        \n        defunc_2_reduce_res_216948 = ((__global\n                                       double *) mem_230445)[gtid_216939 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_216940 *\n                                                             s_n_m_203726 +\n                                                             gtid_216941];\n        \n        double",
                   " defunc_2_reduce_res_216949;\n        \n        defunc_2_reduce_res_216949 = ((__global\n                                       double *) mem_230450)[gtid_216939 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_216940 *\n                                                             s_n_m_203726 +\n                                                             gtid_216941];\n        \n        double x_216950 = defunc_2_reduce_res_216947 *\n               defunc_2_reduce_res_216949;\n        double y_216951 = defunc_2_reduce_res_216948 *\n               defunc_2_reduce_res_216948;\n        double a12_216952 = x_216950 - y_216951;\n        double x_216953 = defunc_2_reduce_res_216947 *\n               defunc_2_reduce_res_216948;\n        double y_216954 = defunc_2_reduce_res_216946 *\n               defunc_2_reduce_res_216949;\n        double b12_216955 = x_216953 - y_216954;\n        double x_216956 = defunc_2_reduce_res_216946 *\n               defunc_2_reduce_res_216948;\n        double y_216957 = defunc_2_reduce_res_216947 *\n               defunc_2_reduce_res_216947;\n        double c12_216958 = x_216956 - y_216957;\n        double x_216959 = defunc_2_reduce_res_216945 *\n               defunc_2_reduce_res_216949;\n        double b2_216960 = x_216959 - y_216957;\n        double x_216961 = defunc_2_reduce_res_216946 *\n               defunc_2_reduce_res_216947;\n        double y_216962 = defunc_2_reduce_res_216945 *\n               defunc_2_reduce_res_216948;\n        double c2_216963 = x_216961 - y_216962;\n        double x_216964 = defunc_2_reduce_res_216945 * a12_216952;\n        double y_216965 = defunc_2_reduce_res_216946 * b12_216955;\n        double x_216966 = x_216964 + y_216965;\n        double y_216967 = defunc_2_reduce_res_216947 * c12_216958;\n        double y_216968 = x_216966 + y_216967;\n        double det_216969 = 1.0",
                   " / y_216968;\n        double a12_216970 = a12_216952 * det_216969;\n        double b12_216971 = b12_216955 * det_216969;\n        double c12_216972 = c12_216958 * det_216969;\n        double b2_216973 = b2_216960 * det_216969;\n        double c2_216974 = c2_216963 * det_216969;\n        int64_t defunc_0_m_fun_res_216975;\n        \n        if (index_primexp_228820) {\n            defunc_0_m_fun_res_216975 = (int64_t) 0;\n        } else {\n            int64_t y_216976 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_216977 = gtid_216941 == y_216976;\n            int64_t defunc_0_m_fun_res_f_res_216978;\n            \n            if (cond_216977) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_216979 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_216978 =\n                    defunc_0_m_fun_res_f_res_t_res_216979;\n            } else {\n                int64_t x_216980 = sub64(gtid_216941, (int64_t) 1);\n                int64_t x_216981 = mul64(jump_s_203581, x_216980);\n                int64_t min_arg_216982 = add64((int64_t) 1, x_216981);\n                int64_t min_res_216983 = smin64(defunc_0_f_res_203721,\n                                                min_arg_216982);\n                \n                defunc_0_m_fun_res_f_res_216978 = min_res_216983;\n            }\n            defunc_0_m_fun_res_216975 = defunc_0_m_fun_res_f_res_216978;\n        }\n        ((__global double *) mem_230456)[gtid_216939 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_216940 * s_n_m_203726 +\n                                         gtid_216941] = a12_216970;\n        ((__global double *) mem_230461)[gtid_216939 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_216940 * s_n_m_203726 +\n                                         gtid_216941] = b12_216",
                   "971;\n        ((__global double *) mem_230466)[gtid_216939 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_216940 * s_n_m_203726 +\n                                         gtid_216941] = c12_216972;\n        ((__global double *) mem_230471)[gtid_216939 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_216940 * s_n_m_203726 +\n                                         gtid_216941] = b2_216973;\n        ((__global double *) mem_230476)[gtid_216939 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_216940 * s_n_m_203726 +\n                                         gtid_216941] = c2_216974;\n        ((__global int64_t *) mem_230481)[gtid_216939 * (s_n_m_203726 *\n                                                         n_p_203574) +\n                                          gtid_216940 * s_n_m_203726 +\n                                          gtid_216941] =\n            defunc_0_m_fun_res_216975;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_216931\n}\n__kernel void mainzisegmap_218503(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_p_203574, int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726, __global\n                                  unsigned char *ext_mem_230594, __global\n                                  unsigned char *ext_mem_230595, __global\n                                  unsigned char *mem_230601)\n{\n    #define segmap_group_sizze_218",
                   "497 (mainzisegmap_group_sizze_218205)\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_234180;\n    int32_t local_tid_234181;\n    int64_t group_sizze_234184;\n    int32_t wave_sizze_234183;\n    int32_t group_tid_234182;\n    \n    global_tid_234180 = get_global_id(0);\n    local_tid_234181 = get_local_id(0);\n    group_sizze_234184 = get_local_size(0);\n    wave_sizze_234183 = LOCKSTEP_WIDTH;\n    group_tid_234182 = get_group_id(0);\n    \n    int32_t phys_tid_218503 = global_tid_234180;\n    int64_t global_tid_234185 = sext_i32_i64(group_tid_234182) *\n            segmap_group_sizze_218497 + sext_i32_i64(local_tid_234181);\n    int64_t slice_234186 = pad_css_len_203722;\n    int64_t slice_234187 = n_p_203574 * slice_234186;\n    int64_t slice_234188 = partition_sizze_203667 * slice_234187;\n    int64_t gtid_218500 = squot64(global_tid_234185, slice_234187);\n    int64_t remnant_234189 = global_tid_234185 - gtid_218500 * slice_234187;\n    int64_t gtid_218501 = squot64(remnant_234189, slice_234186);\n    int64_t remnant_234190 = remnant_234189 - gtid_218501 * slice_234186;\n    int64_t gtid_218502 = remnant_234190;\n    int64_t remnant_234191 = remnant_234190 - gtid_218502;\n    \n    if ((slt64(gtid_218500, partition_sizze_203667) && slt64(gtid_218501,\n                                                             n_p_203574)) &&\n        slt64(gtid_218502, pad_css_len_203722)) {\n        bool cond_218507 = gtid_218502 == (int64_t) 0;\n        double defunc_0_f_res_218508;\n        \n        if (cond_218507) {\n            bool y_218509 = slt64((int64_t) 0, s_n_m_203726);\n            bool index_certs_218510;\n            \n            if (!y_218509) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 38) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) (int64_t) 0;\n                        global",
                   "_failure_args[1] = (int64_t) s_n_m_203726;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double head_res_218511;\n            \n            head_res_218511 = ((__global double *) ext_mem_230595)[gtid_218500 *\n                                                                   (s_n_m_203726 *\n                                                                    n_p_203574) +\n                                                                   gtid_218501 *\n                                                                   s_n_m_203726];\n            defunc_0_f_res_218508 = head_res_218511;\n        } else {\n            int64_t y_218512 = sub64(pad_css_len_203722, (int64_t) 1);\n            bool cond_218513 = gtid_218502 == y_218512;\n            double defunc_0_f_res_f_res_218514;\n            \n            if (cond_218513) {\n                int64_t i_218515 = sub64(s_n_m_203726, (int64_t) 1);\n                bool x_218516 = sle64((int64_t) 0, i_218515);\n                bool y_218517 = slt64(i_218515, s_n_m_203726);\n                bool bounds_check_218518 = x_218516 && y_218517;\n                bool index_certs_218519;\n                \n                if (!bounds_check_218518) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 39) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) i_218515;\n                            global_failure_args[1] = (int64_t) s_n_m_203726;\n                            ;\n                        }\n                        return;\n                    }\n                }\n                \n                double last_res_218520;\n                \n                last_res_218520 = ((__global\n                                    double *) ext_mem_230595)[gtid_218500 *\n                                                              (s_n_m_203726 *\n                                        ",
                   "                       n_p_203574) +\n                                                              gtid_218501 *\n                                                              s_n_m_203726 +\n                                                              i_218515];\n                defunc_0_f_res_f_res_218514 = last_res_218520;\n            } else {\n                int64_t x_218521 = sub64(gtid_218502, (int64_t) 1);\n                bool zzero_218522 = jump_s_203581 == (int64_t) 0;\n                bool nonzzero_218523 = !zzero_218522;\n                bool nonzzero_cert_218524;\n                \n                if (!nonzzero_218523) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 40) ==\n                            -1) {\n                            ;\n                        }\n                        return;\n                    }\n                }\n                \n                int64_t x_218525 = sdiv64(x_218521, jump_s_203581);\n                int64_t m_v_218526 = add64((int64_t) 1, x_218525);\n                int64_t j_218527;\n                \n                if (cond_218507) {\n                    j_218527 = (int64_t) 0;\n                } else {\n                    int64_t y_218528 = sub64(s_n_m_203726, (int64_t) 1);\n                    bool cond_218529 = m_v_218526 == y_218528;\n                    int64_t j_f_res_218530;\n                    \n                    if (cond_218529) {\n                        j_f_res_218530 = x_218525;\n                    } else {\n                        j_f_res_218530 = m_v_218526;\n                    }\n                    j_218527 = j_f_res_218530;\n                }\n                \n                bool cond_218531 = j_218527 == (int64_t) 0;\n                int64_t defunc_0_m_fun_res_218532;\n                \n                if (cond_218531) {\n                    defunc_0_m_fun_res_218532 = (int64_t) 0;\n                } else {\n                    int64_t y_218533 = sub64(s_n_m_203726, (int64_t",
                   ") 1);\n                    bool cond_218534 = j_218527 == y_218533;\n                    int64_t defunc_0_m_fun_res_f_res_218535;\n                    \n                    if (cond_218534) {\n                        defunc_0_m_fun_res_f_res_218535 = y_218512;\n                    } else {\n                        int64_t x_218536 = sub64(j_218527, (int64_t) 1);\n                        int64_t x_218537 = mul64(jump_s_203581, x_218536);\n                        int64_t min_arg_218538 = add64((int64_t) 1, x_218537);\n                        int64_t min_res_218539 = smin64(defunc_0_f_res_203721,\n                                                        min_arg_218538);\n                        \n                        defunc_0_m_fun_res_f_res_218535 = min_res_218539;\n                    }\n                    defunc_0_m_fun_res_218532 = defunc_0_m_fun_res_f_res_218535;\n                }\n                \n                int64_t defunc_0_m_fun_arg_218540 = add64((int64_t) 1,\n                                                          j_218527);\n                bool cond_218541 = defunc_0_m_fun_arg_218540 == (int64_t) 0;\n                int64_t defunc_0_m_fun_res_218542;\n                \n                if (cond_218541) {\n                    defunc_0_m_fun_res_218542 = (int64_t) 0;\n                } else {\n                    int64_t y_218543 = sub64(s_n_m_203726, (int64_t) 1);\n                    bool cond_218544 = defunc_0_m_fun_arg_218540 == y_218543;\n                    int64_t defunc_0_m_fun_res_f_res_218545;\n                    \n                    if (cond_218544) {\n                        defunc_0_m_fun_res_f_res_218545 = y_218512;\n                    } else {\n                        int64_t x_218546 = mul64(jump_s_203581, j_218527);\n                        int64_t min_arg_218547 = add64((int64_t) 1, x_218546);\n                        int64_t min_res_218548 = smin64(defunc_0_f_res_203721,\n                                                        min_arg_218547);\n                  ",
                   "      \n                        defunc_0_m_fun_res_f_res_218545 = min_res_218548;\n                    }\n                    defunc_0_m_fun_res_218542 = defunc_0_m_fun_res_f_res_218545;\n                }\n                \n                int64_t i64_arg_218549 = sub64(defunc_0_m_fun_res_218542,\n                                               defunc_0_m_fun_res_218532);\n                double i64_res_218550 = sitofp_i64_f64(i64_arg_218549);\n                int64_t i64_arg_218551 = sub64(gtid_218502,\n                                               defunc_0_m_fun_res_218532);\n                double i64_res_218552 = sitofp_i64_f64(i64_arg_218551);\n                double u_218553 = i64_res_218552 / i64_res_218550;\n                double u2_218554 = u_218553 * u_218553;\n                double u3_218555 = u_218553 * u2_218554;\n                double x_218556 = 2.0 * u3_218555;\n                double y_218557 = 3.0 * u2_218554;\n                double x_218558 = x_218556 - y_218557;\n                double x_218559 = 1.0 + x_218558;\n                bool x_218560 = sle64((int64_t) 0, j_218527);\n                bool y_218561 = slt64(j_218527, s_n_m_203726);\n                bool bounds_check_218562 = x_218560 && y_218561;\n                bool index_certs_218563;\n                \n                if (!bounds_check_218562) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 41) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) j_218527;\n                            global_failure_args[1] = (int64_t) s_n_m_203726;\n                            ;\n                        }\n                        return;\n                    }\n                }\n                \n                double y_218564;\n                \n                y_218564 = ((__global double *) ext_mem_230595)[gtid_218500 *\n                                                                (s_n_m_203726 *\n                                  ",
                   "                               n_p_203574) +\n                                                                gtid_218501 *\n                                                                s_n_m_203726 +\n                                                                j_218527];\n                \n                double x_218565 = x_218559 * y_218564;\n                double x_218566 = y_218557 - x_218556;\n                bool x_218567 = sle64((int64_t) 0, defunc_0_m_fun_arg_218540);\n                bool y_218568 = slt64(defunc_0_m_fun_arg_218540, s_n_m_203726);\n                bool bounds_check_218569 = x_218567 && y_218568;\n                bool index_certs_218570;\n                \n                if (!bounds_check_218569) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 42) ==\n                            -1) {\n                            global_failure_args[0] =\n                                (int64_t) defunc_0_m_fun_arg_218540;\n                            global_failure_args[1] = (int64_t) s_n_m_203726;\n                            ;\n                        }\n                        return;\n                    }\n                }\n                \n                double y_218571;\n                \n                y_218571 = ((__global double *) ext_mem_230595)[gtid_218500 *\n                                                                (s_n_m_203726 *\n                                                                 n_p_203574) +\n                                                                gtid_218501 *\n                                                                s_n_m_203726 +\n                                                                defunc_0_m_fun_arg_218540];\n                \n                double y_218572 = x_218566 * y_218571;\n                double x_218573 = x_218565 + y_218572;\n                double y_218574 = 2.0 * u2_218554;\n                double x_218575 = u3_218555 - y_218574;\n                dou",
                   "ble x_218576 = u_218553 + x_218575;\n                double y_218577;\n                \n                y_218577 = ((__global double *) ext_mem_230594)[gtid_218500 *\n                                                                (s_n_m_203726 *\n                                                                 n_p_203574) +\n                                                                gtid_218501 *\n                                                                s_n_m_203726 +\n                                                                j_218527];\n                \n                double x_218578 = x_218576 * y_218577;\n                double y_218579 = i64_res_218550 * x_218578;\n                double x_218580 = x_218573 + y_218579;\n                double x_218581 = u3_218555 - u2_218554;\n                double y_218582;\n                \n                y_218582 = ((__global double *) ext_mem_230594)[gtid_218500 *\n                                                                (s_n_m_203726 *\n                                                                 n_p_203574) +\n                                                                gtid_218501 *\n                                                                s_n_m_203726 +\n                                                                defunc_0_m_fun_arg_218540];\n                \n                double x_218583 = x_218581 * y_218582;\n                double y_218584 = i64_res_218550 * x_218583;\n                double defunc_4_interpolate_proc_res_218585 = x_218580 +\n                       y_218584;\n                \n                defunc_0_f_res_f_res_218514 =\n                    defunc_4_interpolate_proc_res_218585;\n            }\n            defunc_0_f_res_218508 = defunc_0_f_res_f_res_218514;\n        }\n        ((__global double *) mem_230601)[gtid_218500 * (pad_css_len_203722 *\n                                                        n_p_203574) +\n                                         gtid_218501 * pad_css_len_2",
                   "03722 +\n                                         gtid_218502] = defunc_0_f_res_218508;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_218497\n}\n__kernel void mainzisegmap_218652(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_p_203574,\n                                  int64_t partition_sizze_203667,\n                                  int64_t C_len_203724,\n                                  int64_t css_results_l_204200, __global\n                                  unsigned char *ext_mem_230602, __global\n                                  unsigned char *mem_230608)\n{\n    #define segmap_group_sizze_218647 (mainzisegmap_group_sizze_218601)\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_234192;\n    int32_t local_tid_234193;\n    int64_t group_sizze_234196;\n    int32_t wave_sizze_234195;\n    int32_t group_tid_234194;\n    \n    global_tid_234192 = get_global_id(0);\n    local_tid_234193 = get_local_id(0);\n    group_sizze_234196 = get_local_size(0);\n    wave_sizze_234195 = LOCKSTEP_WIDTH;\n    group_tid_234194 = get_group_id(0);\n    \n    int32_t phys_tid_218652 = global_tid_234192;\n    int64_t global_tid_234197 = sext_i32_i64(group_tid_234194) *\n            segmap_group_sizze_218647 + sext_i32_i64(local_tid_234193);\n    int64_t slice_234198 = C_len_203724;\n    int64_t slice_234199 = partition_sizze_203667 * slice_234198;\n    int64_t gtid_218650 = squot64(global_tid_234197, slice_234198);\n    int64_t remnant_234200 = global_tid_234197 - gtid_218650 * slice_234198;\n    int64_t gtid_218651 = remnant_234200;\n    int64_t remnant_234201 = remnant_234200 - gtid_218651;\n    \n    if (slt64(gtid_218650, partition_sizze_203667) && slt64(gtid_218651,\n                                               ",
                   "             C_len_203724)) {\n        int64_t i_218655 = smod64(gtid_218651, n_p_203574);\n        bool x_218656 = sle64((int64_t) 0, i_218655);\n        bool y_218657 = slt64(i_218655, n_p_203574);\n        bool bounds_check_218658 = x_218656 && y_218657;\n        int64_t i_218659 = sdiv64(gtid_218651, n_p_203574);\n        bool x_218660 = sle64((int64_t) 0, i_218659);\n        bool y_218661 = slt64(i_218659, css_results_l_204200);\n        bool bounds_check_218662 = x_218660 && y_218661;\n        bool index_ok_218663 = bounds_check_218658 && bounds_check_218662;\n        bool index_certs_218664;\n        \n        if (!index_ok_218663) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 43) == -1) {\n                    global_failure_args[0] = (int64_t) i_218655;\n                    global_failure_args[1] = (int64_t) i_218659;\n                    global_failure_args[2] = (int64_t) n_p_203574;\n                    global_failure_args[3] = (int64_t) css_results_l_204200;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        double defunc_0_f_res_218665;\n        \n        defunc_0_f_res_218665 = ((__global\n                                  double *) ext_mem_230602)[gtid_218650 *\n                                                            (css_results_l_204200 *\n                                                             n_p_203574) +\n                                                            i_218655 *\n                                                            css_results_l_204200 +\n                                                            i_218659];\n        ((__global double *) mem_230608)[gtid_218650 * C_len_203724 +\n                                         gtid_218651] = defunc_0_f_res_218665;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_218647\n}\n__kernel void mainzisegmap_218688(__global int *global_failure,\n                                  int64_t n_p_203574,\n           ",
                   "                       int64_t partition_sizze_203667, __global\n                                  unsigned char *mem_230611, __global\n                                  unsigned char *mem_230615)\n{\n    #define segmap_group_sizze_218684 (mainzisegmap_group_sizze_218672)\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_234202;\n    int32_t local_tid_234203;\n    int64_t group_sizze_234206;\n    int32_t wave_sizze_234205;\n    int32_t group_tid_234204;\n    \n    global_tid_234202 = get_global_id(0);\n    local_tid_234203 = get_local_id(0);\n    group_sizze_234206 = get_local_size(0);\n    wave_sizze_234205 = LOCKSTEP_WIDTH;\n    group_tid_234204 = get_group_id(0);\n    \n    int32_t phys_tid_218688 = global_tid_234202;\n    int64_t global_tid_234207 = sext_i32_i64(group_tid_234204) *\n            segmap_group_sizze_218684 + sext_i32_i64(local_tid_234203);\n    int64_t slice_234208 = partition_sizze_203667;\n    int64_t gtid_218687 = global_tid_234207;\n    int64_t remnant_234209 = global_tid_234207 - gtid_218687;\n    \n    if (slt64(gtid_218687, partition_sizze_203667)) {\n        double defunc_2_reduce_res_218690;\n        double redout_229071 = 0.0;\n        \n        for (int64_t i_229072 = 0; i_229072 < n_p_203574; i_229072++) {\n            double x_218694;\n            \n            x_218694 = ((__global double *) mem_230611)[i_229072 *\n                                                        partition_sizze_203667 +\n                                                        gtid_218687];\n            \n            double defunc_1_op_res_218693 = x_218694 + redout_229071;\n            double redout_tmp_234210 = defunc_1_op_res_218693;\n            \n            redout_229071 = redout_tmp_234210;\n        }\n        defunc_2_reduce_res_218690 = redout_229071;\n        ((__global double *) mem_230615)[gtid_218687] =\n            defunc_2_reduce_res_218690;\n    }\n    \n  error_0:\n ",
                   "   return;\n    #undef segmap_group_sizze_218684\n}\n__kernel void mainzisegmap_218819(__global int *global_failure,\n                                  int64_t n_p_203574,\n                                  int64_t partition_sizze_203667, __global\n                                  unsigned char *mem_230628, __global\n                                  unsigned char *mem_230632)\n{\n    #define segmap_group_sizze_218815 (mainzisegmap_group_sizze_218803)\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_234345;\n    int32_t local_tid_234346;\n    int64_t group_sizze_234349;\n    int32_t wave_sizze_234348;\n    int32_t group_tid_234347;\n    \n    global_tid_234345 = get_global_id(0);\n    local_tid_234346 = get_local_id(0);\n    group_sizze_234349 = get_local_size(0);\n    wave_sizze_234348 = LOCKSTEP_WIDTH;\n    group_tid_234347 = get_group_id(0);\n    \n    int32_t phys_tid_218819 = global_tid_234345;\n    int64_t global_tid_234350 = sext_i32_i64(group_tid_234347) *\n            segmap_group_sizze_218815 + sext_i32_i64(local_tid_234346);\n    int64_t slice_234351 = partition_sizze_203667;\n    int64_t gtid_218818 = global_tid_234350;\n    int64_t remnant_234352 = global_tid_234350 - gtid_218818;\n    \n    if (slt64(gtid_218818, partition_sizze_203667)) {\n        double defunc_2_reduce_res_218821;\n        double redout_229073 = 0.0;\n        \n        for (int64_t i_229074 = 0; i_229074 < n_p_203574; i_229074++) {\n            double x_218825;\n            \n            x_218825 = ((__global double *) mem_230628)[i_229074 *\n                                                        partition_sizze_203667 +\n                                                        gtid_218818];\n            \n            double defunc_1_op_res_218824 = x_218825 + redout_229073;\n            double redout_tmp_234353 = defunc_1_op_res_218824;\n            \n            redout_229073 = redout_tmp_234353;\n  ",
                   "      }\n        defunc_2_reduce_res_218821 = redout_229073;\n        ((__global double *) mem_230632)[gtid_218818] =\n            defunc_2_reduce_res_218821;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_218815\n}\n__kernel void mainzisegmap_218950(__global int *global_failure,\n                                  int64_t partition_sizze_203667, __global\n                                  unsigned char *mem_230645, __global\n                                  unsigned char *mem_230649)\n{\n    #define segmap_group_sizze_218946 (mainzisegmap_group_sizze_218934)\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_234488;\n    int32_t local_tid_234489;\n    int64_t group_sizze_234492;\n    int32_t wave_sizze_234491;\n    int32_t group_tid_234490;\n    \n    global_tid_234488 = get_global_id(0);\n    local_tid_234489 = get_local_id(0);\n    group_sizze_234492 = get_local_size(0);\n    wave_sizze_234491 = LOCKSTEP_WIDTH;\n    group_tid_234490 = get_group_id(0);\n    \n    int32_t phys_tid_218950 = global_tid_234488;\n    int64_t global_tid_234493 = sext_i32_i64(group_tid_234490) *\n            segmap_group_sizze_218946 + sext_i32_i64(local_tid_234489);\n    int64_t slice_234494 = partition_sizze_203667;\n    int64_t gtid_218949 = global_tid_234493;\n    int64_t remnant_234495 = global_tid_234493 - gtid_218949;\n    \n    if (slt64(gtid_218949, partition_sizze_203667)) {\n        double defunc_2_reduce_res_218952;\n        double redout_229075 = 0.0;\n        \n        for (int32_t i_229199 = 0; i_229199 < 3; i_229199++) {\n            int64_t i_229076 = sext_i32_i64(i_229199);\n            double x_218956;\n            \n            x_218956 = ((__global double *) mem_230645)[i_229076 *\n                                                        partition_sizze_203667 +\n                                                        gtid_218949];\n            \n            double defun",
                   "c_1_op_res_218955 = x_218956 + redout_229075;\n            double redout_tmp_234496 = defunc_1_op_res_218955;\n            \n            redout_229075 = redout_tmp_234496;\n        }\n        defunc_2_reduce_res_218952 = redout_229075;\n        ((__global double *) mem_230649)[gtid_218949] =\n            defunc_2_reduce_res_218952;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_218946\n}\n__kernel void mainzisegmap_219139(__global int *global_failure,\n                                  int64_t n_203572, int64_t q_l_203577,\n                                  int64_t jump_t_203582,\n                                  int64_t partition_sizze_203667,\n                                  int64_t l_n_m_203733, int64_t i_203760,\n                                  int64_t num_groups_219135,\n                                  int64_t num_threads_232269, __global\n                                  unsigned char *mem_230666, __global\n                                  unsigned char *mem_230669, __global\n                                  unsigned char *mem_230672, __global\n                                  unsigned char *mem_230675, __global\n                                  unsigned char *mem_230694, __global\n                                  unsigned char *color_232138)\n{\n    #define segmap_group_sizze_219134 (mainzisegmap_group_sizze_219065)\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_234646;\n    int32_t local_tid_234647;\n    int64_t group_sizze_234650;\n    int32_t wave_sizze_234649;\n    int32_t group_tid_234648;\n    \n    global_tid_234646 = get_global_id(0);\n    local_tid_234647 = get_local_id(0);\n    group_sizze_234650 = get_local_size(0);\n    wave_sizze_234649 = LOCKSTEP_WIDTH;\n    group_tid_234648 = get_group_id(0);\n    \n    int32_t phys_tid_219139 = global_tid_234646;\n    int32_t phys_group_id_234651;\n    \n    phys_group_id_234651 = get_group_id",
                   "(0);\n    for (int32_t i_234652 = 0; i_234652 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667,\n                                          segmap_group_sizze_219134)) -\n                   phys_group_id_234651, sext_i64_i32(num_groups_219135));\n         i_234652++) {\n        int32_t virt_group_id_234653 = phys_group_id_234651 + i_234652 *\n                sext_i64_i32(num_groups_219135);\n        int64_t global_tid_234654 = sext_i32_i64(virt_group_id_234653) *\n                segmap_group_sizze_219134 + sext_i32_i64(local_tid_234647);\n        int64_t slice_234655 = partition_sizze_203667;\n        int64_t gtid_219138 = global_tid_234654;\n        int64_t remnant_234656 = global_tid_234654 - gtid_219138;\n        \n        if (slt64(gtid_219138, partition_sizze_203667)) {\n            for (int64_t i_229079 = 0; i_229079 < l_n_m_203733; i_229079++) {\n                int64_t x_219146;\n                \n                x_219146 = ((__global int64_t *) mem_230666)[i_229079 *\n                                                             partition_sizze_203667 +\n                                                             gtid_219138];\n                \n                double x_219147;\n                \n                x_219147 = ((__global double *) mem_230669)[i_229079 *\n                                                            partition_sizze_203667 +\n                                                            gtid_219138];\n                \n                int64_t min_arg_219148 = mul64(jump_t_203582, i_229079);\n                int64_t min_res_219149 = smin64(i_203760, min_arg_219148);\n                int64_t defunc_0_g_res_219150 = add64((int64_t) 1,\n                                                      min_res_219149);\n                double defunc_2_reduce_res_219151;\n                double redout_228421 = 0.0;\n                \n                for (int64_t i_228422 = 0; i_228422 < q_l_203577; i_228422++) {\n                    bool cond_219156 = sle64(n_203572, ",
                   "i_228422);\n                    int64_t defunc_0_f_res_219157;\n                    \n                    if (cond_219156) {\n                        defunc_0_f_res_219157 = (int64_t) 0;\n                    } else {\n                        int64_t i_219158 = add64(x_219146, i_228422);\n                        int64_t defunc_1_add_res_219159 = add64((int64_t) 1,\n                                                                i_219158);\n                        \n                        defunc_0_f_res_219157 = defunc_1_add_res_219159;\n                    }\n                    \n                    double defunc_0_f_res_219160;\n                    \n                    if (cond_219156) {\n                        defunc_0_f_res_219160 = 0.0;\n                    } else {\n                        int64_t i_219161 = add64(x_219146, i_228422);\n                        double defunc_0_add_arg_219162;\n                        \n                        defunc_0_add_arg_219162 = ((__global\n                                                    double *) mem_230672)[i_219161 *\n                                                                          partition_sizze_203667 +\n                                                                          gtid_219138];\n                        defunc_0_f_res_219160 = defunc_0_add_arg_219162;\n                    }\n                    \n                    int64_t binop_p_219163 = sub64(defunc_0_f_res_219157,\n                                                   defunc_0_g_res_219150);\n                    double defunc_0_f_res_219164 =\n                           sitofp_i64_f64(binop_p_219163);\n                    double abs_res_219165 = fabs(defunc_0_f_res_219164);\n                    double tmp1_219166 = abs_res_219165 / x_219147;\n                    double x_219167 = tmp1_219166 * tmp1_219166;\n                    double y_219168 = tmp1_219166 * x_219167;\n                    double tmp2_219169 = 1.0 - y_219168;\n                    double x_219170 = tmp2_219169",
                   " * tmp2_219169;\n                    double tmp3_219171 = tmp2_219169 * x_219170;\n                    double w_j_219172 = defunc_0_f_res_219160 * tmp3_219171;\n                    double defunc_1_op_res_219154 = w_j_219172 + redout_228421;\n                    double redout_tmp_234658 = defunc_1_op_res_219154;\n                    \n                    redout_228421 = redout_tmp_234658;\n                }\n                defunc_2_reduce_res_219151 = redout_228421;\n                \n                double a0_219173 = 1.0 / defunc_2_reduce_res_219151;\n                double defunc_2_reduce_res_219174;\n                double redout_228423 = 0.0;\n                \n                for (int64_t i_228424 = 0; i_228424 < q_l_203577; i_228424++) {\n                    bool cond_219179 = sle64(n_203572, i_228424);\n                    int64_t defunc_0_f_res_219180;\n                    \n                    if (cond_219179) {\n                        defunc_0_f_res_219180 = (int64_t) 0;\n                    } else {\n                        int64_t i_219181 = add64(x_219146, i_228424);\n                        int64_t defunc_1_add_res_219182 = add64((int64_t) 1,\n                                                                i_219181);\n                        \n                        defunc_0_f_res_219180 = defunc_1_add_res_219182;\n                    }\n                    \n                    double defunc_0_f_res_219183;\n                    \n                    if (cond_219179) {\n                        defunc_0_f_res_219183 = 0.0;\n                    } else {\n                        int64_t i_219184 = add64(x_219146, i_228424);\n                        double defunc_0_add_arg_219185;\n                        \n                        defunc_0_add_arg_219185 = ((__global\n                                                    double *) mem_230672)[i_219184 *\n                                                                          partition_sizze_203667 +\n                                         ",
                   "                                 gtid_219138];\n                        defunc_0_f_res_219183 = defunc_0_add_arg_219185;\n                    }\n                    \n                    int64_t binop_p_219186 = sub64(defunc_0_f_res_219180,\n                                                   defunc_0_g_res_219150);\n                    double defunc_0_f_res_219187 =\n                           sitofp_i64_f64(binop_p_219186);\n                    double abs_res_219188 = fabs(defunc_0_f_res_219187);\n                    double tmp1_219189 = abs_res_219188 / x_219147;\n                    double x_219190 = tmp1_219189 * tmp1_219189;\n                    double y_219191 = tmp1_219189 * x_219190;\n                    double tmp2_219192 = 1.0 - y_219191;\n                    double x_219193 = tmp2_219192 * tmp2_219192;\n                    double tmp3_219194 = tmp2_219192 * x_219193;\n                    double tmp4_219195 = defunc_0_f_res_219183 * tmp3_219194;\n                    double defunc_0_f_res_219196;\n                    \n                    if (cond_219179) {\n                        defunc_0_f_res_219196 = 0.0;\n                    } else {\n                        int64_t i_219197 = add64(x_219146, i_228424);\n                        double defunc_0_add_arg_219198;\n                        \n                        defunc_0_add_arg_219198 = ((__global\n                                                    double *) mem_230675)[i_219197 *\n                                                                          partition_sizze_203667 +\n                                                                          gtid_219138];\n                        defunc_0_f_res_219196 = defunc_0_add_arg_219198;\n                    }\n                    \n                    double x_219199 = a0_219173 * tmp4_219195;\n                    double defunc_9_fit_fun_res_219200 = defunc_0_f_res_219196 *\n                           x_219199;\n                    double defunc_1_op_res_219177 =\n                    ",
                   "       defunc_9_fit_fun_res_219200 + redout_228423;\n                    double redout_tmp_234659 = defunc_1_op_res_219177;\n                    \n                    redout_228423 = redout_tmp_234659;\n                }\n                defunc_2_reduce_res_219174 = redout_228423;\n                ((__global double *) color_232138)[phys_tid_219139 + i_229079 *\n                                                   num_threads_232269] =\n                    defunc_2_reduce_res_219174;\n            }\n            for (int64_t i_234660 = 0; i_234660 < l_n_m_203733; i_234660++) {\n                double tmp_234661;\n                \n                tmp_234661 = ((__global\n                               double *) color_232138)[phys_tid_219139 +\n                                                       i_234660 *\n                                                       num_threads_232269];\n                ((__global double *) mem_230694)[gtid_219138 + i_234660 *\n                                                 partition_sizze_203667] =\n                    tmp_234661;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_219134\n}\n__kernel void mainzisegmap_219524(__global int *global_failure,\n                                  int64_t n_203572, int64_t q_l_203577,\n                                  int64_t jump_t_203582,\n                                  int64_t partition_sizze_203667,\n                                  int64_t l_n_m_203733, int64_t i_203760,\n                                  int64_t ctx_param_ext_229596,\n                                  int64_t ctx_param_ext_229597,\n                                  int64_t ctx_param_ext_229599, __global\n                                  unsigned char *ext_mem_229519, __global\n                                  unsigned char *ext_mem_229520, __global\n                                  unsigned char *mem_param_229601, __global\n                          ",
                   "        unsigned char *mem_230659, __global\n                                  unsigned char *mem_230699)\n{\n    #define segmap_group_sizze_219515 (mainzisegmap_group_sizze_219206)\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_234662;\n    int32_t local_tid_234663;\n    int64_t group_sizze_234666;\n    int32_t wave_sizze_234665;\n    int32_t group_tid_234664;\n    \n    global_tid_234662 = get_global_id(0);\n    local_tid_234663 = get_local_id(0);\n    group_sizze_234666 = get_local_size(0);\n    wave_sizze_234665 = LOCKSTEP_WIDTH;\n    group_tid_234664 = get_group_id(0);\n    \n    int32_t phys_tid_219524 = global_tid_234662;\n    int64_t global_tid_234667 = sext_i32_i64(group_tid_234664) *\n            segmap_group_sizze_219515 + sext_i32_i64(local_tid_234663);\n    int64_t slice_234668 = l_n_m_203733;\n    int64_t slice_234669 = partition_sizze_203667 * slice_234668;\n    int64_t gtid_219522 = squot64(global_tid_234667, slice_234668);\n    int64_t remnant_234670 = global_tid_234667 - gtid_219522 * slice_234668;\n    int64_t gtid_219523 = remnant_234670;\n    int64_t remnant_234671 = remnant_234670 - gtid_219523;\n    \n    if (slt64(gtid_219522, partition_sizze_203667) && slt64(gtid_219523,\n                                                            l_n_m_203733)) {\n        int64_t x_219528;\n        \n        x_219528 = ((__global int64_t *) ext_mem_229520)[gtid_219522 *\n                                                         l_n_m_203733 +\n                                                         gtid_219523];\n        \n        double x_219529;\n        \n        x_219529 = ((__global double *) ext_mem_229519)[gtid_219522 *\n                                                        l_n_m_203733 +\n                                                        gtid_219523];\n        \n        int64_t min_arg_219530 = mul64(jump_t_203582, gtid_219523);\n        int64_t min_res_21",
                   "9531 = smin64(i_203760, min_arg_219530);\n        int64_t defunc_0_g_res_219532 = add64((int64_t) 1, min_res_219531);\n        double defunc_2_reduce_res_219533;\n        double redout_228429 = 0.0;\n        \n        for (int64_t i_228430 = 0; i_228430 < q_l_203577; i_228430++) {\n            bool cond_219538 = sle64(n_203572, i_228430);\n            int64_t defunc_0_f_res_219539;\n            \n            if (cond_219538) {\n                defunc_0_f_res_219539 = (int64_t) 0;\n            } else {\n                int64_t i_219540 = add64(x_219528, i_228430);\n                int64_t defunc_1_add_res_219541 = add64((int64_t) 1, i_219540);\n                \n                defunc_0_f_res_219539 = defunc_1_add_res_219541;\n            }\n            \n            double defunc_0_f_res_219542;\n            \n            if (cond_219538) {\n                defunc_0_f_res_219542 = 0.0;\n            } else {\n                int64_t i_219543 = add64(x_219528, i_228430);\n                double defunc_0_add_arg_219544;\n                \n                defunc_0_add_arg_219544 = ((__global\n                                            double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                        (gtid_219522 *\n                                                                         ctx_param_ext_229597 +\n                                                                         i_219543 *\n                                                                         ctx_param_ext_229599)];\n                defunc_0_f_res_219542 = defunc_0_add_arg_219544;\n            }\n            \n            int64_t binop_p_219545 = sub64(defunc_0_f_res_219539,\n                                           defunc_0_g_res_219532);\n            double defunc_0_f_res_219546 = sitofp_i64_f64(binop_p_219545);\n            double abs_res_219547 = fabs(defunc_0_f_res_219546);\n            double tmp1_219548 = abs_res_219547 / x_219529;\n            double x_219549 = tmp1_21",
                   "9548 * tmp1_219548;\n            double y_219550 = tmp1_219548 * x_219549;\n            double tmp2_219551 = 1.0 - y_219550;\n            double x_219552 = tmp2_219551 * tmp2_219551;\n            double tmp3_219553 = tmp2_219551 * x_219552;\n            double w_j_219554 = defunc_0_f_res_219542 * tmp3_219553;\n            double defunc_1_op_res_219536 = w_j_219554 + redout_228429;\n            double redout_tmp_234672 = defunc_1_op_res_219536;\n            \n            redout_228429 = redout_tmp_234672;\n        }\n        defunc_2_reduce_res_219533 = redout_228429;\n        \n        double a0_219555 = 1.0 / defunc_2_reduce_res_219533;\n        double defunc_2_reduce_res_219556;\n        double redout_228431 = 0.0;\n        \n        for (int64_t i_228432 = 0; i_228432 < q_l_203577; i_228432++) {\n            bool cond_219561 = sle64(n_203572, i_228432);\n            int64_t defunc_0_f_res_219562;\n            \n            if (cond_219561) {\n                defunc_0_f_res_219562 = (int64_t) 0;\n            } else {\n                int64_t i_219563 = add64(x_219528, i_228432);\n                int64_t defunc_1_add_res_219564 = add64((int64_t) 1, i_219563);\n                \n                defunc_0_f_res_219562 = defunc_1_add_res_219564;\n            }\n            \n            double defunc_0_f_res_219565;\n            \n            if (cond_219561) {\n                defunc_0_f_res_219565 = 0.0;\n            } else {\n                int64_t i_219566 = add64(x_219528, i_228432);\n                double defunc_0_add_arg_219567;\n                \n                defunc_0_add_arg_219567 = ((__global\n                                            double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                        (gtid_219522 *\n                                                                         ctx_param_ext_229597 +\n                                                                         i_219566 *\n                                           ",
                   "                              ctx_param_ext_229599)];\n                defunc_0_f_res_219565 = defunc_0_add_arg_219567;\n            }\n            \n            int64_t binop_p_219568 = sub64(defunc_0_f_res_219562,\n                                           defunc_0_g_res_219532);\n            double defunc_0_f_res_219569 = sitofp_i64_f64(binop_p_219568);\n            double abs_res_219570 = fabs(defunc_0_f_res_219569);\n            double tmp1_219571 = abs_res_219570 / x_219529;\n            double x_219572 = tmp1_219571 * tmp1_219571;\n            double y_219573 = tmp1_219571 * x_219572;\n            double tmp2_219574 = 1.0 - y_219573;\n            double x_219575 = tmp2_219574 * tmp2_219574;\n            double tmp3_219576 = tmp2_219574 * x_219575;\n            double tmp4_219577 = defunc_0_f_res_219565 * tmp3_219576;\n            double defunc_0_f_res_219578;\n            \n            if (cond_219561) {\n                defunc_0_f_res_219578 = 0.0;\n            } else {\n                int64_t i_219579 = add64(x_219528, i_228432);\n                double defunc_0_add_arg_219580;\n                \n                defunc_0_add_arg_219580 = ((__global\n                                            double *) mem_230659)[gtid_219522 *\n                                                                  n_203572 +\n                                                                  i_219579];\n                defunc_0_f_res_219578 = defunc_0_add_arg_219580;\n            }\n            \n            double x_219581 = a0_219555 * tmp4_219577;\n            double defunc_9_fit_fun_res_219582 = defunc_0_f_res_219578 *\n                   x_219581;\n            double defunc_1_op_res_219559 = defunc_9_fit_fun_res_219582 +\n                   redout_228431;\n            double redout_tmp_234673 = defunc_1_op_res_219559;\n            \n            redout_228431 = redout_tmp_234673;\n        }\n        defunc_2_reduce_res_219556 = redout_228431;\n        ((__global double *) mem_230699)[gtid_219522 * l_n_m_203733 +",
                   "\n                                         gtid_219523] =\n            defunc_2_reduce_res_219556;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_219515\n}\n__kernel void mainzisegmap_219641(__global int *global_failure,\n                                  int64_t partition_sizze_203667,\n                                  int64_t l_n_m_203733, __global\n                                  unsigned char *mem_230704, __global\n                                  unsigned char *mem_230709)\n{\n    #define segmap_group_sizze_219636 (mainzisegmap_group_sizze_219337)\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_234746;\n    int32_t local_tid_234747;\n    int64_t group_sizze_234750;\n    int32_t wave_sizze_234749;\n    int32_t group_tid_234748;\n    \n    global_tid_234746 = get_global_id(0);\n    local_tid_234747 = get_local_id(0);\n    group_sizze_234750 = get_local_size(0);\n    wave_sizze_234749 = LOCKSTEP_WIDTH;\n    group_tid_234748 = get_group_id(0);\n    \n    int32_t phys_tid_219641 = global_tid_234746;\n    int64_t global_tid_234751 = sext_i32_i64(group_tid_234748) *\n            segmap_group_sizze_219636 + sext_i32_i64(local_tid_234747);\n    int64_t slice_234752 = l_n_m_203733;\n    int64_t slice_234753 = partition_sizze_203667 * slice_234752;\n    int64_t gtid_219639 = squot64(global_tid_234751, slice_234752);\n    int64_t remnant_234754 = global_tid_234751 - gtid_219639 * slice_234752;\n    int64_t gtid_219640 = remnant_234754;\n    int64_t remnant_234755 = remnant_234754 - gtid_219640;\n    \n    if (slt64(gtid_219639, partition_sizze_203667) && slt64(gtid_219640,\n                                                            l_n_m_203733)) {\n        double defunc_2_reduce_res_219642;\n        \n        defunc_2_reduce_res_219642 = ((__global\n                                       double *) mem_230704)[gtid_219639 *\n                                        ",
                   "                     l_n_m_203733 +\n                                                             gtid_219640];\n        \n        double a0_219643 = 1.0 / defunc_2_reduce_res_219642;\n        \n        ((__global double *) mem_230709)[gtid_219639 * l_n_m_203733 +\n                                         gtid_219640] = a0_219643;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_219636\n}\n__kernel void mainzisegmap_219802(__global int *global_failure,\n                                  int64_t n_203572, int64_t q_l_203577,\n                                  int64_t jump_t_203582,\n                                  int64_t partition_sizze_203667,\n                                  int64_t l_n_m_203733, int64_t i_203760,\n                                  int64_t num_groups_219797,\n                                  int64_t num_threads_232275, __global\n                                  unsigned char *mem_230724, __global\n                                  unsigned char *mem_230727, __global\n                                  unsigned char *mem_230730, __global\n                                  unsigned char *mem_230733, __global\n                                  unsigned char *mem_230767, __global\n                                  unsigned char *mem_230770, __global\n                                  unsigned char *color_232139, __global\n                                  unsigned char *color_232140)\n{\n    #define segmap_group_sizze_219796 (mainzisegmap_group_sizze_219698)\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_234845;\n    int32_t local_tid_234846;\n    int64_t group_sizze_234849;\n    int32_t wave_sizze_234848;\n    int32_t group_tid_234847;\n    \n    global_tid_234845 = get_global_id(0);\n    local_tid_234846 = get_local_id(0);\n    group_sizze_234849 = get_local_size(0);\n    wave_sizze_234848 = LOCKSTEP_WIDTH;\n    group_tid_234847 = get_gro",
                   "up_id(0);\n    \n    int32_t phys_tid_219802 = global_tid_234845;\n    int32_t phys_group_id_234850;\n    \n    phys_group_id_234850 = get_group_id(0);\n    for (int32_t i_234851 = 0; i_234851 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667,\n                                          segmap_group_sizze_219796)) -\n                   phys_group_id_234850, sext_i64_i32(num_groups_219797));\n         i_234851++) {\n        int32_t virt_group_id_234852 = phys_group_id_234850 + i_234851 *\n                sext_i64_i32(num_groups_219797);\n        int64_t global_tid_234853 = sext_i32_i64(virt_group_id_234852) *\n                segmap_group_sizze_219796 + sext_i32_i64(local_tid_234846);\n        int64_t slice_234854 = partition_sizze_203667;\n        int64_t gtid_219801 = global_tid_234853;\n        int64_t remnant_234855 = global_tid_234853 - gtid_219801;\n        \n        if (slt64(gtid_219801, partition_sizze_203667)) {\n            for (int64_t i_229085 = 0; i_229085 < l_n_m_203733; i_229085++) {\n                int64_t x_219810;\n                \n                x_219810 = ((__global int64_t *) mem_230724)[i_229085 *\n                                                             partition_sizze_203667 +\n                                                             gtid_219801];\n                \n                double x_219811;\n                \n                x_219811 = ((__global double *) mem_230727)[i_229085 *\n                                                            partition_sizze_203667 +\n                                                            gtid_219801];\n                \n                int64_t min_arg_219812 = mul64(jump_t_203582, i_229085);\n                int64_t min_res_219813 = smin64(i_203760, min_arg_219812);\n                int64_t defunc_0_g_res_219814 = add64((int64_t) 1,\n                                                      min_res_219813);\n                double defunc_2_reduce_res_219815;\n                double defunc_2_reduce_res_219816;\n   ",
                   "             double defunc_2_reduce_res_219817;\n                double redout_228445;\n                double redout_228446;\n                double redout_228447;\n                \n                redout_228445 = 0.0;\n                redout_228446 = 0.0;\n                redout_228447 = 0.0;\n                for (int64_t i_228448 = 0; i_228448 < q_l_203577; i_228448++) {\n                    bool cond_219828 = sle64(n_203572, i_228448);\n                    int64_t defunc_0_f_res_219829;\n                    \n                    if (cond_219828) {\n                        defunc_0_f_res_219829 = (int64_t) 0;\n                    } else {\n                        int64_t i_219830 = add64(x_219810, i_228448);\n                        int64_t defunc_1_add_res_219831 = add64((int64_t) 1,\n                                                                i_219830);\n                        \n                        defunc_0_f_res_219829 = defunc_1_add_res_219831;\n                    }\n                    \n                    double defunc_0_f_res_219832;\n                    \n                    if (cond_219828) {\n                        defunc_0_f_res_219832 = 0.0;\n                    } else {\n                        int64_t i_219833 = add64(x_219810, i_228448);\n                        double defunc_0_add_arg_219834;\n                        \n                        defunc_0_add_arg_219834 = ((__global\n                                                    double *) mem_230730)[i_219833 *\n                                                                          partition_sizze_203667 +\n                                                                          gtid_219801];\n                        defunc_0_f_res_219832 = defunc_0_add_arg_219834;\n                    }\n                    \n                    int64_t binop_p_219835 = sub64(defunc_0_f_res_219829,\n                                                   defunc_0_g_res_219814);\n                    double defunc_0_f_res_219836 =\n        ",
                   "                   sitofp_i64_f64(binop_p_219835);\n                    double abs_res_219837 = fabs(defunc_0_f_res_219836);\n                    double tmp1_219838 = abs_res_219837 / x_219811;\n                    double x_219839 = tmp1_219838 * tmp1_219838;\n                    double y_219840 = tmp1_219838 * x_219839;\n                    double tmp2_219841 = 1.0 - y_219840;\n                    double x_219842 = tmp2_219841 * tmp2_219841;\n                    double tmp3_219843 = tmp2_219841 * x_219842;\n                    double w_j_219844 = defunc_0_f_res_219832 * tmp3_219843;\n                    double xw_j_219845 = defunc_0_f_res_219836 * w_j_219844;\n                    double x2w_j_219846 = defunc_0_f_res_219836 * xw_j_219845;\n                    double defunc_1_op_res_219820 = w_j_219844 + redout_228445;\n                    double defunc_1_op_res_219823 = xw_j_219845 + redout_228446;\n                    double defunc_1_op_res_219826 = x2w_j_219846 +\n                           redout_228447;\n                    double redout_tmp_234858 = defunc_1_op_res_219820;\n                    double redout_tmp_234859 = defunc_1_op_res_219823;\n                    double redout_tmp_234860 = defunc_1_op_res_219826;\n                    \n                    redout_228445 = redout_tmp_234858;\n                    redout_228446 = redout_tmp_234859;\n                    redout_228447 = redout_tmp_234860;\n                }\n                defunc_2_reduce_res_219815 = redout_228445;\n                defunc_2_reduce_res_219816 = redout_228446;\n                defunc_2_reduce_res_219817 = redout_228447;\n                \n                double x_219847 = defunc_2_reduce_res_219815 *\n                       defunc_2_reduce_res_219817;\n                double y_219848 = defunc_2_reduce_res_219816 *\n                       defunc_2_reduce_res_219816;\n                double y_219849 = x_219847 - y_219848;\n                double det1_219850 = 1.0 / y_219849;\n                double a11_219851 = defun",
                   "c_2_reduce_res_219817 * det1_219850;\n                double x_219852 = 0.0 - defunc_2_reduce_res_219816;\n                double b11_219853 = det1_219850 * x_219852;\n                double c11_219854 = defunc_2_reduce_res_219815 * det1_219850;\n                double defunc_2_reduce_res_219855;\n                double defunc_2_reduce_res_219856;\n                double redout_228449;\n                double redout_228450;\n                \n                redout_228449 = 0.0;\n                redout_228450 = 0.0;\n                for (int64_t i_228451 = 0; i_228451 < q_l_203577; i_228451++) {\n                    bool cond_219864 = sle64(n_203572, i_228451);\n                    int64_t defunc_0_f_res_219865;\n                    \n                    if (cond_219864) {\n                        defunc_0_f_res_219865 = (int64_t) 0;\n                    } else {\n                        int64_t i_219866 = add64(x_219810, i_228451);\n                        int64_t defunc_1_add_res_219867 = add64((int64_t) 1,\n                                                                i_219866);\n                        \n                        defunc_0_f_res_219865 = defunc_1_add_res_219867;\n                    }\n                    \n                    double defunc_0_f_res_219868;\n                    \n                    if (cond_219864) {\n                        defunc_0_f_res_219868 = 0.0;\n                    } else {\n                        int64_t i_219869 = add64(x_219810, i_228451);\n                        double defunc_0_add_arg_219870;\n                        \n                        defunc_0_add_arg_219870 = ((__global\n                                                    double *) mem_230730)[i_219869 *\n                                                                          partition_sizze_203667 +\n                                                                          gtid_219801];\n                        defunc_0_f_res_219868 = defunc_0_add_arg_219870;\n                    }\n       ",
                   "             \n                    int64_t binop_p_219871 = sub64(defunc_0_f_res_219865,\n                                                   defunc_0_g_res_219814);\n                    double defunc_0_f_res_219872 =\n                           sitofp_i64_f64(binop_p_219871);\n                    double abs_res_219873 = fabs(defunc_0_f_res_219872);\n                    double tmp1_219874 = abs_res_219873 / x_219811;\n                    double x_219875 = tmp1_219874 * tmp1_219874;\n                    double y_219876 = tmp1_219874 * x_219875;\n                    double tmp2_219877 = 1.0 - y_219876;\n                    double x_219878 = tmp2_219877 * tmp2_219877;\n                    double tmp3_219879 = tmp2_219877 * x_219878;\n                    double tmp4_219880 = defunc_0_f_res_219868 * tmp3_219879;\n                    double defunc_1_f_res_219881 = defunc_0_f_res_219872 *\n                           tmp4_219880;\n                    double defunc_0_f_res_219882;\n                    \n                    if (cond_219864) {\n                        defunc_0_f_res_219882 = 0.0;\n                    } else {\n                        int64_t i_219883 = add64(x_219810, i_228451);\n                        double defunc_0_add_arg_219884;\n                        \n                        defunc_0_add_arg_219884 = ((__global\n                                                    double *) mem_230733)[i_219883 *\n                                                                          partition_sizze_203667 +\n                                                                          gtid_219801];\n                        defunc_0_f_res_219882 = defunc_0_add_arg_219884;\n                    }\n                    \n                    double x_219885 = a11_219851 * tmp4_219880;\n                    double y_219886 = b11_219853 * defunc_1_f_res_219881;\n                    double x_219887 = x_219885 + y_219886;\n                    double defunc_9_fit_fun_res_219888 = defunc_0_f_res_219882 *\n         ",
                   "                  x_219887;\n                    double x_219889 = b11_219853 * tmp4_219880;\n                    double y_219890 = c11_219854 * defunc_1_f_res_219881;\n                    double x_219891 = x_219889 + y_219890;\n                    double defunc_9_slope_fun_res_219892 =\n                           defunc_0_f_res_219882 * x_219891;\n                    double defunc_1_op_res_219859 =\n                           defunc_9_fit_fun_res_219888 + redout_228449;\n                    double defunc_1_op_res_219862 =\n                           defunc_9_slope_fun_res_219892 + redout_228450;\n                    double redout_tmp_234861 = defunc_1_op_res_219859;\n                    double redout_tmp_234862 = defunc_1_op_res_219862;\n                    \n                    redout_228449 = redout_tmp_234861;\n                    redout_228450 = redout_tmp_234862;\n                }\n                defunc_2_reduce_res_219855 = redout_228449;\n                defunc_2_reduce_res_219856 = redout_228450;\n                ((__global double *) color_232140)[phys_tid_219802 + i_229085 *\n                                                   num_threads_232275] =\n                    defunc_2_reduce_res_219855;\n                ((__global double *) color_232139)[phys_tid_219802 + i_229085 *\n                                                   num_threads_232275] =\n                    defunc_2_reduce_res_219856;\n            }\n            for (int64_t i_234863 = 0; i_234863 < l_n_m_203733; i_234863++) {\n                double tmp_234864;\n                \n                tmp_234864 = ((__global\n                               double *) color_232140)[phys_tid_219802 +\n                                                       i_234863 *\n                                                       num_threads_232275];\n                ((__global double *) mem_230767)[gtid_219801 + i_234863 *\n                                                 partition_sizze_203667] =\n                    tmp_234864;\n            ",
                   "}\n            for (int64_t i_234865 = 0; i_234865 < l_n_m_203733; i_234865++) {\n                double tmp_234866;\n                \n                tmp_234866 = ((__global\n                               double *) color_232139)[phys_tid_219802 +\n                                                       i_234865 *\n                                                       num_threads_232275];\n                ((__global double *) mem_230770)[gtid_219801 + i_234865 *\n                                                 partition_sizze_203667] =\n                    tmp_234866;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_219796\n}\n__kernel void mainzisegmap_220323(__global int *global_failure,\n                                  int64_t n_203572, int64_t q_l_203577,\n                                  int64_t jump_t_203582,\n                                  int64_t partition_sizze_203667,\n                                  int64_t l_n_m_203733, int64_t i_203760,\n                                  int64_t ctx_param_ext_229596,\n                                  int64_t ctx_param_ext_229597,\n                                  int64_t ctx_param_ext_229599, __global\n                                  unsigned char *ext_mem_229519, __global\n                                  unsigned char *ext_mem_229520, __global\n                                  unsigned char *mem_param_229601, __global\n                                  unsigned char *mem_230659, __global\n                                  unsigned char *mem_230775, __global\n                                  unsigned char *mem_230779)\n{\n    #define segmap_group_sizze_220312 (mainzisegmap_group_sizze_219898)\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_234867;\n    int32_t local_tid_234868;\n    int64_t group_sizze_23487",
                   "1;\n    int32_t wave_sizze_234870;\n    int32_t group_tid_234869;\n    \n    global_tid_234867 = get_global_id(0);\n    local_tid_234868 = get_local_id(0);\n    group_sizze_234871 = get_local_size(0);\n    wave_sizze_234870 = LOCKSTEP_WIDTH;\n    group_tid_234869 = get_group_id(0);\n    \n    int32_t phys_tid_220323 = global_tid_234867;\n    int64_t global_tid_234872 = sext_i32_i64(group_tid_234869) *\n            segmap_group_sizze_220312 + sext_i32_i64(local_tid_234868);\n    int64_t slice_234873 = l_n_m_203733;\n    int64_t slice_234874 = partition_sizze_203667 * slice_234873;\n    int64_t gtid_220321 = squot64(global_tid_234872, slice_234873);\n    int64_t remnant_234875 = global_tid_234872 - gtid_220321 * slice_234873;\n    int64_t gtid_220322 = remnant_234875;\n    int64_t remnant_234876 = remnant_234875 - gtid_220322;\n    \n    if (slt64(gtid_220321, partition_sizze_203667) && slt64(gtid_220322,\n                                                            l_n_m_203733)) {\n        int64_t x_220327;\n        \n        x_220327 = ((__global int64_t *) ext_mem_229520)[gtid_220321 *\n                                                         l_n_m_203733 +\n                                                         gtid_220322];\n        \n        double x_220328;\n        \n        x_220328 = ((__global double *) ext_mem_229519)[gtid_220321 *\n                                                        l_n_m_203733 +\n                                                        gtid_220322];\n        \n        int64_t min_arg_220329 = mul64(jump_t_203582, gtid_220322);\n        int64_t min_res_220330 = smin64(i_203760, min_arg_220329);\n        int64_t defunc_0_g_res_220331 = add64((int64_t) 1, min_res_220330);\n        double defunc_2_reduce_res_220332;\n        double defunc_2_reduce_res_220333;\n        double defunc_2_reduce_res_220334;\n        double redout_228456;\n        double redout_228457;\n        double redout_228458;\n        \n        redout_228456 = 0.0;\n        redout_228457 = 0.0;\n        redout_22",
                   "8458 = 0.0;\n        for (int64_t i_228459 = 0; i_228459 < q_l_203577; i_228459++) {\n            bool cond_220345 = sle64(n_203572, i_228459);\n            int64_t defunc_0_f_res_220346;\n            \n            if (cond_220345) {\n                defunc_0_f_res_220346 = (int64_t) 0;\n            } else {\n                int64_t i_220347 = add64(x_220327, i_228459);\n                int64_t defunc_1_add_res_220348 = add64((int64_t) 1, i_220347);\n                \n                defunc_0_f_res_220346 = defunc_1_add_res_220348;\n            }\n            \n            double defunc_0_f_res_220349;\n            \n            if (cond_220345) {\n                defunc_0_f_res_220349 = 0.0;\n            } else {\n                int64_t i_220350 = add64(x_220327, i_228459);\n                double defunc_0_add_arg_220351;\n                \n                defunc_0_add_arg_220351 = ((__global\n                                            double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                        (gtid_220321 *\n                                                                         ctx_param_ext_229597 +\n                                                                         i_220350 *\n                                                                         ctx_param_ext_229599)];\n                defunc_0_f_res_220349 = defunc_0_add_arg_220351;\n            }\n            \n            int64_t binop_p_220352 = sub64(defunc_0_f_res_220346,\n                                           defunc_0_g_res_220331);\n            double defunc_0_f_res_220353 = sitofp_i64_f64(binop_p_220352);\n            double abs_res_220354 = fabs(defunc_0_f_res_220353);\n            double tmp1_220355 = abs_res_220354 / x_220328;\n            double x_220356 = tmp1_220355 * tmp1_220355;\n            double y_220357 = tmp1_220355 * x_220356;\n            double tmp2_220358 = 1.0 - y_220357;\n            double x_220359 = tmp2_220358 * tmp2_220358;\n            d",
                   "ouble tmp3_220360 = tmp2_220358 * x_220359;\n            double w_j_220361 = defunc_0_f_res_220349 * tmp3_220360;\n            double xw_j_220362 = defunc_0_f_res_220353 * w_j_220361;\n            double x2w_j_220363 = defunc_0_f_res_220353 * xw_j_220362;\n            double defunc_1_op_res_220337 = w_j_220361 + redout_228456;\n            double defunc_1_op_res_220340 = xw_j_220362 + redout_228457;\n            double defunc_1_op_res_220343 = x2w_j_220363 + redout_228458;\n            double redout_tmp_234877 = defunc_1_op_res_220337;\n            double redout_tmp_234878 = defunc_1_op_res_220340;\n            double redout_tmp_234879 = defunc_1_op_res_220343;\n            \n            redout_228456 = redout_tmp_234877;\n            redout_228457 = redout_tmp_234878;\n            redout_228458 = redout_tmp_234879;\n        }\n        defunc_2_reduce_res_220332 = redout_228456;\n        defunc_2_reduce_res_220333 = redout_228457;\n        defunc_2_reduce_res_220334 = redout_228458;\n        \n        double x_220364 = defunc_2_reduce_res_220332 *\n               defunc_2_reduce_res_220334;\n        double y_220365 = defunc_2_reduce_res_220333 *\n               defunc_2_reduce_res_220333;\n        double y_220366 = x_220364 - y_220365;\n        double det1_220367 = 1.0 / y_220366;\n        double a11_220368 = defunc_2_reduce_res_220334 * det1_220367;\n        double x_220369 = 0.0 - defunc_2_reduce_res_220333;\n        double b11_220370 = det1_220367 * x_220369;\n        double c11_220371 = defunc_2_reduce_res_220332 * det1_220367;\n        double defunc_2_reduce_res_220372;\n        double defunc_2_reduce_res_220373;\n        double redout_228460;\n        double redout_228461;\n        \n        redout_228460 = 0.0;\n        redout_228461 = 0.0;\n        for (int64_t i_228462 = 0; i_228462 < q_l_203577; i_228462++) {\n            bool cond_220381 = sle64(n_203572, i_228462);\n            int64_t defunc_0_f_res_220382;\n            \n            if (cond_220381) {\n                defunc_0_f_res_220382 = ",
                   "(int64_t) 0;\n            } else {\n                int64_t i_220383 = add64(x_220327, i_228462);\n                int64_t defunc_1_add_res_220384 = add64((int64_t) 1, i_220383);\n                \n                defunc_0_f_res_220382 = defunc_1_add_res_220384;\n            }\n            \n            double defunc_0_f_res_220385;\n            \n            if (cond_220381) {\n                defunc_0_f_res_220385 = 0.0;\n            } else {\n                int64_t i_220386 = add64(x_220327, i_228462);\n                double defunc_0_add_arg_220387;\n                \n                defunc_0_add_arg_220387 = ((__global\n                                            double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                        (gtid_220321 *\n                                                                         ctx_param_ext_229597 +\n                                                                         i_220386 *\n                                                                         ctx_param_ext_229599)];\n                defunc_0_f_res_220385 = defunc_0_add_arg_220387;\n            }\n            \n            int64_t binop_p_220388 = sub64(defunc_0_f_res_220382,\n                                           defunc_0_g_res_220331);\n            double defunc_0_f_res_220389 = sitofp_i64_f64(binop_p_220388);\n            double abs_res_220390 = fabs(defunc_0_f_res_220389);\n            double tmp1_220391 = abs_res_220390 / x_220328;\n            double x_220392 = tmp1_220391 * tmp1_220391;\n            double y_220393 = tmp1_220391 * x_220392;\n            double tmp2_220394 = 1.0 - y_220393;\n            double x_220395 = tmp2_220394 * tmp2_220394;\n            double tmp3_220396 = tmp2_220394 * x_220395;\n            double tmp4_220397 = defunc_0_f_res_220385 * tmp3_220396;\n            double defunc_1_f_res_220398 = defunc_0_f_res_220389 * tmp4_220397;\n            double defunc_0_f_res_220399;\n            \n            if (cond",
                   "_220381) {\n                defunc_0_f_res_220399 = 0.0;\n            } else {\n                int64_t i_220400 = add64(x_220327, i_228462);\n                double defunc_0_add_arg_220401;\n                \n                defunc_0_add_arg_220401 = ((__global\n                                            double *) mem_230659)[gtid_220321 *\n                                                                  n_203572 +\n                                                                  i_220400];\n                defunc_0_f_res_220399 = defunc_0_add_arg_220401;\n            }\n            \n            double x_220402 = a11_220368 * tmp4_220397;\n            double y_220403 = b11_220370 * defunc_1_f_res_220398;\n            double x_220404 = x_220402 + y_220403;\n            double defunc_9_fit_fun_res_220405 = defunc_0_f_res_220399 *\n                   x_220404;\n            double x_220406 = b11_220370 * tmp4_220397;\n            double y_220407 = c11_220371 * defunc_1_f_res_220398;\n            double x_220408 = x_220406 + y_220407;\n            double defunc_9_slope_fun_res_220409 = defunc_0_f_res_220399 *\n                   x_220408;\n            double defunc_1_op_res_220376 = defunc_9_fit_fun_res_220405 +\n                   redout_228460;\n            double defunc_1_op_res_220379 = defunc_9_slope_fun_res_220409 +\n                   redout_228461;\n            double redout_tmp_234880 = defunc_1_op_res_220376;\n            double redout_tmp_234881 = defunc_1_op_res_220379;\n            \n            redout_228460 = redout_tmp_234880;\n            redout_228461 = redout_tmp_234881;\n        }\n        defunc_2_reduce_res_220372 = redout_228460;\n        defunc_2_reduce_res_220373 = redout_228461;\n        ((__global double *) mem_230775)[gtid_220321 * l_n_m_203733 +\n                                         gtid_220322] =\n            defunc_2_reduce_res_220372;\n        ((__global double *) mem_230779)[gtid_220321 * l_n_m_203733 +\n                                         gtid_220322] =\n        ",
                   "    defunc_2_reduce_res_220373;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_220312\n}\n__kernel void mainzisegmap_220480(__global int *global_failure,\n                                  int64_t partition_sizze_203667,\n                                  int64_t l_n_m_203733, __global\n                                  unsigned char *mem_230784, __global\n                                  unsigned char *mem_230788, __global\n                                  unsigned char *mem_230792, __global\n                                  unsigned char *mem_230797, __global\n                                  unsigned char *mem_230801, __global\n                                  unsigned char *mem_230805)\n{\n    #define segmap_group_sizze_220473 (mainzisegmap_group_sizze_220080)\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_234982;\n    int32_t local_tid_234983;\n    int64_t group_sizze_234986;\n    int32_t wave_sizze_234985;\n    int32_t group_tid_234984;\n    \n    global_tid_234982 = get_global_id(0);\n    local_tid_234983 = get_local_id(0);\n    group_sizze_234986 = get_local_size(0);\n    wave_sizze_234985 = LOCKSTEP_WIDTH;\n    group_tid_234984 = get_group_id(0);\n    \n    int32_t phys_tid_220480 = global_tid_234982;\n    int64_t global_tid_234987 = sext_i32_i64(group_tid_234984) *\n            segmap_group_sizze_220473 + sext_i32_i64(local_tid_234983);\n    int64_t slice_234988 = l_n_m_203733;\n    int64_t slice_234989 = partition_sizze_203667 * slice_234988;\n    int64_t gtid_220478 = squot64(global_tid_234987, slice_234988);\n    int64_t remnant_234990 = global_tid_234987 - gtid_220478 * slice_234988;\n    int64_t gtid_220479 = remnant_234990;\n    int64_t remnant_234991 = remnant_234990 - gtid_220479;\n    \n    if (slt64(gtid_220478, partition_sizze_203667) && slt64(gtid_220479,\n                                                            l_n_m_203733)) {\n",
                   "        double defunc_2_reduce_res_220481;\n        \n        defunc_2_reduce_res_220481 = ((__global\n                                       double *) mem_230784)[gtid_220478 *\n                                                             l_n_m_203733 +\n                                                             gtid_220479];\n        \n        double defunc_2_reduce_res_220482;\n        \n        defunc_2_reduce_res_220482 = ((__global\n                                       double *) mem_230788)[gtid_220478 *\n                                                             l_n_m_203733 +\n                                                             gtid_220479];\n        \n        double defunc_2_reduce_res_220483;\n        \n        defunc_2_reduce_res_220483 = ((__global\n                                       double *) mem_230792)[gtid_220478 *\n                                                             l_n_m_203733 +\n                                                             gtid_220479];\n        \n        double x_220484 = defunc_2_reduce_res_220481 *\n               defunc_2_reduce_res_220483;\n        double y_220485 = defunc_2_reduce_res_220482 *\n               defunc_2_reduce_res_220482;\n        double y_220486 = x_220484 - y_220485;\n        double det1_220487 = 1.0 / y_220486;\n        double a11_220488 = defunc_2_reduce_res_220483 * det1_220487;\n        double x_220489 = 0.0 - defunc_2_reduce_res_220482;\n        double b11_220490 = det1_220487 * x_220489;\n        double c11_220491 = defunc_2_reduce_res_220481 * det1_220487;\n        \n        ((__global double *) mem_230797)[gtid_220478 * l_n_m_203733 +\n                                         gtid_220479] = a11_220488;\n        ((__global double *) mem_230801)[gtid_220478 * l_n_m_203733 +\n                                         gtid_220479] = b11_220490;\n        ((__global double *) mem_230805)[gtid_220478 * l_n_m_203733 +\n                                         gtid_220479] = c11_220491;\n    }\n    \n  error_0:\n    return",
                   ";\n    #undef segmap_group_sizze_220473\n}\n__kernel void mainzisegmap_220699(__global int *global_failure,\n                                  int64_t n_203572, int64_t q_l_203577,\n                                  int64_t jump_t_203582,\n                                  int64_t partition_sizze_203667,\n                                  int64_t l_n_m_203733, int64_t i_203760,\n                                  int64_t num_groups_220694,\n                                  int64_t num_threads_232282, __global\n                                  unsigned char *mem_230831, __global\n                                  unsigned char *mem_230834, __global\n                                  unsigned char *mem_230837, __global\n                                  unsigned char *mem_230840, __global\n                                  unsigned char *mem_230874, __global\n                                  unsigned char *mem_230877, __global\n                                  unsigned char *color_232141, __global\n                                  unsigned char *color_232142)\n{\n    #define segmap_group_sizze_220693 (mainzisegmap_group_sizze_220563)\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_235095;\n    int32_t local_tid_235096;\n    int64_t group_sizze_235099;\n    int32_t wave_sizze_235098;\n    int32_t group_tid_235097;\n    \n    global_tid_235095 = get_global_id(0);\n    local_tid_235096 = get_local_id(0);\n    group_sizze_235099 = get_local_size(0);\n    wave_sizze_235098 = LOCKSTEP_WIDTH;\n    group_tid_235097 = get_group_id(0);\n    \n    int32_t phys_tid_220699 = global_tid_235095;\n    int32_t phys_group_id_235100;\n    \n    phys_group_id_235100 = get_group_id(0);\n    for (int32_t i_235101 = 0; i_235101 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667,\n                                          segmap_group_sizze_220693)) -\n                   phys_group_id",
                   "_235100, sext_i64_i32(num_groups_220694));\n         i_235101++) {\n        int32_t virt_group_id_235102 = phys_group_id_235100 + i_235101 *\n                sext_i64_i32(num_groups_220694);\n        int64_t global_tid_235103 = sext_i32_i64(virt_group_id_235102) *\n                segmap_group_sizze_220693 + sext_i32_i64(local_tid_235096);\n        int64_t slice_235104 = partition_sizze_203667;\n        int64_t gtid_220698 = global_tid_235103;\n        int64_t remnant_235105 = global_tid_235103 - gtid_220698;\n        \n        if (slt64(gtid_220698, partition_sizze_203667)) {\n            for (int64_t i_229092 = 0; i_229092 < l_n_m_203733; i_229092++) {\n                int64_t x_220707;\n                \n                x_220707 = ((__global int64_t *) mem_230831)[i_229092 *\n                                                             partition_sizze_203667 +\n                                                             gtid_220698];\n                \n                double x_220708;\n                \n                x_220708 = ((__global double *) mem_230834)[i_229092 *\n                                                            partition_sizze_203667 +\n                                                            gtid_220698];\n                \n                int64_t min_arg_220709 = mul64(jump_t_203582, i_229092);\n                int64_t min_res_220710 = smin64(i_203760, min_arg_220709);\n                int64_t defunc_0_g_res_220711 = add64((int64_t) 1,\n                                                      min_res_220710);\n                double defunc_2_reduce_res_220712;\n                double defunc_2_reduce_res_220713;\n                double defunc_2_reduce_res_220714;\n                double defunc_2_reduce_res_220715;\n                double defunc_2_reduce_res_220716;\n                double redout_228475;\n                double redout_228476;\n                double redout_228477;\n                double redout_228478;\n                double redout_228479;\n                \n  ",
                   "              redout_228475 = 0.0;\n                redout_228476 = 0.0;\n                redout_228477 = 0.0;\n                redout_228478 = 0.0;\n                redout_228479 = 0.0;\n                for (int64_t i_228480 = 0; i_228480 < q_l_203577; i_228480++) {\n                    bool cond_220733 = sle64(n_203572, i_228480);\n                    int64_t defunc_0_f_res_220734;\n                    \n                    if (cond_220733) {\n                        defunc_0_f_res_220734 = (int64_t) 0;\n                    } else {\n                        int64_t i_220735 = add64(x_220707, i_228480);\n                        int64_t defunc_1_add_res_220736 = add64((int64_t) 1,\n                                                                i_220735);\n                        \n                        defunc_0_f_res_220734 = defunc_1_add_res_220736;\n                    }\n                    \n                    double defunc_0_f_res_220737;\n                    \n                    if (cond_220733) {\n                        defunc_0_f_res_220737 = 0.0;\n                    } else {\n                        int64_t i_220738 = add64(x_220707, i_228480);\n                        double defunc_0_add_arg_220739;\n                        \n                        defunc_0_add_arg_220739 = ((__global\n                                                    double *) mem_230837)[i_220738 *\n                                                                          partition_sizze_203667 +\n                                                                          gtid_220698];\n                        defunc_0_f_res_220737 = defunc_0_add_arg_220739;\n                    }\n                    \n                    int64_t binop_p_220740 = sub64(defunc_0_f_res_220734,\n                                                   defunc_0_g_res_220711);\n                    double defunc_0_f_res_220741 =\n                           sitofp_i64_f64(binop_p_220740);\n                    double abs_res_220742 = fabs(defunc_",
                   "0_f_res_220741);\n                    double tmp1_220743 = abs_res_220742 / x_220708;\n                    double x_220744 = tmp1_220743 * tmp1_220743;\n                    double y_220745 = tmp1_220743 * x_220744;\n                    double tmp2_220746 = 1.0 - y_220745;\n                    double x_220747 = tmp2_220746 * tmp2_220746;\n                    double tmp3_220748 = tmp2_220746 * x_220747;\n                    double w_j_220749 = defunc_0_f_res_220737 * tmp3_220748;\n                    double xw_j_220750 = defunc_0_f_res_220741 * w_j_220749;\n                    double x2w_j_220751 = defunc_0_f_res_220741 * xw_j_220750;\n                    double x3w_j_220752 = defunc_0_f_res_220741 * x2w_j_220751;\n                    double x4w_j_220753 = defunc_0_f_res_220741 * x3w_j_220752;\n                    double defunc_1_op_res_220719 = w_j_220749 + redout_228475;\n                    double defunc_1_op_res_220722 = xw_j_220750 + redout_228476;\n                    double defunc_1_op_res_220725 = x2w_j_220751 +\n                           redout_228477;\n                    double defunc_1_op_res_220728 = x3w_j_220752 +\n                           redout_228478;\n                    double defunc_1_op_res_220731 = x4w_j_220753 +\n                           redout_228479;\n                    double redout_tmp_235108 = defunc_1_op_res_220719;\n                    double redout_tmp_235109 = defunc_1_op_res_220722;\n                    double redout_tmp_235110 = defunc_1_op_res_220725;\n                    double redout_tmp_235111 = defunc_1_op_res_220728;\n                    double redout_tmp_235112 = defunc_1_op_res_220731;\n                    \n                    redout_228475 = redout_tmp_235108;\n                    redout_228476 = redout_tmp_235109;\n                    redout_228477 = redout_tmp_235110;\n                    redout_228478 = redout_tmp_235111;\n                    redout_228479 = redout_tmp_235112;\n                }\n                defunc_2_reduce_res_220712 = redout",
                   "_228475;\n                defunc_2_reduce_res_220713 = redout_228476;\n                defunc_2_reduce_res_220714 = redout_228477;\n                defunc_2_reduce_res_220715 = redout_228478;\n                defunc_2_reduce_res_220716 = redout_228479;\n                \n                double x_220754 = defunc_2_reduce_res_220714 *\n                       defunc_2_reduce_res_220716;\n                double y_220755 = defunc_2_reduce_res_220715 *\n                       defunc_2_reduce_res_220715;\n                double a12_220756 = x_220754 - y_220755;\n                double x_220757 = defunc_2_reduce_res_220714 *\n                       defunc_2_reduce_res_220715;\n                double y_220758 = defunc_2_reduce_res_220713 *\n                       defunc_2_reduce_res_220716;\n                double b12_220759 = x_220757 - y_220758;\n                double x_220760 = defunc_2_reduce_res_220713 *\n                       defunc_2_reduce_res_220715;\n                double y_220761 = defunc_2_reduce_res_220714 *\n                       defunc_2_reduce_res_220714;\n                double c12_220762 = x_220760 - y_220761;\n                double x_220763 = defunc_2_reduce_res_220712 *\n                       defunc_2_reduce_res_220716;\n                double b2_220764 = x_220763 - y_220761;\n                double x_220765 = defunc_2_reduce_res_220713 *\n                       defunc_2_reduce_res_220714;\n                double y_220766 = defunc_2_reduce_res_220712 *\n                       defunc_2_reduce_res_220715;\n                double c2_220767 = x_220765 - y_220766;\n                double x_220768 = defunc_2_reduce_res_220712 * a12_220756;\n                double y_220769 = defunc_2_reduce_res_220713 * b12_220759;\n                double x_220770 = x_220768 + y_220769;\n                double y_220771 = defunc_2_reduce_res_220714 * c12_220762;\n                double y_220772 = x_220770 + y_220771;\n                double det_220773 = 1.0 / y_220772;\n                double a12_220774 = a1",
                   "2_220756 * det_220773;\n                double b12_220775 = b12_220759 * det_220773;\n                double c12_220776 = c12_220762 * det_220773;\n                double b2_220777 = b2_220764 * det_220773;\n                double c2_220778 = c2_220767 * det_220773;\n                double defunc_2_reduce_res_220779;\n                double defunc_2_reduce_res_220780;\n                double redout_228481;\n                double redout_228482;\n                \n                redout_228481 = 0.0;\n                redout_228482 = 0.0;\n                for (int64_t i_228483 = 0; i_228483 < q_l_203577; i_228483++) {\n                    bool cond_220788 = sle64(n_203572, i_228483);\n                    int64_t defunc_0_f_res_220789;\n                    \n                    if (cond_220788) {\n                        defunc_0_f_res_220789 = (int64_t) 0;\n                    } else {\n                        int64_t i_220790 = add64(x_220707, i_228483);\n                        int64_t defunc_1_add_res_220791 = add64((int64_t) 1,\n                                                                i_220790);\n                        \n                        defunc_0_f_res_220789 = defunc_1_add_res_220791;\n                    }\n                    \n                    double defunc_0_f_res_220792;\n                    \n                    if (cond_220788) {\n                        defunc_0_f_res_220792 = 0.0;\n                    } else {\n                        int64_t i_220793 = add64(x_220707, i_228483);\n                        double defunc_0_add_arg_220794;\n                        \n                        defunc_0_add_arg_220794 = ((__global\n                                                    double *) mem_230837)[i_220793 *\n                                                                          partition_sizze_203667 +\n                                                                          gtid_220698];\n                        defunc_0_f_res_220792 = defunc_0_add_arg_220794;\n         ",
                   "           }\n                    \n                    int64_t binop_p_220795 = sub64(defunc_0_f_res_220789,\n                                                   defunc_0_g_res_220711);\n                    double defunc_0_f_res_220796 =\n                           sitofp_i64_f64(binop_p_220795);\n                    double abs_res_220797 = fabs(defunc_0_f_res_220796);\n                    double tmp1_220798 = abs_res_220797 / x_220708;\n                    double x_220799 = tmp1_220798 * tmp1_220798;\n                    double y_220800 = tmp1_220798 * x_220799;\n                    double tmp2_220801 = 1.0 - y_220800;\n                    double x_220802 = tmp2_220801 * tmp2_220801;\n                    double tmp3_220803 = tmp2_220801 * x_220802;\n                    double tmp4_220804 = defunc_0_f_res_220792 * tmp3_220803;\n                    double defunc_1_f_res_220805 = defunc_0_f_res_220796 *\n                           tmp4_220804;\n                    double defunc_1_f_res_220806 = defunc_0_f_res_220796 *\n                           defunc_1_f_res_220805;\n                    double defunc_0_f_res_220807;\n                    \n                    if (cond_220788) {\n                        defunc_0_f_res_220807 = 0.0;\n                    } else {\n                        int64_t i_220808 = add64(x_220707, i_228483);\n                        double defunc_0_add_arg_220809;\n                        \n                        defunc_0_add_arg_220809 = ((__global\n                                                    double *) mem_230840)[i_220808 *\n                                                                          partition_sizze_203667 +\n                                                                          gtid_220698];\n                        defunc_0_f_res_220807 = defunc_0_add_arg_220809;\n                    }\n                    \n                    double x_220810 = a12_220774 * tmp4_220804;\n                    double y_220811 = b12_220775 * defunc_1_f_res_220805;\n    ",
                   "                double x_220812 = x_220810 + y_220811;\n                    double y_220813 = c12_220776 * defunc_1_f_res_220806;\n                    double x_220814 = x_220812 + y_220813;\n                    double defunc_9_fit_fun_res_220815 = defunc_0_f_res_220807 *\n                           x_220814;\n                    double x_220816 = b12_220775 * tmp4_220804;\n                    double y_220817 = b2_220777 * defunc_1_f_res_220805;\n                    double x_220818 = x_220816 + y_220817;\n                    double y_220819 = c2_220778 * defunc_1_f_res_220806;\n                    double x_220820 = x_220818 + y_220819;\n                    double defunc_9_slope_fun_res_220821 =\n                           defunc_0_f_res_220807 * x_220820;\n                    double defunc_1_op_res_220783 =\n                           defunc_9_fit_fun_res_220815 + redout_228481;\n                    double defunc_1_op_res_220786 =\n                           defunc_9_slope_fun_res_220821 + redout_228482;\n                    double redout_tmp_235113 = defunc_1_op_res_220783;\n                    double redout_tmp_235114 = defunc_1_op_res_220786;\n                    \n                    redout_228481 = redout_tmp_235113;\n                    redout_228482 = redout_tmp_235114;\n                }\n                defunc_2_reduce_res_220779 = redout_228481;\n                defunc_2_reduce_res_220780 = redout_228482;\n                ((__global double *) color_232142)[phys_tid_220699 + i_229092 *\n                                                   num_threads_232282] =\n                    defunc_2_reduce_res_220779;\n                ((__global double *) color_232141)[phys_tid_220699 + i_229092 *\n                                                   num_threads_232282] =\n                    defunc_2_reduce_res_220780;\n            }\n            for (int64_t i_235115 = 0; i_235115 < l_n_m_203733; i_235115++) {\n                double tmp_235116;\n                \n                tmp_235116 = ((__global",
                   "\n                               double *) color_232142)[phys_tid_220699 +\n                                                       i_235115 *\n                                                       num_threads_232282];\n                ((__global double *) mem_230874)[gtid_220698 + i_235115 *\n                                                 partition_sizze_203667] =\n                    tmp_235116;\n            }\n            for (int64_t i_235117 = 0; i_235117 < l_n_m_203733; i_235117++) {\n                double tmp_235118;\n                \n                tmp_235118 = ((__global\n                               double *) color_232141)[phys_tid_220699 +\n                                                       i_235117 *\n                                                       num_threads_232282];\n                ((__global double *) mem_230877)[gtid_220698 + i_235117 *\n                                                 partition_sizze_203667] =\n                    tmp_235118;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_220693\n}\n__kernel void mainzisegmap_221368(__global int *global_failure,\n                                  int64_t n_203572, int64_t q_l_203577,\n                                  int64_t jump_t_203582,\n                                  int64_t partition_sizze_203667,\n                                  int64_t l_n_m_203733, int64_t i_203760,\n                                  int64_t ctx_param_ext_229596,\n                                  int64_t ctx_param_ext_229597,\n                                  int64_t ctx_param_ext_229599, __global\n                                  unsigned char *ext_mem_229519, __global\n                                  unsigned char *ext_mem_229520, __global\n                                  unsigned char *mem_param_229601, __global\n                                  unsigned char *mem_230659, __global\n                                  uns",
                   "igned char *mem_230882, __global\n                                  unsigned char *mem_230886)\n{\n    #define segmap_group_sizze_221357 (mainzisegmap_group_sizze_220827)\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_235119;\n    int32_t local_tid_235120;\n    int64_t group_sizze_235123;\n    int32_t wave_sizze_235122;\n    int32_t group_tid_235121;\n    \n    global_tid_235119 = get_global_id(0);\n    local_tid_235120 = get_local_id(0);\n    group_sizze_235123 = get_local_size(0);\n    wave_sizze_235122 = LOCKSTEP_WIDTH;\n    group_tid_235121 = get_group_id(0);\n    \n    int32_t phys_tid_221368 = global_tid_235119;\n    int64_t global_tid_235124 = sext_i32_i64(group_tid_235121) *\n            segmap_group_sizze_221357 + sext_i32_i64(local_tid_235120);\n    int64_t slice_235125 = l_n_m_203733;\n    int64_t slice_235126 = partition_sizze_203667 * slice_235125;\n    int64_t gtid_221366 = squot64(global_tid_235124, slice_235125);\n    int64_t remnant_235127 = global_tid_235124 - gtid_221366 * slice_235125;\n    int64_t gtid_221367 = remnant_235127;\n    int64_t remnant_235128 = remnant_235127 - gtid_221367;\n    \n    if (slt64(gtid_221366, partition_sizze_203667) && slt64(gtid_221367,\n                                                            l_n_m_203733)) {\n        int64_t x_221372;\n        \n        x_221372 = ((__global int64_t *) ext_mem_229520)[gtid_221366 *\n                                                         l_n_m_203733 +\n                                                         gtid_221367];\n        \n        double x_221373;\n        \n        x_221373 = ((__global double *) ext_mem_229519)[gtid_221366 *\n                                                        l_n_m_203733 +\n                                                        gtid_221367];\n        \n        int64_t min_arg_221374 = mul64(jump_t_203582, gtid_221367);\n        int64_t min_res_221375 = smin",
                   "64(i_203760, min_arg_221374);\n        int64_t defunc_0_g_res_221376 = add64((int64_t) 1, min_res_221375);\n        double defunc_2_reduce_res_221377;\n        double defunc_2_reduce_res_221378;\n        double defunc_2_reduce_res_221379;\n        double defunc_2_reduce_res_221380;\n        double defunc_2_reduce_res_221381;\n        double redout_228488;\n        double redout_228489;\n        double redout_228490;\n        double redout_228491;\n        double redout_228492;\n        \n        redout_228488 = 0.0;\n        redout_228489 = 0.0;\n        redout_228490 = 0.0;\n        redout_228491 = 0.0;\n        redout_228492 = 0.0;\n        for (int64_t i_228493 = 0; i_228493 < q_l_203577; i_228493++) {\n            bool cond_221398 = sle64(n_203572, i_228493);\n            int64_t defunc_0_f_res_221399;\n            \n            if (cond_221398) {\n                defunc_0_f_res_221399 = (int64_t) 0;\n            } else {\n                int64_t i_221400 = add64(x_221372, i_228493);\n                int64_t defunc_1_add_res_221401 = add64((int64_t) 1, i_221400);\n                \n                defunc_0_f_res_221399 = defunc_1_add_res_221401;\n            }\n            \n            double defunc_0_f_res_221402;\n            \n            if (cond_221398) {\n                defunc_0_f_res_221402 = 0.0;\n            } else {\n                int64_t i_221403 = add64(x_221372, i_228493);\n                double defunc_0_add_arg_221404;\n                \n                defunc_0_add_arg_221404 = ((__global\n                                            double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                        (gtid_221366 *\n                                                                         ctx_param_ext_229597 +\n                                                                         i_221403 *\n                                                                         ctx_param_ext_229599)];\n                defunc_0_f_res_221402 = de",
                   "func_0_add_arg_221404;\n            }\n            \n            int64_t binop_p_221405 = sub64(defunc_0_f_res_221399,\n                                           defunc_0_g_res_221376);\n            double defunc_0_f_res_221406 = sitofp_i64_f64(binop_p_221405);\n            double abs_res_221407 = fabs(defunc_0_f_res_221406);\n            double tmp1_221408 = abs_res_221407 / x_221373;\n            double x_221409 = tmp1_221408 * tmp1_221408;\n            double y_221410 = tmp1_221408 * x_221409;\n            double tmp2_221411 = 1.0 - y_221410;\n            double x_221412 = tmp2_221411 * tmp2_221411;\n            double tmp3_221413 = tmp2_221411 * x_221412;\n            double w_j_221414 = defunc_0_f_res_221402 * tmp3_221413;\n            double xw_j_221415 = defunc_0_f_res_221406 * w_j_221414;\n            double x2w_j_221416 = defunc_0_f_res_221406 * xw_j_221415;\n            double x3w_j_221417 = defunc_0_f_res_221406 * x2w_j_221416;\n            double x4w_j_221418 = defunc_0_f_res_221406 * x3w_j_221417;\n            double defunc_1_op_res_221384 = w_j_221414 + redout_228488;\n            double defunc_1_op_res_221387 = xw_j_221415 + redout_228489;\n            double defunc_1_op_res_221390 = x2w_j_221416 + redout_228490;\n            double defunc_1_op_res_221393 = x3w_j_221417 + redout_228491;\n            double defunc_1_op_res_221396 = x4w_j_221418 + redout_228492;\n            double redout_tmp_235129 = defunc_1_op_res_221384;\n            double redout_tmp_235130 = defunc_1_op_res_221387;\n            double redout_tmp_235131 = defunc_1_op_res_221390;\n            double redout_tmp_235132 = defunc_1_op_res_221393;\n            double redout_tmp_235133 = defunc_1_op_res_221396;\n            \n            redout_228488 = redout_tmp_235129;\n            redout_228489 = redout_tmp_235130;\n            redout_228490 = redout_tmp_235131;\n            redout_228491 = redout_tmp_235132;\n            redout_228492 = redout_tmp_235133;\n        }\n        defunc_2_reduce_res_221377 = redout_228488",
                   ";\n        defunc_2_reduce_res_221378 = redout_228489;\n        defunc_2_reduce_res_221379 = redout_228490;\n        defunc_2_reduce_res_221380 = redout_228491;\n        defunc_2_reduce_res_221381 = redout_228492;\n        \n        double x_221419 = defunc_2_reduce_res_221379 *\n               defunc_2_reduce_res_221381;\n        double y_221420 = defunc_2_reduce_res_221380 *\n               defunc_2_reduce_res_221380;\n        double a12_221421 = x_221419 - y_221420;\n        double x_221422 = defunc_2_reduce_res_221379 *\n               defunc_2_reduce_res_221380;\n        double y_221423 = defunc_2_reduce_res_221378 *\n               defunc_2_reduce_res_221381;\n        double b12_221424 = x_221422 - y_221423;\n        double x_221425 = defunc_2_reduce_res_221378 *\n               defunc_2_reduce_res_221380;\n        double y_221426 = defunc_2_reduce_res_221379 *\n               defunc_2_reduce_res_221379;\n        double c12_221427 = x_221425 - y_221426;\n        double x_221428 = defunc_2_reduce_res_221377 *\n               defunc_2_reduce_res_221381;\n        double b2_221429 = x_221428 - y_221426;\n        double x_221430 = defunc_2_reduce_res_221378 *\n               defunc_2_reduce_res_221379;\n        double y_221431 = defunc_2_reduce_res_221377 *\n               defunc_2_reduce_res_221380;\n        double c2_221432 = x_221430 - y_221431;\n        double x_221433 = defunc_2_reduce_res_221377 * a12_221421;\n        double y_221434 = defunc_2_reduce_res_221378 * b12_221424;\n        double x_221435 = x_221433 + y_221434;\n        double y_221436 = defunc_2_reduce_res_221379 * c12_221427;\n        double y_221437 = x_221435 + y_221436;\n        double det_221438 = 1.0 / y_221437;\n        double a12_221439 = a12_221421 * det_221438;\n        double b12_221440 = b12_221424 * det_221438;\n        double c12_221441 = c12_221427 * det_221438;\n        double b2_221442 = b2_221429 * det_221438;\n        double c2_221443 = c2_221432 * det_221438;\n        double defunc_2_reduce_res_221444;\n        doubl",
                   "e defunc_2_reduce_res_221445;\n        double redout_228494;\n        double redout_228495;\n        \n        redout_228494 = 0.0;\n        redout_228495 = 0.0;\n        for (int64_t i_228496 = 0; i_228496 < q_l_203577; i_228496++) {\n            bool cond_221453 = sle64(n_203572, i_228496);\n            int64_t defunc_0_f_res_221454;\n            \n            if (cond_221453) {\n                defunc_0_f_res_221454 = (int64_t) 0;\n            } else {\n                int64_t i_221455 = add64(x_221372, i_228496);\n                int64_t defunc_1_add_res_221456 = add64((int64_t) 1, i_221455);\n                \n                defunc_0_f_res_221454 = defunc_1_add_res_221456;\n            }\n            \n            double defunc_0_f_res_221457;\n            \n            if (cond_221453) {\n                defunc_0_f_res_221457 = 0.0;\n            } else {\n                int64_t i_221458 = add64(x_221372, i_228496);\n                double defunc_0_add_arg_221459;\n                \n                defunc_0_add_arg_221459 = ((__global\n                                            double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                        (gtid_221366 *\n                                                                         ctx_param_ext_229597 +\n                                                                         i_221458 *\n                                                                         ctx_param_ext_229599)];\n                defunc_0_f_res_221457 = defunc_0_add_arg_221459;\n            }\n            \n            int64_t binop_p_221460 = sub64(defunc_0_f_res_221454,\n                                           defunc_0_g_res_221376);\n            double defunc_0_f_res_221461 = sitofp_i64_f64(binop_p_221460);\n            double abs_res_221462 = fabs(defunc_0_f_res_221461);\n            double tmp1_221463 = abs_res_221462 / x_221373;\n            double x_221464 = tmp1_221463 * tmp1_221463;\n            double y_221465 ",
                   "= tmp1_221463 * x_221464;\n            double tmp2_221466 = 1.0 - y_221465;\n            double x_221467 = tmp2_221466 * tmp2_221466;\n            double tmp3_221468 = tmp2_221466 * x_221467;\n            double tmp4_221469 = defunc_0_f_res_221457 * tmp3_221468;\n            double defunc_1_f_res_221470 = defunc_0_f_res_221461 * tmp4_221469;\n            double defunc_1_f_res_221471 = defunc_0_f_res_221461 *\n                   defunc_1_f_res_221470;\n            double defunc_0_f_res_221472;\n            \n            if (cond_221453) {\n                defunc_0_f_res_221472 = 0.0;\n            } else {\n                int64_t i_221473 = add64(x_221372, i_228496);\n                double defunc_0_add_arg_221474;\n                \n                defunc_0_add_arg_221474 = ((__global\n                                            double *) mem_230659)[gtid_221366 *\n                                                                  n_203572 +\n                                                                  i_221473];\n                defunc_0_f_res_221472 = defunc_0_add_arg_221474;\n            }\n            \n            double x_221475 = a12_221439 * tmp4_221469;\n            double y_221476 = b12_221440 * defunc_1_f_res_221470;\n            double x_221477 = x_221475 + y_221476;\n            double y_221478 = c12_221441 * defunc_1_f_res_221471;\n            double x_221479 = x_221477 + y_221478;\n            double defunc_9_fit_fun_res_221480 = defunc_0_f_res_221472 *\n                   x_221479;\n            double x_221481 = b12_221440 * tmp4_221469;\n            double y_221482 = b2_221442 * defunc_1_f_res_221470;\n            double x_221483 = x_221481 + y_221482;\n            double y_221484 = c2_221443 * defunc_1_f_res_221471;\n            double x_221485 = x_221483 + y_221484;\n            double defunc_9_slope_fun_res_221486 = defunc_0_f_res_221472 *\n                   x_221485;\n            double defunc_1_op_res_221448 = defunc_9_fit_fun_res_221480 +\n                   redout_228494;\n  ",
                   "          double defunc_1_op_res_221451 = defunc_9_slope_fun_res_221486 +\n                   redout_228495;\n            double redout_tmp_235134 = defunc_1_op_res_221448;\n            double redout_tmp_235135 = defunc_1_op_res_221451;\n            \n            redout_228494 = redout_tmp_235134;\n            redout_228495 = redout_tmp_235135;\n        }\n        defunc_2_reduce_res_221444 = redout_228494;\n        defunc_2_reduce_res_221445 = redout_228495;\n        ((__global double *) mem_230882)[gtid_221366 * l_n_m_203733 +\n                                         gtid_221367] =\n            defunc_2_reduce_res_221444;\n        ((__global double *) mem_230886)[gtid_221366 * l_n_m_203733 +\n                                         gtid_221367] =\n            defunc_2_reduce_res_221445;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_221357\n}\n__kernel void mainzisegmap_221569(__global int *global_failure,\n                                  int64_t partition_sizze_203667,\n                                  int64_t l_n_m_203733, __global\n                                  unsigned char *mem_230891, __global\n                                  unsigned char *mem_230895, __global\n                                  unsigned char *mem_230899, __global\n                                  unsigned char *mem_230903, __global\n                                  unsigned char *mem_230907, __global\n                                  unsigned char *mem_230912, __global\n                                  unsigned char *mem_230916, __global\n                                  unsigned char *mem_230920, __global\n                                  unsigned char *mem_230924, __global\n                                  unsigned char *mem_230928)\n{\n    #define segmap_group_sizze_221560 (mainzisegmap_group_sizze_221058)\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_235264",
                   ";\n    int32_t local_tid_235265;\n    int64_t group_sizze_235268;\n    int32_t wave_sizze_235267;\n    int32_t group_tid_235266;\n    \n    global_tid_235264 = get_global_id(0);\n    local_tid_235265 = get_local_id(0);\n    group_sizze_235268 = get_local_size(0);\n    wave_sizze_235267 = LOCKSTEP_WIDTH;\n    group_tid_235266 = get_group_id(0);\n    \n    int32_t phys_tid_221569 = global_tid_235264;\n    int64_t global_tid_235269 = sext_i32_i64(group_tid_235266) *\n            segmap_group_sizze_221560 + sext_i32_i64(local_tid_235265);\n    int64_t slice_235270 = l_n_m_203733;\n    int64_t slice_235271 = partition_sizze_203667 * slice_235270;\n    int64_t gtid_221567 = squot64(global_tid_235269, slice_235270);\n    int64_t remnant_235272 = global_tid_235269 - gtid_221567 * slice_235270;\n    int64_t gtid_221568 = remnant_235272;\n    int64_t remnant_235273 = remnant_235272 - gtid_221568;\n    \n    if (slt64(gtid_221567, partition_sizze_203667) && slt64(gtid_221568,\n                                                            l_n_m_203733)) {\n        double defunc_2_reduce_res_221570;\n        \n        defunc_2_reduce_res_221570 = ((__global\n                                       double *) mem_230891)[gtid_221567 *\n                                                             l_n_m_203733 +\n                                                             gtid_221568];\n        \n        double defunc_2_reduce_res_221571;\n        \n        defunc_2_reduce_res_221571 = ((__global\n                                       double *) mem_230895)[gtid_221567 *\n                                                             l_n_m_203733 +\n                                                             gtid_221568];\n        \n        double defunc_2_reduce_res_221572;\n        \n        defunc_2_reduce_res_221572 = ((__global\n                                       double *) mem_230899)[gtid_221567 *\n                                                             l_n_m_203733 +\n                                            ",
                   "                 gtid_221568];\n        \n        double defunc_2_reduce_res_221573;\n        \n        defunc_2_reduce_res_221573 = ((__global\n                                       double *) mem_230903)[gtid_221567 *\n                                                             l_n_m_203733 +\n                                                             gtid_221568];\n        \n        double defunc_2_reduce_res_221574;\n        \n        defunc_2_reduce_res_221574 = ((__global\n                                       double *) mem_230907)[gtid_221567 *\n                                                             l_n_m_203733 +\n                                                             gtid_221568];\n        \n        double x_221575 = defunc_2_reduce_res_221572 *\n               defunc_2_reduce_res_221574;\n        double y_221576 = defunc_2_reduce_res_221573 *\n               defunc_2_reduce_res_221573;\n        double a12_221577 = x_221575 - y_221576;\n        double x_221578 = defunc_2_reduce_res_221572 *\n               defunc_2_reduce_res_221573;\n        double y_221579 = defunc_2_reduce_res_221571 *\n               defunc_2_reduce_res_221574;\n        double b12_221580 = x_221578 - y_221579;\n        double x_221581 = defunc_2_reduce_res_221571 *\n               defunc_2_reduce_res_221573;\n        double y_221582 = defunc_2_reduce_res_221572 *\n               defunc_2_reduce_res_221572;\n        double c12_221583 = x_221581 - y_221582;\n        double x_221584 = defunc_2_reduce_res_221570 *\n               defunc_2_reduce_res_221574;\n        double b2_221585 = x_221584 - y_221582;\n        double x_221586 = defunc_2_reduce_res_221571 *\n               defunc_2_reduce_res_221572;\n        double y_221587 = defunc_2_reduce_res_221570 *\n               defunc_2_reduce_res_221573;\n        double c2_221588 = x_221586 - y_221587;\n        double x_221589 = defunc_2_reduce_res_221570 * a12_221577;\n        double y_221590 = defunc_2_reduce_res_221571 * b12_221580;\n        double x_221591 = x_221",
                   "589 + y_221590;\n        double y_221592 = defunc_2_reduce_res_221572 * c12_221583;\n        double y_221593 = x_221591 + y_221592;\n        double det_221594 = 1.0 / y_221593;\n        double a12_221595 = a12_221577 * det_221594;\n        double b12_221596 = b12_221580 * det_221594;\n        double c12_221597 = c12_221583 * det_221594;\n        double b2_221598 = b2_221585 * det_221594;\n        double c2_221599 = c2_221588 * det_221594;\n        \n        ((__global double *) mem_230912)[gtid_221567 * l_n_m_203733 +\n                                         gtid_221568] = a12_221595;\n        ((__global double *) mem_230916)[gtid_221567 * l_n_m_203733 +\n                                         gtid_221568] = b12_221596;\n        ((__global double *) mem_230920)[gtid_221567 * l_n_m_203733 +\n                                         gtid_221568] = c12_221597;\n        ((__global double *) mem_230924)[gtid_221567 * l_n_m_203733 +\n                                         gtid_221568] = b2_221598;\n        ((__global double *) mem_230928)[gtid_221567 * l_n_m_203733 +\n                                         gtid_221568] = c2_221599;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_221560\n}\n__kernel void mainzisegmap_222439(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572, int64_t jump_l_203583,\n                                  int64_t partition_sizze_203667,\n                                  int64_t l_n_m_203733, int64_t i_203760,\n                                  int64_t y_205876, __global\n                                  unsigned char *ext_mem_231015, __global\n                                  unsigned char *ext_mem_231016, __global\n                                  unsigned char *mem_231021)\n{\n    #define segmap_group_sizze_222434 (mainzisegmap_group_sizze_222316)\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_235438;\n    int32_t local_tid_235439;\n    int64_t group_sizze_235442;\n    int32_t wave_sizze_235441;\n    int32_t group_tid_235440;\n    \n    global_tid_235438 = get_global_id(0);\n    local_tid_235439 = get_local_id(0);\n    group_sizze_235442 = get_local_size(0);\n    wave_sizze_235441 = LOCKSTEP_WIDTH;\n    group_tid_235440 = get_group_id(0);\n    \n    int32_t phys_tid_222439 = global_tid_235438;\n    int64_t global_tid_235443 = sext_i32_i64(group_tid_235440) *\n            segmap_group_sizze_222434 + sext_i32_i64(local_tid_235439);\n    int64_t slice_235444 = n_203572;\n    int64_t slice_235445 = partition_sizze_203667 * slice_235444;\n    int64_t gtid_222437 = squot64(global_tid_235443, slice_235444);\n    int64_t remnant_235446 = global_tid_235443 - gtid_222437 * slice_235444;\n    int64_t gtid_222438 = remnant_235446;\n    int64_t remnant_235447 = remnant_235446 - gtid_222438;\n    \n    if (slt64(gtid_222437, partition_sizze_203667) && slt64(gtid_222438,\n                                                            n_203572)) {\n        int64_t m_v_222443 = sdiv64(gtid_222438, jump_l_203583);\n        bool cond_222444 = m_v_222443 == y_205876;\n        int64_t j_222445;\n        \n        if (cond_222444) {\n            int64_t j_t_res_222446 = sub64(m_v_222443, (int64_t) 1);\n            \n            j_222445 = j_t_res_222446;\n        } else {\n            j_222445 = m_v_222443;\n        }\n        \n        int64_t min_arg_222447 = mul64(jump_l_203583, j_222445);\n        int64_t min_res_222448 = smin64(i_203760, min_arg_222447);\n        int64_t defunc_0_m_fun_arg_222449 = add64((int64_t) 1, j_222445);\n        int64_t min_arg_222450 = mul64(jump_l_203583,\n                                       defunc_0_m_fun_arg_222449);\n        int64_t min_res_222451 = smin64(i_203760, min_arg_222450);\n        int64_t i64_arg_222452 = sub64(min_res_222451, min_res_22244",
                   "8);\n        double i64_res_222453 = sitofp_i64_f64(i64_arg_222452);\n        int64_t i64_arg_222454 = sub64(gtid_222438, min_res_222448);\n        double i64_res_222455 = sitofp_i64_f64(i64_arg_222454);\n        double u_222456 = i64_res_222455 / i64_res_222453;\n        double u2_222457 = u_222456 * u_222456;\n        double u3_222458 = u_222456 * u2_222457;\n        double x_222459 = 2.0 * u3_222458;\n        double y_222460 = 3.0 * u2_222457;\n        double x_222461 = x_222459 - y_222460;\n        double x_222462 = 1.0 + x_222461;\n        bool x_222463 = sle64((int64_t) 0, j_222445);\n        bool y_222464 = slt64(j_222445, l_n_m_203733);\n        bool bounds_check_222465 = x_222463 && y_222464;\n        bool index_certs_222466;\n        \n        if (!bounds_check_222465) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 50) == -1) {\n                    global_failure_args[0] = (int64_t) j_222445;\n                    global_failure_args[1] = (int64_t) l_n_m_203733;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        double y_222467;\n        \n        y_222467 = ((__global double *) ext_mem_231016)[gtid_222437 *\n                                                        l_n_m_203733 +\n                                                        j_222445];\n        \n        double x_222468 = x_222462 * y_222467;\n        double x_222469 = y_222460 - x_222459;\n        bool x_222470 = sle64((int64_t) 0, defunc_0_m_fun_arg_222449);\n        bool y_222471 = slt64(defunc_0_m_fun_arg_222449, l_n_m_203733);\n        bool bounds_check_222472 = x_222470 && y_222471;\n        bool index_certs_222473;\n        \n        if (!bounds_check_222472) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 51) == -1) {\n                    global_failure_args[0] =\n                        (int64_t) defunc_0_m_fun_arg_222449;\n                    global_failure_args[1] = (int64_t) l_n_m_203733;\n         ",
                   "           ;\n                }\n                return;\n            }\n        }\n        \n        double y_222474;\n        \n        y_222474 = ((__global double *) ext_mem_231016)[gtid_222437 *\n                                                        l_n_m_203733 +\n                                                        defunc_0_m_fun_arg_222449];\n        \n        double y_222475 = x_222469 * y_222474;\n        double x_222476 = x_222468 + y_222475;\n        double y_222477 = 2.0 * u2_222457;\n        double x_222478 = u3_222458 - y_222477;\n        double x_222479 = u_222456 + x_222478;\n        double y_222480;\n        \n        y_222480 = ((__global double *) ext_mem_231015)[gtid_222437 *\n                                                        l_n_m_203733 +\n                                                        j_222445];\n        \n        double x_222481 = x_222479 * y_222480;\n        double y_222482 = i64_res_222453 * x_222481;\n        double x_222483 = x_222476 + y_222482;\n        double x_222484 = u3_222458 - u2_222457;\n        double y_222485;\n        \n        y_222485 = ((__global double *) ext_mem_231015)[gtid_222437 *\n                                                        l_n_m_203733 +\n                                                        defunc_0_m_fun_arg_222449];\n        \n        double x_222486 = x_222484 * y_222485;\n        double y_222487 = i64_res_222453 * x_222486;\n        double defunc_4_interpolate_proc_res_222488 = x_222483 + y_222487;\n        \n        ((__global double *) mem_231021)[gtid_222437 * n_203572 + gtid_222438] =\n            defunc_4_interpolate_proc_res_222488;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_222434\n}\n__kernel void mainzisegmap_222534(__global int *global_failure,\n                                  int64_t n_203572, int64_t n_p_203574,\n                                  int64_t partition_sizze_203667,\n                                  int64_t C_len_203724, int64_t ext_231023,\n                               ",
                   "   __global unsigned char *mem_230608, __global\n                                  unsigned char *ext_mem_231022, __global\n                                  unsigned char *mem_231028)\n{\n    #define segmap_group_sizze_222529 (mainzisegmap_group_sizze_222503)\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_235448;\n    int32_t local_tid_235449;\n    int64_t group_sizze_235452;\n    int32_t wave_sizze_235451;\n    int32_t group_tid_235450;\n    \n    global_tid_235448 = get_global_id(0);\n    local_tid_235449 = get_local_id(0);\n    group_sizze_235452 = get_local_size(0);\n    wave_sizze_235451 = LOCKSTEP_WIDTH;\n    group_tid_235450 = get_group_id(0);\n    \n    int32_t phys_tid_222534 = global_tid_235448;\n    int64_t global_tid_235453 = sext_i32_i64(group_tid_235450) *\n            segmap_group_sizze_222529 + sext_i32_i64(local_tid_235449);\n    int64_t slice_235454 = n_203572;\n    int64_t slice_235455 = partition_sizze_203667 * slice_235454;\n    int64_t gtid_222532 = squot64(global_tid_235453, slice_235454);\n    int64_t remnant_235456 = global_tid_235453 - gtid_222532 * slice_235454;\n    int64_t gtid_222533 = remnant_235456;\n    int64_t remnant_235457 = remnant_235456 - gtid_222533;\n    \n    if (slt64(gtid_222532, partition_sizze_203667) && slt64(gtid_222533,\n                                                            n_203572)) {\n        int64_t slice_228418 = n_p_203574 + gtid_222533;\n        double x_222535;\n        \n        x_222535 = ((__global double *) mem_230608)[gtid_222532 * C_len_203724 +\n                                                    slice_228418];\n        \n        double x_222536;\n        \n        x_222536 = ((__global double *) ext_mem_231022)[gtid_222532 *\n                                                        ext_231023 +\n                                                        gtid_222533];\n        \n        double defunc_1_f_res_222537",
                   " = x_222535 - x_222536;\n        \n        ((__global double *) mem_231028)[gtid_222532 * n_203572 + gtid_222533] =\n            defunc_1_f_res_222537;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_222529\n}\n__kernel void mainzisegmap_222641(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572, int64_t q_t_203576,\n                                  int64_t jump_t_203582,\n                                  int64_t partition_sizze_203667,\n                                  int64_t t_n_m_203740, int64_t i_203760,\n                                  int64_t num_groups_222637,\n                                  int64_t num_threads_232294, __global\n                                  unsigned char *mem_229269, __global\n                                  unsigned char *ext_mem_229304, __global\n                                  unsigned char *mem_231035, __global\n                                  unsigned char *mem_231038, __global\n                                  unsigned char *mem_231041, __global\n                                  unsigned char *mem_231044, __global\n                                  unsigned char *mem_231047, __global\n                                  unsigned char *mem_231111, __global\n                                  unsigned char *color_232151, __global\n                                  unsigned char *color_232152, __global\n                                  unsigned char *color_232153)\n{\n    #define segmap_group_sizze_222636 (mainzisegmap_group_sizze_222544)\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_235473;\n    int32_t local_tid_235474;\n    int64_t group_sizze_235477;\n    int32_t wave_sizze_235476;\n    int32_t group_tid_235475;\n    \n    global_tid_235473 = get_global_id(0);\n    local_tid_235474 = get_local_id(0);\n    group_sizze_235477 = get_local_size(0);\n    wave_sizze_235476 = LOCKSTEP_WIDTH;\n    group_tid_235475 = get_group_id(0);\n    \n    int32_t phys_tid_222641 = global_tid_235473;\n    int32_t phys_group_id_235478;\n    \n    phys_group_id_235478 = get_group_id(0);\n    for (int32_t i_235479 = 0; i_235479 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667,\n                                          segmap_group_sizze_222636)) -\n                   phys_group_id_235478, sext_i64_i32(num_groups_222637));\n         i_235479++) {\n        int32_t virt_group_id_235480 = phys_group_id_235478 + i_235479 *\n                sext_i64_i32(num_groups_222637);\n        int64_t global_tid_235481 = sext_i32_i64(virt_group_id_235480) *\n                segmap_group_sizze_222636 + sext_i32_i64(local_tid_235474);\n        int64_t slice_235482 = partition_sizze_203667;\n        int64_t gtid_222640 = global_tid_235481;\n        int64_t remnant_235483 = global_tid_235481 - gtid_222640;\n        \n        if (slt64(gtid_222640, partition_sizze_203667)) {\n            int64_t x_222646;\n            \n            x_222646 = ((__global int64_t *) ext_mem_229304)[gtid_222640];\n            for (int64_t i_229097 = 0; i_229097 < n_203572; i_229097++) {\n                double x_222650;\n                \n                x_222650 = ((__global double *) mem_229269)[gtid_222640 *\n                                                            n_203572 +\n                                                            i_229097];\n                \n                double x_222651;\n                \n                x_222651 = ((__global double *) mem_231035)[i_229097 *\n                                                            partition_sizze_203667 +\n                             ",
                   "                               gtid_222640];\n                \n                double defunc_1_f_res_222652 = x_222650 - x_222651;\n                \n                ((__global double *) color_232151)[phys_tid_222641 + i_229097 *\n                                                   num_threads_232294] =\n                    defunc_1_f_res_222652;\n            }\n            for (int64_t i_229103 = 0; i_229103 < n_203572; i_229103++) {\n                int64_t x_222655;\n                \n                x_222655 = ((__global int64_t *) mem_231038)[i_229103 *\n                                                             partition_sizze_203667 +\n                                                             gtid_222640];\n                \n                bool cond_222656 = sle64((int64_t) 0, x_222655);\n                double defunc_0_f_res_222657;\n                \n                if (cond_222656) {\n                    bool y_222658 = slt64(x_222655, n_203572);\n                    bool bounds_check_222659 = cond_222656 && y_222658;\n                    bool index_certs_222660;\n                    \n                    if (!bounds_check_222659) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          52) == -1) {\n                                global_failure_args[0] = (int64_t) x_222655;\n                                global_failure_args[1] = (int64_t) n_203572;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double defunc_0_f_res_t_res_222661;\n                    \n                    defunc_0_f_res_t_res_222661 = ((__global\n                                                    double *) color_232151)[phys_tid_222641 +\n                                                                      ",
                   "      x_222655 *\n                                                                            num_threads_232294];\n                    defunc_0_f_res_222657 = defunc_0_f_res_t_res_222661;\n                } else {\n                    defunc_0_f_res_222657 = 0.0;\n                }\n                \n                double defunc_0_f_res_222662;\n                \n                if (cond_222656) {\n                    bool y_222663 = slt64(x_222655, n_203572);\n                    bool bounds_check_222664 = cond_222656 && y_222663;\n                    bool index_certs_222665;\n                    \n                    if (!bounds_check_222664) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          53) == -1) {\n                                global_failure_args[0] = (int64_t) x_222655;\n                                global_failure_args[1] = (int64_t) n_203572;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double defunc_0_f_res_t_res_222666;\n                    \n                    defunc_0_f_res_t_res_222666 = ((__global\n                                                    double *) mem_231047)[x_222655 *\n                                                                          partition_sizze_203667 +\n                                                                          gtid_222640];\n                    defunc_0_f_res_222662 = defunc_0_f_res_t_res_222666;\n                } else {\n                    defunc_0_f_res_222662 = 0.0;\n                }\n                ((__global double *) color_232153)[phys_tid_222641 + i_229103 *\n                                                   num_threads_232294] =\n                    defunc_0_f_res_222662;\n                ((__global doubl",
                   "e *) color_232152)[phys_tid_222641 + i_229103 *\n                                                   num_threads_232294] =\n                    defunc_0_f_res_222657;\n            }\n            for (int64_t i_229108 = 0; i_229108 < t_n_m_203740; i_229108++) {\n                int64_t x_222669;\n                \n                x_222669 = ((__global int64_t *) mem_231041)[i_229108 *\n                                                             partition_sizze_203667 +\n                                                             gtid_222640];\n                \n                double x_222670;\n                \n                x_222670 = ((__global double *) mem_231044)[i_229108 *\n                                                            partition_sizze_203667 +\n                                                            gtid_222640];\n                \n                int64_t min_arg_222671 = mul64(jump_t_203582, i_229108);\n                int64_t min_res_222672 = smin64(i_203760, min_arg_222671);\n                int64_t defunc_0_g_res_222673 = add64((int64_t) 1,\n                                                      min_res_222672);\n                double defunc_2_reduce_res_222674;\n                double redout_228312 = 0.0;\n                \n                for (int64_t i_228313 = 0; i_228313 < q_t_203576; i_228313++) {\n                    bool cond_222679 = sle64(x_222646, i_228313);\n                    int64_t defunc_0_f_res_222680;\n                    \n                    if (cond_222679) {\n                        defunc_0_f_res_222680 = (int64_t) 0;\n                    } else {\n                        int64_t i_222681 = add64(x_222669, i_228313);\n                        int64_t defunc_0_add_arg_222682;\n                        \n                        defunc_0_add_arg_222682 = ((__global\n                                                    int64_t *) mem_231038)[i_222681 *\n                                                                           partition_sizze_203667 +\n  ",
                   "                                                                         gtid_222640];\n                        \n                        int64_t defunc_1_add_res_222683 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_222682);\n                        \n                        defunc_0_f_res_222680 = defunc_1_add_res_222683;\n                    }\n                    \n                    double defunc_0_f_res_222684;\n                    \n                    if (cond_222679) {\n                        defunc_0_f_res_222684 = 0.0;\n                    } else {\n                        int64_t i_222685 = add64(x_222669, i_228313);\n                        double defunc_0_add_arg_222686;\n                        \n                        defunc_0_add_arg_222686 = ((__global\n                                                    double *) color_232153)[phys_tid_222641 +\n                                                                            i_222685 *\n                                                                            num_threads_232294];\n                        defunc_0_f_res_222684 = defunc_0_add_arg_222686;\n                    }\n                    \n                    int64_t binop_p_222687 = sub64(defunc_0_f_res_222680,\n                                                   defunc_0_g_res_222673);\n                    double defunc_0_f_res_222688 =\n                           sitofp_i64_f64(binop_p_222687);\n                    double abs_res_222689 = fabs(defunc_0_f_res_222688);\n                    double tmp1_222690 = abs_res_222689 / x_222670;\n                    double x_222691 = tmp1_222690 * tmp1_222690;\n                    double y_222692 = tmp1_222690 * x_222691;\n                    double tmp2_222693 = 1.0 - y_222692;\n                    double x_222694 = tmp2_222693 * tmp2_222693;\n                    double tmp3_222695 = tmp2_222693 * x_222694;\n                    double w_j_222696 = defunc_0_f_res_222684 * tmp3",
                   "_222695;\n                    double defunc_1_op_res_222677 = w_j_222696 + redout_228312;\n                    double redout_tmp_235488 = defunc_1_op_res_222677;\n                    \n                    redout_228312 = redout_tmp_235488;\n                }\n                defunc_2_reduce_res_222674 = redout_228312;\n                \n                double a0_222697 = 1.0 / defunc_2_reduce_res_222674;\n                double defunc_2_reduce_res_222698;\n                double redout_228314 = 0.0;\n                \n                for (int64_t i_228315 = 0; i_228315 < q_t_203576; i_228315++) {\n                    bool cond_222703 = sle64(x_222646, i_228315);\n                    int64_t defunc_0_f_res_222704;\n                    \n                    if (cond_222703) {\n                        defunc_0_f_res_222704 = (int64_t) 0;\n                    } else {\n                        int64_t i_222705 = add64(x_222669, i_228315);\n                        int64_t defunc_0_add_arg_222706;\n                        \n                        defunc_0_add_arg_222706 = ((__global\n                                                    int64_t *) mem_231038)[i_222705 *\n                                                                           partition_sizze_203667 +\n                                                                           gtid_222640];\n                        \n                        int64_t defunc_1_add_res_222707 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_222706);\n                        \n                        defunc_0_f_res_222704 = defunc_1_add_res_222707;\n                    }\n                    \n                    double defunc_0_f_res_222708;\n                    \n                    if (cond_222703) {\n                        defunc_0_f_res_222708 = 0.0;\n                    } else {\n                        int64_t i_222709 = add64(x_222669, i_228315);\n                        double defunc_0_add_arg_222710;\n  ",
                   "                      \n                        defunc_0_add_arg_222710 = ((__global\n                                                    double *) color_232153)[phys_tid_222641 +\n                                                                            i_222709 *\n                                                                            num_threads_232294];\n                        defunc_0_f_res_222708 = defunc_0_add_arg_222710;\n                    }\n                    \n                    int64_t binop_p_222711 = sub64(defunc_0_f_res_222704,\n                                                   defunc_0_g_res_222673);\n                    double defunc_0_f_res_222712 =\n                           sitofp_i64_f64(binop_p_222711);\n                    double abs_res_222713 = fabs(defunc_0_f_res_222712);\n                    double tmp1_222714 = abs_res_222713 / x_222670;\n                    double x_222715 = tmp1_222714 * tmp1_222714;\n                    double y_222716 = tmp1_222714 * x_222715;\n                    double tmp2_222717 = 1.0 - y_222716;\n                    double x_222718 = tmp2_222717 * tmp2_222717;\n                    double tmp3_222719 = tmp2_222717 * x_222718;\n                    double tmp4_222720 = defunc_0_f_res_222708 * tmp3_222719;\n                    double defunc_0_f_res_222721;\n                    \n                    if (cond_222703) {\n                        defunc_0_f_res_222721 = 0.0;\n                    } else {\n                        int64_t i_222722 = add64(x_222669, i_228315);\n                        double defunc_0_add_arg_222723;\n                        \n                        defunc_0_add_arg_222723 = ((__global\n                                                    double *) color_232152)[phys_tid_222641 +\n                                                                            i_222722 *\n                                                                            num_threads_232294];\n                        defunc_0_f_res_222721 = ",
                   "defunc_0_add_arg_222723;\n                    }\n                    \n                    double x_222724 = a0_222697 * tmp4_222720;\n                    double defunc_9_fit_fun_res_222725 = defunc_0_f_res_222721 *\n                           x_222724;\n                    double defunc_1_op_res_222701 =\n                           defunc_9_fit_fun_res_222725 + redout_228314;\n                    double redout_tmp_235489 = defunc_1_op_res_222701;\n                    \n                    redout_228314 = redout_tmp_235489;\n                }\n                defunc_2_reduce_res_222698 = redout_228314;\n                ((__global double *) color_232151)[phys_tid_222641 + i_229108 *\n                                                   num_threads_232294] =\n                    defunc_2_reduce_res_222698;\n            }\n            for (int64_t i_235490 = 0; i_235490 < t_n_m_203740; i_235490++) {\n                double tmp_235491;\n                \n                tmp_235491 = ((__global\n                               double *) color_232151)[phys_tid_222641 +\n                                                       i_235490 *\n                                                       num_threads_232294];\n                ((__global double *) mem_231111)[gtid_222640 + i_235490 *\n                                                 partition_sizze_203667] =\n                    tmp_235491;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_222636\n}\n__kernel void mainzisegmap_223157(__global int *global_failure,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667, __global\n                                  unsigned char *mem_229269, __global\n                                  unsigned char *mem_231028, __global\n                                  unsigned char *mem_231116)\n{\n    #define segmap_group_sizze_223152 (mainzisegmap_group_sizze_22312",
                   "6)\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_235492;\n    int32_t local_tid_235493;\n    int64_t group_sizze_235496;\n    int32_t wave_sizze_235495;\n    int32_t group_tid_235494;\n    \n    global_tid_235492 = get_global_id(0);\n    local_tid_235493 = get_local_id(0);\n    group_sizze_235496 = get_local_size(0);\n    wave_sizze_235495 = LOCKSTEP_WIDTH;\n    group_tid_235494 = get_group_id(0);\n    \n    int32_t phys_tid_223157 = global_tid_235492;\n    int64_t global_tid_235497 = sext_i32_i64(group_tid_235494) *\n            segmap_group_sizze_223152 + sext_i32_i64(local_tid_235493);\n    int64_t slice_235498 = n_203572;\n    int64_t slice_235499 = partition_sizze_203667 * slice_235498;\n    int64_t gtid_223155 = squot64(global_tid_235497, slice_235498);\n    int64_t remnant_235500 = global_tid_235497 - gtid_223155 * slice_235498;\n    int64_t gtid_223156 = remnant_235500;\n    int64_t remnant_235501 = remnant_235500 - gtid_223156;\n    \n    if (slt64(gtid_223155, partition_sizze_203667) && slt64(gtid_223156,\n                                                            n_203572)) {\n        double x_223158;\n        \n        x_223158 = ((__global double *) mem_229269)[gtid_223155 * n_203572 +\n                                                    gtid_223156];\n        \n        double x_223159;\n        \n        x_223159 = ((__global double *) mem_231028)[gtid_223155 * n_203572 +\n                                                    gtid_223156];\n        \n        double defunc_1_f_res_223160 = x_223158 - x_223159;\n        \n        ((__global double *) mem_231116)[gtid_223155 * n_203572 + gtid_223156] =\n            defunc_1_f_res_223160;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_223152\n}\n__kernel void mainzisegmap_223174(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                           ",
                   "       int64_t *global_failure_args,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667,\n                                  int64_t ctx_param_ext_229596,\n                                  int64_t ctx_param_ext_229597,\n                                  int64_t ctx_param_ext_229599, __global\n                                  unsigned char *ext_mem_229305, __global\n                                  unsigned char *mem_param_229601, __global\n                                  unsigned char *mem_231116, __global\n                                  unsigned char *mem_231121, __global\n                                  unsigned char *mem_231125)\n{\n    #define segmap_group_sizze_223168 (mainzisegmap_group_sizze_223070)\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_235502;\n    int32_t local_tid_235503;\n    int64_t group_sizze_235506;\n    int32_t wave_sizze_235505;\n    int32_t group_tid_235504;\n    \n    global_tid_235502 = get_global_id(0);\n    local_tid_235503 = get_local_id(0);\n    group_sizze_235506 = get_local_size(0);\n    wave_sizze_235505 = LOCKSTEP_WIDTH;\n    group_tid_235504 = get_group_id(0);\n    \n    int32_t phys_tid_223174 = global_tid_235502;\n    int64_t global_tid_235507 = sext_i32_i64(group_tid_235504) *\n            segmap_group_sizze_223168 + sext_i32_i64(local_tid_235503);\n    int64_t slice_235508 = n_203572;\n    int64_t slice_235509 = partition_sizze_203667 * slice_235508;\n    int64_t gtid_223172 = squot64(global_tid_235507, slice_235508);\n    int64_t remnant_235510 = global_tid_235507 - gtid_223172 * slice_235508;\n    int64_t gtid_223173 = remnant_235510;\n    int64_t remnant_235511 = remnant_235510 - gtid_223173;\n    \n    if (slt64(gtid_223172, partition_sizze_203667) && slt64(gtid_223173,\n                                                            n_203572)) {\n        int6",
                   "4_t x_223177;\n        \n        x_223177 = ((__global int64_t *) ext_mem_229305)[gtid_223172 *\n                                                         n_203572 +\n                                                         gtid_223173];\n        \n        bool cond_223178 = sle64((int64_t) 0, x_223177);\n        double defunc_0_f_res_223179;\n        \n        if (cond_223178) {\n            bool y_223180 = slt64(x_223177, n_203572);\n            bool bounds_check_223181 = cond_223178 && y_223180;\n            bool index_certs_223182;\n            \n            if (!bounds_check_223181) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 54) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_223177;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_223183;\n            \n            defunc_0_f_res_t_res_223183 = ((__global\n                                            double *) mem_231116)[gtid_223172 *\n                                                                  n_203572 +\n                                                                  x_223177];\n            defunc_0_f_res_223179 = defunc_0_f_res_t_res_223183;\n        } else {\n            defunc_0_f_res_223179 = 0.0;\n        }\n        \n        double defunc_0_f_res_223184;\n        \n        if (cond_223178) {\n            bool y_223185 = slt64(x_223177, n_203572);\n            bool bounds_check_223186 = cond_223178 && y_223185;\n            bool index_certs_223187;\n            \n            if (!bounds_check_223186) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 55) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_223177;\n                        global_failure_args[1] = (int64_t) n_203572",
                   ";\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_223188;\n            \n            defunc_0_f_res_t_res_223188 = ((__global\n                                            double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                        (gtid_223172 *\n                                                                         ctx_param_ext_229597 +\n                                                                         x_223177 *\n                                                                         ctx_param_ext_229599)];\n            defunc_0_f_res_223184 = defunc_0_f_res_t_res_223188;\n        } else {\n            defunc_0_f_res_223184 = 0.0;\n        }\n        ((__global double *) mem_231121)[gtid_223172 * n_203572 + gtid_223173] =\n            defunc_0_f_res_223184;\n        ((__global double *) mem_231125)[gtid_223172 * n_203572 + gtid_223173] =\n            defunc_0_f_res_223179;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_223168\n}\n__kernel void mainzisegmap_223202(__global int *global_failure,\n                                  int64_t n_203572, int64_t q_t_203576,\n                                  int64_t jump_t_203582,\n                                  int64_t partition_sizze_203667,\n                                  int64_t t_n_m_203740, int64_t i_203760,\n                                  __global unsigned char *ext_mem_229304,\n                                  __global unsigned char *ext_mem_229305,\n                                  __global unsigned char *ext_mem_229568,\n                                  __global unsigned char *ext_mem_229569,\n                                  __global unsigned char *mem_231121, __global\n                                  unsigned char *mem_231125, __global\n                                  unsigned char *mem_231130)\n{\n    #define segmap_group_",
                   "sizze_223193 (mainzisegmap_group_sizze_222733)\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_235512;\n    int32_t local_tid_235513;\n    int64_t group_sizze_235516;\n    int32_t wave_sizze_235515;\n    int32_t group_tid_235514;\n    \n    global_tid_235512 = get_global_id(0);\n    local_tid_235513 = get_local_id(0);\n    group_sizze_235516 = get_local_size(0);\n    wave_sizze_235515 = LOCKSTEP_WIDTH;\n    group_tid_235514 = get_group_id(0);\n    \n    int32_t phys_tid_223202 = global_tid_235512;\n    int64_t global_tid_235517 = sext_i32_i64(group_tid_235514) *\n            segmap_group_sizze_223193 + sext_i32_i64(local_tid_235513);\n    int64_t slice_235518 = t_n_m_203740;\n    int64_t slice_235519 = partition_sizze_203667 * slice_235518;\n    int64_t gtid_223200 = squot64(global_tid_235517, slice_235518);\n    int64_t remnant_235520 = global_tid_235517 - gtid_223200 * slice_235518;\n    int64_t gtid_223201 = remnant_235520;\n    int64_t remnant_235521 = remnant_235520 - gtid_223201;\n    \n    if (slt64(gtid_223200, partition_sizze_203667) && slt64(gtid_223201,\n                                                            t_n_m_203740)) {\n        int64_t x_223204;\n        \n        x_223204 = ((__global int64_t *) ext_mem_229304)[gtid_223200];\n        \n        int64_t x_223208;\n        \n        x_223208 = ((__global int64_t *) ext_mem_229569)[gtid_223200 *\n                                                         t_n_m_203740 +\n                                                         gtid_223201];\n        \n        double x_223209;\n        \n        x_223209 = ((__global double *) ext_mem_229568)[gtid_223200 *\n                                                        t_n_m_203740 +\n                                                        gtid_223201];\n        \n        int64_t min_arg_223210 = mul64(jump_t_203582, gtid_223201);\n        int64_t min_res_223211 = smin64(i_2",
                   "03760, min_arg_223210);\n        int64_t defunc_0_g_res_223212 = add64((int64_t) 1, min_res_223211);\n        double defunc_2_reduce_res_223213;\n        double redout_228320 = 0.0;\n        \n        for (int64_t i_228321 = 0; i_228321 < q_t_203576; i_228321++) {\n            bool cond_223218 = sle64(x_223204, i_228321);\n            int64_t defunc_0_f_res_223219;\n            \n            if (cond_223218) {\n                defunc_0_f_res_223219 = (int64_t) 0;\n            } else {\n                int64_t i_223220 = add64(x_223208, i_228321);\n                int64_t defunc_0_add_arg_223221;\n                \n                defunc_0_add_arg_223221 = ((__global\n                                            int64_t *) ext_mem_229305)[gtid_223200 *\n                                                                       n_203572 +\n                                                                       i_223220];\n                \n                int64_t defunc_1_add_res_223222 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_223221);\n                \n                defunc_0_f_res_223219 = defunc_1_add_res_223222;\n            }\n            \n            double defunc_0_f_res_223223;\n            \n            if (cond_223218) {\n                defunc_0_f_res_223223 = 0.0;\n            } else {\n                int64_t i_223224 = add64(x_223208, i_228321);\n                double defunc_0_add_arg_223225;\n                \n                defunc_0_add_arg_223225 = ((__global\n                                            double *) mem_231121)[gtid_223200 *\n                                                                  n_203572 +\n                                                                  i_223224];\n                defunc_0_f_res_223223 = defunc_0_add_arg_223225;\n            }\n            \n            int64_t binop_p_223226 = sub64(defunc_0_f_res_223219,\n                                           defunc_0_g_res_223212);\n            double defu",
                   "nc_0_f_res_223227 = sitofp_i64_f64(binop_p_223226);\n            double abs_res_223228 = fabs(defunc_0_f_res_223227);\n            double tmp1_223229 = abs_res_223228 / x_223209;\n            double x_223230 = tmp1_223229 * tmp1_223229;\n            double y_223231 = tmp1_223229 * x_223230;\n            double tmp2_223232 = 1.0 - y_223231;\n            double x_223233 = tmp2_223232 * tmp2_223232;\n            double tmp3_223234 = tmp2_223232 * x_223233;\n            double w_j_223235 = defunc_0_f_res_223223 * tmp3_223234;\n            double defunc_1_op_res_223216 = w_j_223235 + redout_228320;\n            double redout_tmp_235522 = defunc_1_op_res_223216;\n            \n            redout_228320 = redout_tmp_235522;\n        }\n        defunc_2_reduce_res_223213 = redout_228320;\n        \n        double a0_223236 = 1.0 / defunc_2_reduce_res_223213;\n        double defunc_2_reduce_res_223237;\n        double redout_228322 = 0.0;\n        \n        for (int64_t i_228323 = 0; i_228323 < q_t_203576; i_228323++) {\n            bool cond_223242 = sle64(x_223204, i_228323);\n            int64_t defunc_0_f_res_223243;\n            \n            if (cond_223242) {\n                defunc_0_f_res_223243 = (int64_t) 0;\n            } else {\n                int64_t i_223244 = add64(x_223208, i_228323);\n                int64_t defunc_0_add_arg_223245;\n                \n                defunc_0_add_arg_223245 = ((__global\n                                            int64_t *) ext_mem_229305)[gtid_223200 *\n                                                                       n_203572 +\n                                                                       i_223244];\n                \n                int64_t defunc_1_add_res_223246 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_223245);\n                \n                defunc_0_f_res_223243 = defunc_1_add_res_223246;\n            }\n            \n            double defunc_0_f_res_223247;\n            \n            ",
                   "if (cond_223242) {\n                defunc_0_f_res_223247 = 0.0;\n            } else {\n                int64_t i_223248 = add64(x_223208, i_228323);\n                double defunc_0_add_arg_223249;\n                \n                defunc_0_add_arg_223249 = ((__global\n                                            double *) mem_231121)[gtid_223200 *\n                                                                  n_203572 +\n                                                                  i_223248];\n                defunc_0_f_res_223247 = defunc_0_add_arg_223249;\n            }\n            \n            int64_t binop_p_223250 = sub64(defunc_0_f_res_223243,\n                                           defunc_0_g_res_223212);\n            double defunc_0_f_res_223251 = sitofp_i64_f64(binop_p_223250);\n            double abs_res_223252 = fabs(defunc_0_f_res_223251);\n            double tmp1_223253 = abs_res_223252 / x_223209;\n            double x_223254 = tmp1_223253 * tmp1_223253;\n            double y_223255 = tmp1_223253 * x_223254;\n            double tmp2_223256 = 1.0 - y_223255;\n            double x_223257 = tmp2_223256 * tmp2_223256;\n            double tmp3_223258 = tmp2_223256 * x_223257;\n            double tmp4_223259 = defunc_0_f_res_223247 * tmp3_223258;\n            double defunc_0_f_res_223260;\n            \n            if (cond_223242) {\n                defunc_0_f_res_223260 = 0.0;\n            } else {\n                int64_t i_223261 = add64(x_223208, i_228323);\n                double defunc_0_add_arg_223262;\n                \n                defunc_0_add_arg_223262 = ((__global\n                                            double *) mem_231125)[gtid_223200 *\n                                                                  n_203572 +\n                                                                  i_223261];\n                defunc_0_f_res_223260 = defunc_0_add_arg_223262;\n            }\n            \n            double x_223263 = a0_223236 * tmp4_223259;\n            double ",
                   "defunc_9_fit_fun_res_223264 = defunc_0_f_res_223260 *\n                   x_223263;\n            double defunc_1_op_res_223240 = defunc_9_fit_fun_res_223264 +\n                   redout_228322;\n            double redout_tmp_235523 = defunc_1_op_res_223240;\n            \n            redout_228322 = redout_tmp_235523;\n        }\n        defunc_2_reduce_res_223237 = redout_228322;\n        ((__global double *) mem_231130)[gtid_223200 * t_n_m_203740 +\n                                         gtid_223201] =\n            defunc_2_reduce_res_223237;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_223193\n}\n__kernel void mainzisegmap_223326(__global int *global_failure,\n                                  int64_t partition_sizze_203667,\n                                  int64_t t_n_m_203740, __global\n                                  unsigned char *mem_231135, __global\n                                  unsigned char *mem_231140)\n{\n    #define segmap_group_sizze_223321 (mainzisegmap_group_sizze_222871)\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_235596;\n    int32_t local_tid_235597;\n    int64_t group_sizze_235600;\n    int32_t wave_sizze_235599;\n    int32_t group_tid_235598;\n    \n    global_tid_235596 = get_global_id(0);\n    local_tid_235597 = get_local_id(0);\n    group_sizze_235600 = get_local_size(0);\n    wave_sizze_235599 = LOCKSTEP_WIDTH;\n    group_tid_235598 = get_group_id(0);\n    \n    int32_t phys_tid_223326 = global_tid_235596;\n    int64_t global_tid_235601 = sext_i32_i64(group_tid_235598) *\n            segmap_group_sizze_223321 + sext_i32_i64(local_tid_235597);\n    int64_t slice_235602 = t_n_m_203740;\n    int64_t slice_235603 = partition_sizze_203667 * slice_235602;\n    int64_t gtid_223324 = squot64(global_tid_235601, slice_235602);\n    int64_t remnant_235604 = global_tid_235601 - gtid_223324 * slice_235602;\n    int64_t gtid_223325 = ",
                   "remnant_235604;\n    int64_t remnant_235605 = remnant_235604 - gtid_223325;\n    \n    if (slt64(gtid_223324, partition_sizze_203667) && slt64(gtid_223325,\n                                                            t_n_m_203740)) {\n        double defunc_2_reduce_res_223327;\n        \n        defunc_2_reduce_res_223327 = ((__global\n                                       double *) mem_231135)[gtid_223324 *\n                                                             t_n_m_203740 +\n                                                             gtid_223325];\n        \n        double a0_223328 = 1.0 / defunc_2_reduce_res_223327;\n        \n        ((__global double *) mem_231140)[gtid_223324 * t_n_m_203740 +\n                                         gtid_223325] = a0_223328;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_223321\n}\n__kernel void mainzisegmap_223513(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572, int64_t q_t_203576,\n                                  int64_t jump_t_203582,\n                                  int64_t partition_sizze_203667,\n                                  int64_t t_n_m_203740, int64_t i_203760,\n                                  int64_t num_groups_223508,\n                                  int64_t num_threads_232304, __global\n                                  unsigned char *mem_229269, __global\n                                  unsigned char *ext_mem_229304, __global\n                                  unsigned char *mem_231155, __global\n                                  unsigned char *mem_231158, __global\n                                  unsigned char *mem_231161, __global\n                                  unsigned char *mem_231164, __global\n                                  unsigned char *mem_231167, __global\n                                  unsigned char *mem_231246, __",
                   "global\n                                  unsigned char *mem_231249, __global\n                                  unsigned char *color_232155, __global\n                                  unsigned char *color_232156, __global\n                                  unsigned char *color_232157, __global\n                                  unsigned char *color_232158)\n{\n    #define segmap_group_sizze_223507 (mainzisegmap_group_sizze_223386)\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_235695;\n    int32_t local_tid_235696;\n    int64_t group_sizze_235699;\n    int32_t wave_sizze_235698;\n    int32_t group_tid_235697;\n    \n    global_tid_235695 = get_global_id(0);\n    local_tid_235696 = get_local_id(0);\n    group_sizze_235699 = get_local_size(0);\n    wave_sizze_235698 = LOCKSTEP_WIDTH;\n    group_tid_235697 = get_group_id(0);\n    \n    int32_t phys_tid_223513 = global_tid_235695;\n    int32_t phys_group_id_235700;\n    \n    phys_group_id_235700 = get_group_id(0);\n    for (int32_t i_235701 = 0; i_235701 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667,\n                                          segmap_group_sizze_223507)) -\n                   phys_group_id_235700, sext_i64_i32(num_groups_223508));\n         i_235701++) {\n        int32_t virt_group_id_235702 = phys_group_id_235700 + i_235701 *\n                sext_i64_i32(num_groups_223508);\n        int64_t global_tid_235703 = sext_i32_i64(virt_group_id_235702) *\n                segmap_group_sizze_223507 + sext_i32_i64(local_tid_235696);\n        int64_t slice_235704 = partition_sizze_203667;\n        int64_t gtid_223512 = global_tid_235703;\n        int64_t remnant_235705 = global_tid_235703 - gtid_223512;\n        \n   ",
                   "     if (slt64(gtid_223512, partition_sizze_203667)) {\n            int64_t x_223518;\n            \n            x_223518 = ((__global int64_t *) ext_mem_229304)[gtid_223512];\n            for (int64_t i_229112 = 0; i_229112 < n_203572; i_229112++) {\n                double x_223522;\n                \n                x_223522 = ((__global double *) mem_229269)[gtid_223512 *\n                                                            n_203572 +\n                                                            i_229112];\n                \n                double x_223523;\n                \n                x_223523 = ((__global double *) mem_231155)[i_229112 *\n                                                            partition_sizze_203667 +\n                                                            gtid_223512];\n                \n                double defunc_1_f_res_223524 = x_223522 - x_223523;\n                \n                ((__global double *) color_232155)[phys_tid_223513 + i_229112 *\n                                                   num_threads_232304] =\n                    defunc_1_f_res_223524;\n            }\n            for (int64_t i_229118 = 0; i_229118 < n_203572; i_229118++) {\n                int64_t x_223527;\n                \n                x_223527 = ((__global int64_t *) mem_231158)[i_229118 *\n                                                             partition_sizze_203667 +\n                                                             gtid_223512];\n                \n                bool cond_223528 = sle64((int64_t) 0, x_223527);\n                double defunc_0_f_res_223529;\n                \n                if (cond_223528) {\n                    bool y_223530 = slt64(x_223527, n_203572);\n                    bool bounds_check_223531 = cond_223528 && y_223530;\n                    bool index_certs_223532;\n                    \n                    if (!bounds_check_223531) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_",
                   "failure, -1,\n                                                          56) == -1) {\n                                global_failure_args[0] = (int64_t) x_223527;\n                                global_failure_args[1] = (int64_t) n_203572;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double defunc_0_f_res_t_res_223533;\n                    \n                    defunc_0_f_res_t_res_223533 = ((__global\n                                                    double *) color_232155)[phys_tid_223513 +\n                                                                            x_223527 *\n                                                                            num_threads_232304];\n                    defunc_0_f_res_223529 = defunc_0_f_res_t_res_223533;\n                } else {\n                    defunc_0_f_res_223529 = 0.0;\n                }\n                \n                double defunc_0_f_res_223534;\n                \n                if (cond_223528) {\n                    bool y_223535 = slt64(x_223527, n_203572);\n                    bool bounds_check_223536 = cond_223528 && y_223535;\n                    bool index_certs_223537;\n                    \n                    if (!bounds_check_223536) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          57) == -1) {\n                                global_failure_args[0] = (int64_t) x_223527;\n                                global_failure_args[1] = (int64_t) n_203572;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double defunc_0_f_",
                   "res_t_res_223538;\n                    \n                    defunc_0_f_res_t_res_223538 = ((__global\n                                                    double *) mem_231167)[x_223527 *\n                                                                          partition_sizze_203667 +\n                                                                          gtid_223512];\n                    defunc_0_f_res_223534 = defunc_0_f_res_t_res_223538;\n                } else {\n                    defunc_0_f_res_223534 = 0.0;\n                }\n                ((__global double *) color_232158)[phys_tid_223513 + i_229118 *\n                                                   num_threads_232304] =\n                    defunc_0_f_res_223534;\n                ((__global double *) color_232157)[phys_tid_223513 + i_229118 *\n                                                   num_threads_232304] =\n                    defunc_0_f_res_223529;\n            }\n            for (int64_t i_229125 = 0; i_229125 < t_n_m_203740; i_229125++) {\n                int64_t x_223542;\n                \n                x_223542 = ((__global int64_t *) mem_231161)[i_229125 *\n                                                             partition_sizze_203667 +\n                                                             gtid_223512];\n                \n                double x_223543;\n                \n                x_223543 = ((__global double *) mem_231164)[i_229125 *\n                                                            partition_sizze_203667 +\n                                                            gtid_223512];\n                \n                int64_t min_arg_223544 = mul64(jump_t_203582, i_229125);\n                int64_t min_res_223545 = smin64(i_203760, min_arg_223544);\n                int64_t defunc_0_g_res_223546 = add64((int64_t) 1,\n                                                      min_res_223545);\n                double defunc_2_reduce_res_223547;\n                double defunc_2_reduce_res_2",
                   "23548;\n                double defunc_2_reduce_res_223549;\n                double redout_228336;\n                double redout_228337;\n                double redout_228338;\n                \n                redout_228336 = 0.0;\n                redout_228337 = 0.0;\n                redout_228338 = 0.0;\n                for (int64_t i_228339 = 0; i_228339 < q_t_203576; i_228339++) {\n                    bool cond_223560 = sle64(x_223518, i_228339);\n                    int64_t defunc_0_f_res_223561;\n                    \n                    if (cond_223560) {\n                        defunc_0_f_res_223561 = (int64_t) 0;\n                    } else {\n                        int64_t i_223562 = add64(x_223542, i_228339);\n                        int64_t defunc_0_add_arg_223563;\n                        \n                        defunc_0_add_arg_223563 = ((__global\n                                                    int64_t *) mem_231158)[i_223562 *\n                                                                           partition_sizze_203667 +\n                                                                           gtid_223512];\n                        \n                        int64_t defunc_1_add_res_223564 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_223563);\n                        \n                        defunc_0_f_res_223561 = defunc_1_add_res_223564;\n                    }\n                    \n                    double defunc_0_f_res_223565;\n                    \n                    if (cond_223560) {\n                        defunc_0_f_res_223565 = 0.0;\n                    } else {\n                        int64_t i_223566 = add64(x_223542, i_228339);\n                        double defunc_0_add_arg_223567;\n                        \n                        defunc_0_add_arg_223567 = ((__global\n                                                    double *) color_232158)[phys_tid_223513 +\n                                  ",
                   "                                          i_223566 *\n                                                                            num_threads_232304];\n                        defunc_0_f_res_223565 = defunc_0_add_arg_223567;\n                    }\n                    \n                    int64_t binop_p_223568 = sub64(defunc_0_f_res_223561,\n                                                   defunc_0_g_res_223546);\n                    double defunc_0_f_res_223569 =\n                           sitofp_i64_f64(binop_p_223568);\n                    double abs_res_223570 = fabs(defunc_0_f_res_223569);\n                    double tmp1_223571 = abs_res_223570 / x_223543;\n                    double x_223572 = tmp1_223571 * tmp1_223571;\n                    double y_223573 = tmp1_223571 * x_223572;\n                    double tmp2_223574 = 1.0 - y_223573;\n                    double x_223575 = tmp2_223574 * tmp2_223574;\n                    double tmp3_223576 = tmp2_223574 * x_223575;\n                    double w_j_223577 = defunc_0_f_res_223565 * tmp3_223576;\n                    double xw_j_223578 = defunc_0_f_res_223569 * w_j_223577;\n                    double x2w_j_223579 = defunc_0_f_res_223569 * xw_j_223578;\n                    double defunc_1_op_res_223552 = w_j_223577 + redout_228336;\n                    double defunc_1_op_res_223555 = xw_j_223578 + redout_228337;\n                    double defunc_1_op_res_223558 = x2w_j_223579 +\n                           redout_228338;\n                    double redout_tmp_235711 = defunc_1_op_res_223552;\n                    double redout_tmp_235712 = defunc_1_op_res_223555;\n                    double redout_tmp_235713 = defunc_1_op_res_223558;\n                    \n                    redout_228336 = redout_tmp_235711;\n                    redout_228337 = redout_tmp_235712;\n                    redout_228338 = redout_tmp_235713;\n                }\n                defunc_2_reduce_res_223547 = redout_228336;\n                defunc_2_reduce_res_2235",
                   "48 = redout_228337;\n                defunc_2_reduce_res_223549 = redout_228338;\n                \n                double x_223580 = defunc_2_reduce_res_223547 *\n                       defunc_2_reduce_res_223549;\n                double y_223581 = defunc_2_reduce_res_223548 *\n                       defunc_2_reduce_res_223548;\n                double y_223582 = x_223580 - y_223581;\n                double det1_223583 = 1.0 / y_223582;\n                double a11_223584 = defunc_2_reduce_res_223549 * det1_223583;\n                double x_223585 = 0.0 - defunc_2_reduce_res_223548;\n                double b11_223586 = det1_223583 * x_223585;\n                double c11_223587 = defunc_2_reduce_res_223547 * det1_223583;\n                double defunc_2_reduce_res_223588;\n                double defunc_2_reduce_res_223589;\n                double redout_228340;\n                double redout_228341;\n                \n                redout_228340 = 0.0;\n                redout_228341 = 0.0;\n                for (int64_t i_228342 = 0; i_228342 < q_t_203576; i_228342++) {\n                    bool cond_223597 = sle64(x_223518, i_228342);\n                    int64_t defunc_0_f_res_223598;\n                    \n                    if (cond_223597) {\n                        defunc_0_f_res_223598 = (int64_t) 0;\n                    } else {\n                        int64_t i_223599 = add64(x_223542, i_228342);\n                        int64_t defunc_0_add_arg_223600;\n                        \n                        defunc_0_add_arg_223600 = ((__global\n                                                    int64_t *) mem_231158)[i_223599 *\n                                                                           partition_sizze_203667 +\n                                                                           gtid_223512];\n                        \n                        int64_t defunc_1_add_res_223601 = add64((int64_t) 1,\n                                                                defunc_0_add_",
                   "arg_223600);\n                        \n                        defunc_0_f_res_223598 = defunc_1_add_res_223601;\n                    }\n                    \n                    double defunc_0_f_res_223602;\n                    \n                    if (cond_223597) {\n                        defunc_0_f_res_223602 = 0.0;\n                    } else {\n                        int64_t i_223603 = add64(x_223542, i_228342);\n                        double defunc_0_add_arg_223604;\n                        \n                        defunc_0_add_arg_223604 = ((__global\n                                                    double *) color_232158)[phys_tid_223513 +\n                                                                            i_223603 *\n                                                                            num_threads_232304];\n                        defunc_0_f_res_223602 = defunc_0_add_arg_223604;\n                    }\n                    \n                    int64_t binop_p_223605 = sub64(defunc_0_f_res_223598,\n                                                   defunc_0_g_res_223546);\n                    double defunc_0_f_res_223606 =\n                           sitofp_i64_f64(binop_p_223605);\n                    double abs_res_223607 = fabs(defunc_0_f_res_223606);\n                    double tmp1_223608 = abs_res_223607 / x_223543;\n                    double x_223609 = tmp1_223608 * tmp1_223608;\n                    double y_223610 = tmp1_223608 * x_223609;\n                    double tmp2_223611 = 1.0 - y_223610;\n                    double x_223612 = tmp2_223611 * tmp2_223611;\n                    double tmp3_223613 = tmp2_223611 * x_223612;\n                    double tmp4_223614 = defunc_0_f_res_223602 * tmp3_223613;\n                    double defunc_1_f_res_223615 = defunc_0_f_res_223606 *\n                           tmp4_223614;\n                    double defunc_0_f_res_223616;\n                    \n                    if (cond_223597) {\n                        defunc_",
                   "0_f_res_223616 = 0.0;\n                    } else {\n                        int64_t i_223617 = add64(x_223542, i_228342);\n                        double defunc_0_add_arg_223618;\n                        \n                        defunc_0_add_arg_223618 = ((__global\n                                                    double *) color_232157)[phys_tid_223513 +\n                                                                            i_223617 *\n                                                                            num_threads_232304];\n                        defunc_0_f_res_223616 = defunc_0_add_arg_223618;\n                    }\n                    \n                    double x_223619 = a11_223584 * tmp4_223614;\n                    double y_223620 = b11_223586 * defunc_1_f_res_223615;\n                    double x_223621 = x_223619 + y_223620;\n                    double defunc_9_fit_fun_res_223622 = defunc_0_f_res_223616 *\n                           x_223621;\n                    double x_223623 = b11_223586 * tmp4_223614;\n                    double y_223624 = c11_223587 * defunc_1_f_res_223615;\n                    double x_223625 = x_223623 + y_223624;\n                    double defunc_9_slope_fun_res_223626 =\n                           defunc_0_f_res_223616 * x_223625;\n                    double defunc_1_op_res_223592 =\n                           defunc_9_fit_fun_res_223622 + redout_228340;\n                    double defunc_1_op_res_223595 =\n                           defunc_9_slope_fun_res_223626 + redout_228341;\n                    double redout_tmp_235714 = defunc_1_op_res_223592;\n                    double redout_tmp_235715 = defunc_1_op_res_223595;\n                    \n                    redout_228340 = redout_tmp_235714;\n                    redout_228341 = redout_tmp_235715;\n                }\n                defunc_2_reduce_res_223588 = redout_228340;\n                defunc_2_reduce_res_223589 = redout_228341;\n                ((__global double *) color_232156)",
                   "[phys_tid_223513 + i_229125 *\n                                                   num_threads_232304] =\n                    defunc_2_reduce_res_223588;\n                ((__global double *) color_232155)[phys_tid_223513 + i_229125 *\n                                                   num_threads_232304] =\n                    defunc_2_reduce_res_223589;\n            }\n            for (int64_t i_235716 = 0; i_235716 < t_n_m_203740; i_235716++) {\n                double tmp_235717;\n                \n                tmp_235717 = ((__global\n                               double *) color_232156)[phys_tid_223513 +\n                                                       i_235716 *\n                                                       num_threads_232304];\n                ((__global double *) mem_231246)[gtid_223512 + i_235716 *\n                                                 partition_sizze_203667] =\n                    tmp_235717;\n            }\n            for (int64_t i_235718 = 0; i_235718 < t_n_m_203740; i_235718++) {\n                double tmp_235719;\n                \n                tmp_235719 = ((__global\n                               double *) color_232155)[phys_tid_223513 +\n                                                       i_235718 *\n                                                       num_threads_232304];\n                ((__global double *) mem_231249)[gtid_223512 + i_235718 *\n                                                 partition_sizze_203667] =\n                    tmp_235719;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_223507\n}\n__kernel void mainzisegmap_224163(__global int *global_failure,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667, __global\n                                  unsigned char *mem_229269, __global\n                                  unsigned char *mem_231028, __global",
                   "\n                                  unsigned char *mem_231254)\n{\n    #define segmap_group_sizze_224158 (mainzisegmap_group_sizze_224132)\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_235720;\n    int32_t local_tid_235721;\n    int64_t group_sizze_235724;\n    int32_t wave_sizze_235723;\n    int32_t group_tid_235722;\n    \n    global_tid_235720 = get_global_id(0);\n    local_tid_235721 = get_local_id(0);\n    group_sizze_235724 = get_local_size(0);\n    wave_sizze_235723 = LOCKSTEP_WIDTH;\n    group_tid_235722 = get_group_id(0);\n    \n    int32_t phys_tid_224163 = global_tid_235720;\n    int64_t global_tid_235725 = sext_i32_i64(group_tid_235722) *\n            segmap_group_sizze_224158 + sext_i32_i64(local_tid_235721);\n    int64_t slice_235726 = n_203572;\n    int64_t slice_235727 = partition_sizze_203667 * slice_235726;\n    int64_t gtid_224161 = squot64(global_tid_235725, slice_235726);\n    int64_t remnant_235728 = global_tid_235725 - gtid_224161 * slice_235726;\n    int64_t gtid_224162 = remnant_235728;\n    int64_t remnant_235729 = remnant_235728 - gtid_224162;\n    \n    if (slt64(gtid_224161, partition_sizze_203667) && slt64(gtid_224162,\n                                                            n_203572)) {\n        double x_224164;\n        \n        x_224164 = ((__global double *) mem_229269)[gtid_224161 * n_203572 +\n                                                    gtid_224162];\n        \n        double x_224165;\n        \n        x_224165 = ((__global double *) mem_231028)[gtid_224161 * n_203572 +\n                                                    gtid_224162];\n        \n        double defunc_1_f_res_224166 = x_224164 - x_224165;\n        \n        ((__global double *) mem_231254)[gtid_224161 * n_203572 + gtid_224162] =\n            defunc_1_f_res_224166;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_224158\n}\n__kernel void mainzisegmap_",
                   "224180(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667,\n                                  int64_t ctx_param_ext_229596,\n                                  int64_t ctx_param_ext_229597,\n                                  int64_t ctx_param_ext_229599, __global\n                                  unsigned char *ext_mem_229305, __global\n                                  unsigned char *mem_param_229601, __global\n                                  unsigned char *mem_231254, __global\n                                  unsigned char *mem_231259, __global\n                                  unsigned char *mem_231263)\n{\n    #define segmap_group_sizze_224174 (mainzisegmap_group_sizze_224076)\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_235730;\n    int32_t local_tid_235731;\n    int64_t group_sizze_235734;\n    int32_t wave_sizze_235733;\n    int32_t group_tid_235732;\n    \n    global_tid_235730 = get_global_id(0);\n    local_tid_235731 = get_local_id(0);\n    group_sizze_235734 = get_local_size(0);\n    wave_sizze_235733 = LOCKSTEP_WIDTH;\n    group_tid_235732 = get_group_id(0);\n    \n    int32_t phys_tid_224180 = global_tid_235730;\n    int64_t global_tid_235735 = sext_i32_i64(group_tid_235732) *\n            segmap_group_sizze_224174 + sext_i32_i64(local_tid_235731);\n    int64_t slice_235736 = n_203572;\n    int64_t slice_235737 = partition_sizze_203667 * slice_235736;\n    int64_t gtid_224178 = squot64(global_tid_235735, slice_235736);\n    int64_t remnant_235738 = global_tid_235735 - gtid_224178 * slice_235736;\n    int64_t gtid_224179 = remnant_235738;\n    int64_t remnant_235739 = remnant_235738 - gtid_224179;\n    \n    if (slt64(gtid_224178",
                   ", partition_sizze_203667) && slt64(gtid_224179,\n                                                            n_203572)) {\n        int64_t x_224183;\n        \n        x_224183 = ((__global int64_t *) ext_mem_229305)[gtid_224178 *\n                                                         n_203572 +\n                                                         gtid_224179];\n        \n        bool cond_224184 = sle64((int64_t) 0, x_224183);\n        double defunc_0_f_res_224185;\n        \n        if (cond_224184) {\n            bool y_224186 = slt64(x_224183, n_203572);\n            bool bounds_check_224187 = cond_224184 && y_224186;\n            bool index_certs_224188;\n            \n            if (!bounds_check_224187) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 58) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_224183;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_224189;\n            \n            defunc_0_f_res_t_res_224189 = ((__global\n                                            double *) mem_231254)[gtid_224178 *\n                                                                  n_203572 +\n                                                                  x_224183];\n            defunc_0_f_res_224185 = defunc_0_f_res_t_res_224189;\n        } else {\n            defunc_0_f_res_224185 = 0.0;\n        }\n        \n        double defunc_0_f_res_224190;\n        \n        if (cond_224184) {\n            bool y_224191 = slt64(x_224183, n_203572);\n            bool bounds_check_224192 = cond_224184 && y_224191;\n            bool index_certs_224193;\n            \n            if (!bounds_check_224192) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 59) ==\n                        -1) {\n   ",
                   "                     global_failure_args[0] = (int64_t) x_224183;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_224194;\n            \n            defunc_0_f_res_t_res_224194 = ((__global\n                                            double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                        (gtid_224178 *\n                                                                         ctx_param_ext_229597 +\n                                                                         x_224183 *\n                                                                         ctx_param_ext_229599)];\n            defunc_0_f_res_224190 = defunc_0_f_res_t_res_224194;\n        } else {\n            defunc_0_f_res_224190 = 0.0;\n        }\n        ((__global double *) mem_231259)[gtid_224178 * n_203572 + gtid_224179] =\n            defunc_0_f_res_224190;\n        ((__global double *) mem_231263)[gtid_224178 * n_203572 + gtid_224179] =\n            defunc_0_f_res_224185;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_224174\n}\n__kernel void mainzisegmap_224210(__global int *global_failure,\n                                  int64_t n_203572, int64_t q_t_203576,\n                                  int64_t jump_t_203582,\n                                  int64_t partition_sizze_203667,\n                                  int64_t t_n_m_203740, int64_t i_203760,\n                                  __global unsigned char *ext_mem_229304,\n                                  __global unsigned char *ext_mem_229305,\n                                  __global unsigned char *ext_mem_229568,\n                                  __global unsigned char *ext_mem_229569,\n                                  __global unsigned char *mem_231259, __global\n                         ",
                   "         unsigned char *mem_231263, __global\n                                  unsigned char *mem_231268, __global\n                                  unsigned char *mem_231272)\n{\n    #define segmap_group_sizze_224199 (mainzisegmap_group_sizze_223634)\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_235740;\n    int32_t local_tid_235741;\n    int64_t group_sizze_235744;\n    int32_t wave_sizze_235743;\n    int32_t group_tid_235742;\n    \n    global_tid_235740 = get_global_id(0);\n    local_tid_235741 = get_local_id(0);\n    group_sizze_235744 = get_local_size(0);\n    wave_sizze_235743 = LOCKSTEP_WIDTH;\n    group_tid_235742 = get_group_id(0);\n    \n    int32_t phys_tid_224210 = global_tid_235740;\n    int64_t global_tid_235745 = sext_i32_i64(group_tid_235742) *\n            segmap_group_sizze_224199 + sext_i32_i64(local_tid_235741);\n    int64_t slice_235746 = t_n_m_203740;\n    int64_t slice_235747 = partition_sizze_203667 * slice_235746;\n    int64_t gtid_224208 = squot64(global_tid_235745, slice_235746);\n    int64_t remnant_235748 = global_tid_235745 - gtid_224208 * slice_235746;\n    int64_t gtid_224209 = remnant_235748;\n    int64_t remnant_235749 = remnant_235748 - gtid_224209;\n    \n    if (slt64(gtid_224208, partition_sizze_203667) && slt64(gtid_224209,\n                                                            t_n_m_203740)) {\n        int64_t x_224212;\n        \n        x_224212 = ((__global int64_t *) ext_mem_229304)[gtid_224208];\n        \n        int64_t x_224216;\n        \n        x_224216 = ((__global int64_t *) ext_mem_229569)[gtid_224208 *\n                                                         t_n_m_203740 +\n                                                         gtid_224209];\n        \n        double x_224217;\n        \n        x_224217 = ((__global double *) ext_mem_229568)[gtid_224208 *\n                                                        t_",
                   "n_m_203740 +\n                                                        gtid_224209];\n        \n        int64_t min_arg_224218 = mul64(jump_t_203582, gtid_224209);\n        int64_t min_res_224219 = smin64(i_203760, min_arg_224218);\n        int64_t defunc_0_g_res_224220 = add64((int64_t) 1, min_res_224219);\n        double defunc_2_reduce_res_224221;\n        double defunc_2_reduce_res_224222;\n        double defunc_2_reduce_res_224223;\n        double redout_228347;\n        double redout_228348;\n        double redout_228349;\n        \n        redout_228347 = 0.0;\n        redout_228348 = 0.0;\n        redout_228349 = 0.0;\n        for (int64_t i_228350 = 0; i_228350 < q_t_203576; i_228350++) {\n            bool cond_224234 = sle64(x_224212, i_228350);\n            int64_t defunc_0_f_res_224235;\n            \n            if (cond_224234) {\n                defunc_0_f_res_224235 = (int64_t) 0;\n            } else {\n                int64_t i_224236 = add64(x_224216, i_228350);\n                int64_t defunc_0_add_arg_224237;\n                \n                defunc_0_add_arg_224237 = ((__global\n                                            int64_t *) ext_mem_229305)[gtid_224208 *\n                                                                       n_203572 +\n                                                                       i_224236];\n                \n                int64_t defunc_1_add_res_224238 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_224237);\n                \n                defunc_0_f_res_224235 = defunc_1_add_res_224238;\n            }\n            \n            double defunc_0_f_res_224239;\n            \n            if (cond_224234) {\n                defunc_0_f_res_224239 = 0.0;\n            } else {\n                int64_t i_224240 = add64(x_224216, i_228350);\n                double defunc_0_add_arg_224241;\n                \n                defunc_0_add_arg_224241 = ((__global\n                                            double *",
                   ") mem_231259)[gtid_224208 *\n                                                                  n_203572 +\n                                                                  i_224240];\n                defunc_0_f_res_224239 = defunc_0_add_arg_224241;\n            }\n            \n            int64_t binop_p_224242 = sub64(defunc_0_f_res_224235,\n                                           defunc_0_g_res_224220);\n            double defunc_0_f_res_224243 = sitofp_i64_f64(binop_p_224242);\n            double abs_res_224244 = fabs(defunc_0_f_res_224243);\n            double tmp1_224245 = abs_res_224244 / x_224217;\n            double x_224246 = tmp1_224245 * tmp1_224245;\n            double y_224247 = tmp1_224245 * x_224246;\n            double tmp2_224248 = 1.0 - y_224247;\n            double x_224249 = tmp2_224248 * tmp2_224248;\n            double tmp3_224250 = tmp2_224248 * x_224249;\n            double w_j_224251 = defunc_0_f_res_224239 * tmp3_224250;\n            double xw_j_224252 = defunc_0_f_res_224243 * w_j_224251;\n            double x2w_j_224253 = defunc_0_f_res_224243 * xw_j_224252;\n            double defunc_1_op_res_224226 = w_j_224251 + redout_228347;\n            double defunc_1_op_res_224229 = xw_j_224252 + redout_228348;\n            double defunc_1_op_res_224232 = x2w_j_224253 + redout_228349;\n            double redout_tmp_235750 = defunc_1_op_res_224226;\n            double redout_tmp_235751 = defunc_1_op_res_224229;\n            double redout_tmp_235752 = defunc_1_op_res_224232;\n            \n            redout_228347 = redout_tmp_235750;\n            redout_228348 = redout_tmp_235751;\n            redout_228349 = redout_tmp_235752;\n        }\n        defunc_2_reduce_res_224221 = redout_228347;\n        defunc_2_reduce_res_224222 = redout_228348;\n        defunc_2_reduce_res_224223 = redout_228349;\n        \n        double x_224254 = defunc_2_reduce_res_224221 *\n               defunc_2_reduce_res_224223;\n        double y_224255 = defunc_2_reduce_res_224222 *\n               defun",
                   "c_2_reduce_res_224222;\n        double y_224256 = x_224254 - y_224255;\n        double det1_224257 = 1.0 / y_224256;\n        double a11_224258 = defunc_2_reduce_res_224223 * det1_224257;\n        double x_224259 = 0.0 - defunc_2_reduce_res_224222;\n        double b11_224260 = det1_224257 * x_224259;\n        double c11_224261 = defunc_2_reduce_res_224221 * det1_224257;\n        double defunc_2_reduce_res_224262;\n        double defunc_2_reduce_res_224263;\n        double redout_228351;\n        double redout_228352;\n        \n        redout_228351 = 0.0;\n        redout_228352 = 0.0;\n        for (int64_t i_228353 = 0; i_228353 < q_t_203576; i_228353++) {\n            bool cond_224271 = sle64(x_224212, i_228353);\n            int64_t defunc_0_f_res_224272;\n            \n            if (cond_224271) {\n                defunc_0_f_res_224272 = (int64_t) 0;\n            } else {\n                int64_t i_224273 = add64(x_224216, i_228353);\n                int64_t defunc_0_add_arg_224274;\n                \n                defunc_0_add_arg_224274 = ((__global\n                                            int64_t *) ext_mem_229305)[gtid_224208 *\n                                                                       n_203572 +\n                                                                       i_224273];\n                \n                int64_t defunc_1_add_res_224275 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_224274);\n                \n                defunc_0_f_res_224272 = defunc_1_add_res_224275;\n            }\n            \n            double defunc_0_f_res_224276;\n            \n            if (cond_224271) {\n                defunc_0_f_res_224276 = 0.0;\n            } else {\n                int64_t i_224277 = add64(x_224216, i_228353);\n                double defunc_0_add_arg_224278;\n                \n                defunc_0_add_arg_224278 = ((__global\n                                            double *) mem_231259)[gtid_224208 *\n          ",
                   "                                                        n_203572 +\n                                                                  i_224277];\n                defunc_0_f_res_224276 = defunc_0_add_arg_224278;\n            }\n            \n            int64_t binop_p_224279 = sub64(defunc_0_f_res_224272,\n                                           defunc_0_g_res_224220);\n            double defunc_0_f_res_224280 = sitofp_i64_f64(binop_p_224279);\n            double abs_res_224281 = fabs(defunc_0_f_res_224280);\n            double tmp1_224282 = abs_res_224281 / x_224217;\n            double x_224283 = tmp1_224282 * tmp1_224282;\n            double y_224284 = tmp1_224282 * x_224283;\n            double tmp2_224285 = 1.0 - y_224284;\n            double x_224286 = tmp2_224285 * tmp2_224285;\n            double tmp3_224287 = tmp2_224285 * x_224286;\n            double tmp4_224288 = defunc_0_f_res_224276 * tmp3_224287;\n            double defunc_1_f_res_224289 = defunc_0_f_res_224280 * tmp4_224288;\n            double defunc_0_f_res_224290;\n            \n            if (cond_224271) {\n                defunc_0_f_res_224290 = 0.0;\n            } else {\n                int64_t i_224291 = add64(x_224216, i_228353);\n                double defunc_0_add_arg_224292;\n                \n                defunc_0_add_arg_224292 = ((__global\n                                            double *) mem_231263)[gtid_224208 *\n                                                                  n_203572 +\n                                                                  i_224291];\n                defunc_0_f_res_224290 = defunc_0_add_arg_224292;\n            }\n            \n            double x_224293 = a11_224258 * tmp4_224288;\n            double y_224294 = b11_224260 * defunc_1_f_res_224289;\n            double x_224295 = x_224293 + y_224294;\n            double defunc_9_fit_fun_res_224296 = defunc_0_f_res_224290 *\n                   x_224295;\n            double x_224297 = b11_224260 * tmp4_224288;\n            double",
                   " y_224298 = c11_224261 * defunc_1_f_res_224289;\n            double x_224299 = x_224297 + y_224298;\n            double defunc_9_slope_fun_res_224300 = defunc_0_f_res_224290 *\n                   x_224299;\n            double defunc_1_op_res_224266 = defunc_9_fit_fun_res_224296 +\n                   redout_228351;\n            double defunc_1_op_res_224269 = defunc_9_slope_fun_res_224300 +\n                   redout_228352;\n            double redout_tmp_235753 = defunc_1_op_res_224266;\n            double redout_tmp_235754 = defunc_1_op_res_224269;\n            \n            redout_228351 = redout_tmp_235753;\n            redout_228352 = redout_tmp_235754;\n        }\n        defunc_2_reduce_res_224262 = redout_228351;\n        defunc_2_reduce_res_224263 = redout_228352;\n        ((__global double *) mem_231268)[gtid_224208 * t_n_m_203740 +\n                                         gtid_224209] =\n            defunc_2_reduce_res_224262;\n        ((__global double *) mem_231272)[gtid_224208 * t_n_m_203740 +\n                                         gtid_224209] =\n            defunc_2_reduce_res_224263;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_224199\n}\n__kernel void mainzisegmap_224374(__global int *global_failure,\n                                  int64_t partition_sizze_203667,\n                                  int64_t t_n_m_203740, __global\n                                  unsigned char *mem_231277, __global\n                                  unsigned char *mem_231281, __global\n                                  unsigned char *mem_231285, __global\n                                  unsigned char *mem_231290, __global\n                                  unsigned char *mem_231294, __global\n                                  unsigned char *mem_231298)\n{\n    #define segmap_group_sizze_224367 (mainzisegmap_group_sizze_223823)\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_235855;\n    int32_t local_tid_235856;\n    int64_t group_sizze_235859;\n    int32_t wave_sizze_235858;\n    int32_t group_tid_235857;\n    \n    global_tid_235855 = get_global_id(0);\n    local_tid_235856 = get_local_id(0);\n    group_sizze_235859 = get_local_size(0);\n    wave_sizze_235858 = LOCKSTEP_WIDTH;\n    group_tid_235857 = get_group_id(0);\n    \n    int32_t phys_tid_224374 = global_tid_235855;\n    int64_t global_tid_235860 = sext_i32_i64(group_tid_235857) *\n            segmap_group_sizze_224367 + sext_i32_i64(local_tid_235856);\n    int64_t slice_235861 = t_n_m_203740;\n    int64_t slice_235862 = partition_sizze_203667 * slice_235861;\n    int64_t gtid_224372 = squot64(global_tid_235860, slice_235861);\n    int64_t remnant_235863 = global_tid_235860 - gtid_224372 * slice_235861;\n    int64_t gtid_224373 = remnant_235863;\n    int64_t remnant_235864 = remnant_235863 - gtid_224373;\n    \n    if (slt64(gtid_224372, partition_sizze_203667) && slt64(gtid_224373,\n                                                            t_n_m_203740)) {\n        double defunc_2_reduce_res_224375;\n        \n        defunc_2_reduce_res_224375 = ((__global\n                                       double *) mem_231277)[gtid_224372 *\n                                                             t_n_m_203740 +\n                                                             gtid_224373];\n        \n        double defunc_2_reduce_res_224376;\n        \n        defunc_2_reduce_res_224376 = ((__global\n                                       double *) mem_231281)[gtid_224372 *\n                                                             t_n_m_203740 +\n                                                             gtid_224373];\n        \n        double defunc_2_reduce_res_224377;\n        \n        defunc_2_reduce_res_224377 = ((__global\n                                       double *) mem_231285)[gtid_224372 *\n                                                             t_n_m_203740 +\n           ",
                   "                                                  gtid_224373];\n        \n        double x_224378 = defunc_2_reduce_res_224375 *\n               defunc_2_reduce_res_224377;\n        double y_224379 = defunc_2_reduce_res_224376 *\n               defunc_2_reduce_res_224376;\n        double y_224380 = x_224378 - y_224379;\n        double det1_224381 = 1.0 / y_224380;\n        double a11_224382 = defunc_2_reduce_res_224377 * det1_224381;\n        double x_224383 = 0.0 - defunc_2_reduce_res_224376;\n        double b11_224384 = det1_224381 * x_224383;\n        double c11_224385 = defunc_2_reduce_res_224375 * det1_224381;\n        \n        ((__global double *) mem_231290)[gtid_224372 * t_n_m_203740 +\n                                         gtid_224373] = a11_224382;\n        ((__global double *) mem_231294)[gtid_224372 * t_n_m_203740 +\n                                         gtid_224373] = b11_224384;\n        ((__global double *) mem_231298)[gtid_224372 * t_n_m_203740 +\n                                         gtid_224373] = c11_224385;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_224367\n}\n__kernel void mainzisegmap_224619(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572, int64_t q_t_203576,\n                                  int64_t jump_t_203582,\n                                  int64_t partition_sizze_203667,\n                                  int64_t t_n_m_203740, int64_t i_203760,\n                                  int64_t num_groups_224614,\n                                  int64_t num_threads_232315, __global\n                                  unsigned char *mem_229269, __global\n                                  unsigned char *ext_mem_229304, __global\n                                  unsigned char *mem_231324, __global\n                                  unsigned char *mem_231327, __global\n         ",
                   "                         unsigned char *mem_231330, __global\n                                  unsigned char *mem_231333, __global\n                                  unsigned char *mem_231336, __global\n                                  unsigned char *mem_231415, __global\n                                  unsigned char *mem_231418, __global\n                                  unsigned char *color_232160, __global\n                                  unsigned char *color_232161, __global\n                                  unsigned char *color_232162, __global\n                                  unsigned char *color_232163)\n{\n    #define segmap_group_sizze_224613 (mainzisegmap_group_sizze_224460)\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_235968;\n    int32_t local_tid_235969;\n    int64_t group_sizze_235972;\n    int32_t wave_sizze_235971;\n    int32_t group_tid_235970;\n    \n    global_tid_235968 = get_global_id(0);\n    local_tid_235969 = get_local_id(0);\n    group_sizze_235972 = get_local_size(0);\n    wave_sizze_235971 = LOCKSTEP_WIDTH;\n    group_tid_235970 = get_group_id(0);\n    \n    int32_t phys_tid_224619 = global_tid_235968;\n    int32_t phys_group_id_235973;\n    \n    phys_group_id_235973 = get_group_id(0);\n    for (int32_t i_235974 = 0; i_235974 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667,\n                                          segmap_group_sizze_224613)) -\n                   phys_group_id_235973, sext_i64_i32(num_groups_224614));\n         i_235974++) {\n        int32_t virt_group_id_235975 = phys_group_id_235973 + i_235974 *\n                sext_i64_i32(num_groups_224614);\n        int64_t global_tid_235976 = sext_i32_i64(virt_group_id_2359",
                   "75) *\n                segmap_group_sizze_224613 + sext_i32_i64(local_tid_235969);\n        int64_t slice_235977 = partition_sizze_203667;\n        int64_t gtid_224618 = global_tid_235976;\n        int64_t remnant_235978 = global_tid_235976 - gtid_224618;\n        \n        if (slt64(gtid_224618, partition_sizze_203667)) {\n            int64_t x_224624;\n            \n            x_224624 = ((__global int64_t *) ext_mem_229304)[gtid_224618];\n            for (int64_t i_229130 = 0; i_229130 < n_203572; i_229130++) {\n                double x_224628;\n                \n                x_224628 = ((__global double *) mem_229269)[gtid_224618 *\n                                                            n_203572 +\n                                                            i_229130];\n                \n                double x_224629;\n                \n                x_224629 = ((__global double *) mem_231324)[i_229130 *\n                                                            partition_sizze_203667 +\n                                                            gtid_224618];\n                \n                double defunc_1_f_res_224630 = x_224628 - x_224629;\n                \n                ((__global double *) color_232160)[phys_tid_224619 + i_229130 *\n                                                   num_threads_232315] =\n                    defunc_1_f_res_224630;\n            }\n            for (int64_t i_229136 = 0; i_229136 < n_203572; i_229136++) {\n                int64_t x_224633;\n                \n                x_224633 = ((__global int64_t *) mem_231327)[i_229136 *\n                                                             partition_sizze_203667 +\n                                                             gtid_224618];\n                \n                bool cond_224634 = sle64((int64_t) 0, x_224633);\n                double defunc_0_f_res_224635;\n                \n                if (cond_224634) {\n                    bool y_224636 = slt64(x_224633, n_203572);\n             ",
                   "       bool bounds_check_224637 = cond_224634 && y_224636;\n                    bool index_certs_224638;\n                    \n                    if (!bounds_check_224637) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          60) == -1) {\n                                global_failure_args[0] = (int64_t) x_224633;\n                                global_failure_args[1] = (int64_t) n_203572;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double defunc_0_f_res_t_res_224639;\n                    \n                    defunc_0_f_res_t_res_224639 = ((__global\n                                                    double *) color_232160)[phys_tid_224619 +\n                                                                            x_224633 *\n                                                                            num_threads_232315];\n                    defunc_0_f_res_224635 = defunc_0_f_res_t_res_224639;\n                } else {\n                    defunc_0_f_res_224635 = 0.0;\n                }\n                \n                double defunc_0_f_res_224640;\n                \n                if (cond_224634) {\n                    bool y_224641 = slt64(x_224633, n_203572);\n                    bool bounds_check_224642 = cond_224634 && y_224641;\n                    bool index_certs_224643;\n                    \n                    if (!bounds_check_224642) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          61) == -1) {\n                                global_failure_args[0] = (int64_t) x_224633;\n                                global_failure_args[1] = (int64_t) n_203572;",
                   "\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double defunc_0_f_res_t_res_224644;\n                    \n                    defunc_0_f_res_t_res_224644 = ((__global\n                                                    double *) mem_231336)[x_224633 *\n                                                                          partition_sizze_203667 +\n                                                                          gtid_224618];\n                    defunc_0_f_res_224640 = defunc_0_f_res_t_res_224644;\n                } else {\n                    defunc_0_f_res_224640 = 0.0;\n                }\n                ((__global double *) color_232163)[phys_tid_224619 + i_229136 *\n                                                   num_threads_232315] =\n                    defunc_0_f_res_224640;\n                ((__global double *) color_232162)[phys_tid_224619 + i_229136 *\n                                                   num_threads_232315] =\n                    defunc_0_f_res_224635;\n            }\n            for (int64_t i_229143 = 0; i_229143 < t_n_m_203740; i_229143++) {\n                int64_t x_224648;\n                \n                x_224648 = ((__global int64_t *) mem_231330)[i_229143 *\n                                                             partition_sizze_203667 +\n                                                             gtid_224618];\n                \n                double x_224649;\n                \n                x_224649 = ((__global double *) mem_231333)[i_229143 *\n                                                            partition_sizze_203667 +\n                                                            gtid_224618];\n                \n                int64_t min_arg_224650 = mul64(jump_t_203582, i_229143);\n                int64_t min_res_224651 = smi",
                   "n64(i_203760, min_arg_224650);\n                int64_t defunc_0_g_res_224652 = add64((int64_t) 1,\n                                                      min_res_224651);\n                double defunc_2_reduce_res_224653;\n                double defunc_2_reduce_res_224654;\n                double defunc_2_reduce_res_224655;\n                double defunc_2_reduce_res_224656;\n                double defunc_2_reduce_res_224657;\n                double redout_228366;\n                double redout_228367;\n                double redout_228368;\n                double redout_228369;\n                double redout_228370;\n                \n                redout_228366 = 0.0;\n                redout_228367 = 0.0;\n                redout_228368 = 0.0;\n                redout_228369 = 0.0;\n                redout_228370 = 0.0;\n                for (int64_t i_228371 = 0; i_228371 < q_t_203576; i_228371++) {\n                    bool cond_224674 = sle64(x_224624, i_228371);\n                    int64_t defunc_0_f_res_224675;\n                    \n                    if (cond_224674) {\n                        defunc_0_f_res_224675 = (int64_t) 0;\n                    } else {\n                        int64_t i_224676 = add64(x_224648, i_228371);\n                        int64_t defunc_0_add_arg_224677;\n                        \n                        defunc_0_add_arg_224677 = ((__global\n                                                    int64_t *) mem_231327)[i_224676 *\n                                                                           partition_sizze_203667 +\n                                                                           gtid_224618];\n                        \n                        int64_t defunc_1_add_res_224678 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_224677);\n                        \n                        defunc_0_f_res_224675 = defunc_1_add_res_224678;\n                    }\n                    \n                ",
                   "    double defunc_0_f_res_224679;\n                    \n                    if (cond_224674) {\n                        defunc_0_f_res_224679 = 0.0;\n                    } else {\n                        int64_t i_224680 = add64(x_224648, i_228371);\n                        double defunc_0_add_arg_224681;\n                        \n                        defunc_0_add_arg_224681 = ((__global\n                                                    double *) color_232163)[phys_tid_224619 +\n                                                                            i_224680 *\n                                                                            num_threads_232315];\n                        defunc_0_f_res_224679 = defunc_0_add_arg_224681;\n                    }\n                    \n                    int64_t binop_p_224682 = sub64(defunc_0_f_res_224675,\n                                                   defunc_0_g_res_224652);\n                    double defunc_0_f_res_224683 =\n                           sitofp_i64_f64(binop_p_224682);\n                    double abs_res_224684 = fabs(defunc_0_f_res_224683);\n                    double tmp1_224685 = abs_res_224684 / x_224649;\n                    double x_224686 = tmp1_224685 * tmp1_224685;\n                    double y_224687 = tmp1_224685 * x_224686;\n                    double tmp2_224688 = 1.0 - y_224687;\n                    double x_224689 = tmp2_224688 * tmp2_224688;\n                    double tmp3_224690 = tmp2_224688 * x_224689;\n                    double w_j_224691 = defunc_0_f_res_224679 * tmp3_224690;\n                    double xw_j_224692 = defunc_0_f_res_224683 * w_j_224691;\n                    double x2w_j_224693 = defunc_0_f_res_224683 * xw_j_224692;\n                    double x3w_j_224694 = defunc_0_f_res_224683 * x2w_j_224693;\n                    double x4w_j_224695 = defunc_0_f_res_224683 * x3w_j_224694;\n                    double defunc_1_op_res_224660 = w_j_224691 + redout_228366;\n                    double defu",
                   "nc_1_op_res_224663 = xw_j_224692 + redout_228367;\n                    double defunc_1_op_res_224666 = x2w_j_224693 +\n                           redout_228368;\n                    double defunc_1_op_res_224669 = x3w_j_224694 +\n                           redout_228369;\n                    double defunc_1_op_res_224672 = x4w_j_224695 +\n                           redout_228370;\n                    double redout_tmp_235984 = defunc_1_op_res_224660;\n                    double redout_tmp_235985 = defunc_1_op_res_224663;\n                    double redout_tmp_235986 = defunc_1_op_res_224666;\n                    double redout_tmp_235987 = defunc_1_op_res_224669;\n                    double redout_tmp_235988 = defunc_1_op_res_224672;\n                    \n                    redout_228366 = redout_tmp_235984;\n                    redout_228367 = redout_tmp_235985;\n                    redout_228368 = redout_tmp_235986;\n                    redout_228369 = redout_tmp_235987;\n                    redout_228370 = redout_tmp_235988;\n                }\n                defunc_2_reduce_res_224653 = redout_228366;\n                defunc_2_reduce_res_224654 = redout_228367;\n                defunc_2_reduce_res_224655 = redout_228368;\n                defunc_2_reduce_res_224656 = redout_228369;\n                defunc_2_reduce_res_224657 = redout_228370;\n                \n                double x_224696 = defunc_2_reduce_res_224655 *\n                       defunc_2_reduce_res_224657;\n                double y_224697 = defunc_2_reduce_res_224656 *\n                       defunc_2_reduce_res_224656;\n                double a12_224698 = x_224696 - y_224697;\n                double x_224699 = defunc_2_reduce_res_224655 *\n                       defunc_2_reduce_res_224656;\n                double y_224700 = defunc_2_reduce_res_224654 *\n                       defunc_2_reduce_res_224657;\n                double b12_224701 = x_224699 - y_224700;\n                double x_224702 = defunc_2_reduce_res_224654 *\n    ",
                   "                   defunc_2_reduce_res_224656;\n                double y_224703 = defunc_2_reduce_res_224655 *\n                       defunc_2_reduce_res_224655;\n                double c12_224704 = x_224702 - y_224703;\n                double x_224705 = defunc_2_reduce_res_224653 *\n                       defunc_2_reduce_res_224657;\n                double b2_224706 = x_224705 - y_224703;\n                double x_224707 = defunc_2_reduce_res_224654 *\n                       defunc_2_reduce_res_224655;\n                double y_224708 = defunc_2_reduce_res_224653 *\n                       defunc_2_reduce_res_224656;\n                double c2_224709 = x_224707 - y_224708;\n                double x_224710 = defunc_2_reduce_res_224653 * a12_224698;\n                double y_224711 = defunc_2_reduce_res_224654 * b12_224701;\n                double x_224712 = x_224710 + y_224711;\n                double y_224713 = defunc_2_reduce_res_224655 * c12_224704;\n                double y_224714 = x_224712 + y_224713;\n                double det_224715 = 1.0 / y_224714;\n                double a12_224716 = a12_224698 * det_224715;\n                double b12_224717 = b12_224701 * det_224715;\n                double c12_224718 = c12_224704 * det_224715;\n                double b2_224719 = b2_224706 * det_224715;\n                double c2_224720 = c2_224709 * det_224715;\n                double defunc_2_reduce_res_224721;\n                double defunc_2_reduce_res_224722;\n                double redout_228372;\n                double redout_228373;\n                \n                redout_228372 = 0.0;\n                redout_228373 = 0.0;\n                for (int64_t i_228374 = 0; i_228374 < q_t_203576; i_228374++) {\n                    bool cond_224730 = sle64(x_224624, i_228374);\n                    int64_t defunc_0_f_res_224731;\n                    \n                    if (cond_224730) {\n                        defunc_0_f_res_224731 = (int64_t) 0;\n                    } else {\n                        ",
                   "int64_t i_224732 = add64(x_224648, i_228374);\n                        int64_t defunc_0_add_arg_224733;\n                        \n                        defunc_0_add_arg_224733 = ((__global\n                                                    int64_t *) mem_231327)[i_224732 *\n                                                                           partition_sizze_203667 +\n                                                                           gtid_224618];\n                        \n                        int64_t defunc_1_add_res_224734 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_224733);\n                        \n                        defunc_0_f_res_224731 = defunc_1_add_res_224734;\n                    }\n                    \n                    double defunc_0_f_res_224735;\n                    \n                    if (cond_224730) {\n                        defunc_0_f_res_224735 = 0.0;\n                    } else {\n                        int64_t i_224736 = add64(x_224648, i_228374);\n                        double defunc_0_add_arg_224737;\n                        \n                        defunc_0_add_arg_224737 = ((__global\n                                                    double *) color_232163)[phys_tid_224619 +\n                                                                            i_224736 *\n                                                                            num_threads_232315];\n                        defunc_0_f_res_224735 = defunc_0_add_arg_224737;\n                    }\n                    \n                    int64_t binop_p_224738 = sub64(defunc_0_f_res_224731,\n                                                   defunc_0_g_res_224652);\n                    double defunc_0_f_res_224739 =\n                           sitofp_i64_f64(binop_p_224738);\n                    double abs_res_224740 = fabs(defunc_0_f_res_224739);\n                    double tmp1_224741 = abs_res_224740 / x_224649;\n     ",
                   "               double x_224742 = tmp1_224741 * tmp1_224741;\n                    double y_224743 = tmp1_224741 * x_224742;\n                    double tmp2_224744 = 1.0 - y_224743;\n                    double x_224745 = tmp2_224744 * tmp2_224744;\n                    double tmp3_224746 = tmp2_224744 * x_224745;\n                    double tmp4_224747 = defunc_0_f_res_224735 * tmp3_224746;\n                    double defunc_1_f_res_224748 = defunc_0_f_res_224739 *\n                           tmp4_224747;\n                    double defunc_1_f_res_224749 = defunc_0_f_res_224739 *\n                           defunc_1_f_res_224748;\n                    double defunc_0_f_res_224750;\n                    \n                    if (cond_224730) {\n                        defunc_0_f_res_224750 = 0.0;\n                    } else {\n                        int64_t i_224751 = add64(x_224648, i_228374);\n                        double defunc_0_add_arg_224752;\n                        \n                        defunc_0_add_arg_224752 = ((__global\n                                                    double *) color_232162)[phys_tid_224619 +\n                                                                            i_224751 *\n                                                                            num_threads_232315];\n                        defunc_0_f_res_224750 = defunc_0_add_arg_224752;\n                    }\n                    \n                    double x_224753 = a12_224716 * tmp4_224747;\n                    double y_224754 = b12_224717 * defunc_1_f_res_224748;\n                    double x_224755 = x_224753 + y_224754;\n                    double y_224756 = c12_224718 * defunc_1_f_res_224749;\n                    double x_224757 = x_224755 + y_224756;\n                    double defunc_9_fit_fun_res_224758 = defunc_0_f_res_224750 *\n                           x_224757;\n                    double x_224759 = b12_224717 * tmp4_224747;\n                    double y_224760 = b2_224719 * defunc_1_f_re",
                   "s_224748;\n                    double x_224761 = x_224759 + y_224760;\n                    double y_224762 = c2_224720 * defunc_1_f_res_224749;\n                    double x_224763 = x_224761 + y_224762;\n                    double defunc_9_slope_fun_res_224764 =\n                           defunc_0_f_res_224750 * x_224763;\n                    double defunc_1_op_res_224725 =\n                           defunc_9_fit_fun_res_224758 + redout_228372;\n                    double defunc_1_op_res_224728 =\n                           defunc_9_slope_fun_res_224764 + redout_228373;\n                    double redout_tmp_235989 = defunc_1_op_res_224725;\n                    double redout_tmp_235990 = defunc_1_op_res_224728;\n                    \n                    redout_228372 = redout_tmp_235989;\n                    redout_228373 = redout_tmp_235990;\n                }\n                defunc_2_reduce_res_224721 = redout_228372;\n                defunc_2_reduce_res_224722 = redout_228373;\n                ((__global double *) color_232161)[phys_tid_224619 + i_229143 *\n                                                   num_threads_232315] =\n                    defunc_2_reduce_res_224721;\n                ((__global double *) color_232160)[phys_tid_224619 + i_229143 *\n                                                   num_threads_232315] =\n                    defunc_2_reduce_res_224722;\n            }\n            for (int64_t i_235991 = 0; i_235991 < t_n_m_203740; i_235991++) {\n                double tmp_235992;\n                \n                tmp_235992 = ((__global\n                               double *) color_232161)[phys_tid_224619 +\n                                                       i_235991 *\n                                                       num_threads_232315];\n                ((__global double *) mem_231415)[gtid_224618 + i_235991 *\n                                                 partition_sizze_203667] =\n                    tmp_235992;\n            }\n            for (int64",
                   "_t i_235993 = 0; i_235993 < t_n_m_203740; i_235993++) {\n                double tmp_235994;\n                \n                tmp_235994 = ((__global\n                               double *) color_232160)[phys_tid_224619 +\n                                                       i_235993 *\n                                                       num_threads_232315];\n                ((__global double *) mem_231418)[gtid_224618 + i_235993 *\n                                                 partition_sizze_203667] =\n                    tmp_235994;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_224613\n}\n__kernel void mainzisegmap_225417(__global int *global_failure,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667, __global\n                                  unsigned char *mem_229269, __global\n                                  unsigned char *mem_231028, __global\n                                  unsigned char *mem_231423)\n{\n    #define segmap_group_sizze_225412 (mainzisegmap_group_sizze_225386)\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_235995;\n    int32_t local_tid_235996;\n    int64_t group_sizze_235999;\n    int32_t wave_sizze_235998;\n    int32_t group_tid_235997;\n    \n    global_tid_235995 = get_global_id(0);\n    local_tid_235996 = get_local_id(0);\n    group_sizze_235999 = get_local_size(0);\n    wave_sizze_235998 = LOCKSTEP_WIDTH;\n    group_tid_235997 = get_group_id(0);\n    \n    int32_t phys_tid_225417 = global_tid_235995;\n    int64_t global_tid_236000 = sext_i32_i64(group_tid_235997) *\n            segmap_group_sizze_225412 + sext_i32_i64(local_tid_235996);\n    int64_t slice_236001 = n_203572;\n    int64_t slice_236002 = partition_sizze_203667 * slice_236001;\n    int64_t gtid_22541",
                   "5 = squot64(global_tid_236000, slice_236001);\n    int64_t remnant_236003 = global_tid_236000 - gtid_225415 * slice_236001;\n    int64_t gtid_225416 = remnant_236003;\n    int64_t remnant_236004 = remnant_236003 - gtid_225416;\n    \n    if (slt64(gtid_225415, partition_sizze_203667) && slt64(gtid_225416,\n                                                            n_203572)) {\n        double x_225418;\n        \n        x_225418 = ((__global double *) mem_229269)[gtid_225415 * n_203572 +\n                                                    gtid_225416];\n        \n        double x_225419;\n        \n        x_225419 = ((__global double *) mem_231028)[gtid_225415 * n_203572 +\n                                                    gtid_225416];\n        \n        double defunc_1_f_res_225420 = x_225418 - x_225419;\n        \n        ((__global double *) mem_231423)[gtid_225415 * n_203572 + gtid_225416] =\n            defunc_1_f_res_225420;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_225412\n}\n__kernel void mainzisegmap_225434(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667,\n                                  int64_t ctx_param_ext_229596,\n                                  int64_t ctx_param_ext_229597,\n                                  int64_t ctx_param_ext_229599, __global\n                                  unsigned char *ext_mem_229305, __global\n                                  unsigned char *mem_param_229601, __global\n                                  unsigned char *mem_231423, __global\n                                  unsigned char *mem_231428, __global\n                                  unsigned char *mem_231432)\n{\n    #define segmap_group_sizze_225428 (mainzisegmap_group_sizze_225330)\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_236005;\n    int32_t local_tid_236006;\n    int64_t group_sizze_236009;\n    int32_t wave_sizze_236008;\n    int32_t group_tid_236007;\n    \n    global_tid_236005 = get_global_id(0);\n    local_tid_236006 = get_local_id(0);\n    group_sizze_236009 = get_local_size(0);\n    wave_sizze_236008 = LOCKSTEP_WIDTH;\n    group_tid_236007 = get_group_id(0);\n    \n    int32_t phys_tid_225434 = global_tid_236005;\n    int64_t global_tid_236010 = sext_i32_i64(group_tid_236007) *\n            segmap_group_sizze_225428 + sext_i32_i64(local_tid_236006);\n    int64_t slice_236011 = n_203572;\n    int64_t slice_236012 = partition_sizze_203667 * slice_236011;\n    int64_t gtid_225432 = squot64(global_tid_236010, slice_236011);\n    int64_t remnant_236013 = global_tid_236010 - gtid_225432 * slice_236011;\n    int64_t gtid_225433 = remnant_236013;\n    int64_t remnant_236014 = remnant_236013 - gtid_225433;\n    \n    if (slt64(gtid_225432, partition_sizze_203667) && slt64(gtid_225433,\n                                                            n_203572)) {\n        int64_t x_225437;\n        \n        x_225437 = ((__global int64_t *) ext_mem_229305)[gtid_225432 *\n                                                         n_203572 +\n                                                         gtid_225433];\n        \n        bool cond_225438 = sle64((int64_t) 0, x_225437);\n        double defunc_0_f_res_225439;\n        \n        if (cond_225438) {\n            bool y_225440 = slt64(x_225437, n_203572);\n            bool bounds_check_225441 = cond_225438 && y_225440;\n            bool index_certs_225442;\n            \n            if (!bounds_check_225441) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 62) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_225437;\n                        global_failure_args[1] = (int64_t) ",
                   "n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_225443;\n            \n            defunc_0_f_res_t_res_225443 = ((__global\n                                            double *) mem_231423)[gtid_225432 *\n                                                                  n_203572 +\n                                                                  x_225437];\n            defunc_0_f_res_225439 = defunc_0_f_res_t_res_225443;\n        } else {\n            defunc_0_f_res_225439 = 0.0;\n        }\n        \n        double defunc_0_f_res_225444;\n        \n        if (cond_225438) {\n            bool y_225445 = slt64(x_225437, n_203572);\n            bool bounds_check_225446 = cond_225438 && y_225445;\n            bool index_certs_225447;\n            \n            if (!bounds_check_225446) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 63) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_225437;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_225448;\n            \n            defunc_0_f_res_t_res_225448 = ((__global\n                                            double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                        (gtid_225432 *\n                                                                         ctx_param_ext_229597 +\n                                                                         x_225437 *\n                                                                         ctx_param_ext_229599)];\n            defunc_0_f_res_225444 = defunc_0_f_res_t_res_225448;\n        } else {\n            defunc_0_f_res_225444 = 0.0;\n        }\n      ",
                   "  ((__global double *) mem_231428)[gtid_225432 * n_203572 + gtid_225433] =\n            defunc_0_f_res_225444;\n        ((__global double *) mem_231432)[gtid_225432 * n_203572 + gtid_225433] =\n            defunc_0_f_res_225439;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_225428\n}\n__kernel void mainzisegmap_225464(__global int *global_failure,\n                                  int64_t n_203572, int64_t q_t_203576,\n                                  int64_t jump_t_203582,\n                                  int64_t partition_sizze_203667,\n                                  int64_t t_n_m_203740, int64_t i_203760,\n                                  __global unsigned char *ext_mem_229304,\n                                  __global unsigned char *ext_mem_229305,\n                                  __global unsigned char *ext_mem_229568,\n                                  __global unsigned char *ext_mem_229569,\n                                  __global unsigned char *mem_231428, __global\n                                  unsigned char *mem_231432, __global\n                                  unsigned char *mem_231437, __global\n                                  unsigned char *mem_231441)\n{\n    #define segmap_group_sizze_225453 (mainzisegmap_group_sizze_224772)\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_236015;\n    int32_t local_tid_236016;\n    int64_t group_sizze_236019;\n    int32_t wave_sizze_236018;\n    int32_t group_tid_236017;\n    \n    global_tid_236015 = get_global_id(0);\n    local_tid_236016 = get_local_id(0);\n    group_sizze_236019 = get_local_size(0);\n    wave_sizze_236018 = LOCKSTEP_WIDTH;\n    group_tid_236017 = get_group_id(0);\n    \n    int32_t phys_tid_225464 = global_tid_236015;\n    int64_t global_tid_236020 = sext_i32_i64(group_tid_236017) *\n            segmap_group_sizze_225453 + sext_i32_i64(local_tid_236016);\n    int64_t",
                   " slice_236021 = t_n_m_203740;\n    int64_t slice_236022 = partition_sizze_203667 * slice_236021;\n    int64_t gtid_225462 = squot64(global_tid_236020, slice_236021);\n    int64_t remnant_236023 = global_tid_236020 - gtid_225462 * slice_236021;\n    int64_t gtid_225463 = remnant_236023;\n    int64_t remnant_236024 = remnant_236023 - gtid_225463;\n    \n    if (slt64(gtid_225462, partition_sizze_203667) && slt64(gtid_225463,\n                                                            t_n_m_203740)) {\n        int64_t x_225466;\n        \n        x_225466 = ((__global int64_t *) ext_mem_229304)[gtid_225462];\n        \n        int64_t x_225470;\n        \n        x_225470 = ((__global int64_t *) ext_mem_229569)[gtid_225462 *\n                                                         t_n_m_203740 +\n                                                         gtid_225463];\n        \n        double x_225471;\n        \n        x_225471 = ((__global double *) ext_mem_229568)[gtid_225462 *\n                                                        t_n_m_203740 +\n                                                        gtid_225463];\n        \n        int64_t min_arg_225472 = mul64(jump_t_203582, gtid_225463);\n        int64_t min_res_225473 = smin64(i_203760, min_arg_225472);\n        int64_t defunc_0_g_res_225474 = add64((int64_t) 1, min_res_225473);\n        double defunc_2_reduce_res_225475;\n        double defunc_2_reduce_res_225476;\n        double defunc_2_reduce_res_225477;\n        double defunc_2_reduce_res_225478;\n        double defunc_2_reduce_res_225479;\n        double redout_228379;\n        double redout_228380;\n        double redout_228381;\n        double redout_228382;\n        double redout_228383;\n        \n        redout_228379 = 0.0;\n        redout_228380 = 0.0;\n        redout_228381 = 0.0;\n        redout_228382 = 0.0;\n        redout_228383 = 0.0;\n        for (int64_t i_228384 = 0; i_228384 < q_t_203576; i_228384++) {\n            bool cond_225496 = sle64(x_225466, i_228384);\n            int6",
                   "4_t defunc_0_f_res_225497;\n            \n            if (cond_225496) {\n                defunc_0_f_res_225497 = (int64_t) 0;\n            } else {\n                int64_t i_225498 = add64(x_225470, i_228384);\n                int64_t defunc_0_add_arg_225499;\n                \n                defunc_0_add_arg_225499 = ((__global\n                                            int64_t *) ext_mem_229305)[gtid_225462 *\n                                                                       n_203572 +\n                                                                       i_225498];\n                \n                int64_t defunc_1_add_res_225500 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_225499);\n                \n                defunc_0_f_res_225497 = defunc_1_add_res_225500;\n            }\n            \n            double defunc_0_f_res_225501;\n            \n            if (cond_225496) {\n                defunc_0_f_res_225501 = 0.0;\n            } else {\n                int64_t i_225502 = add64(x_225470, i_228384);\n                double defunc_0_add_arg_225503;\n                \n                defunc_0_add_arg_225503 = ((__global\n                                            double *) mem_231428)[gtid_225462 *\n                                                                  n_203572 +\n                                                                  i_225502];\n                defunc_0_f_res_225501 = defunc_0_add_arg_225503;\n            }\n            \n            int64_t binop_p_225504 = sub64(defunc_0_f_res_225497,\n                                           defunc_0_g_res_225474);\n            double defunc_0_f_res_225505 = sitofp_i64_f64(binop_p_225504);\n            double abs_res_225506 = fabs(defunc_0_f_res_225505);\n            double tmp1_225507 = abs_res_225506 / x_225471;\n            double x_225508 = tmp1_225507 * tmp1_225507;\n            double y_225509 = tmp1_225507 * x_225508;\n            double tmp2_225510 = 1.0 - y_22550",
                   "9;\n            double x_225511 = tmp2_225510 * tmp2_225510;\n            double tmp3_225512 = tmp2_225510 * x_225511;\n            double w_j_225513 = defunc_0_f_res_225501 * tmp3_225512;\n            double xw_j_225514 = defunc_0_f_res_225505 * w_j_225513;\n            double x2w_j_225515 = defunc_0_f_res_225505 * xw_j_225514;\n            double x3w_j_225516 = defunc_0_f_res_225505 * x2w_j_225515;\n            double x4w_j_225517 = defunc_0_f_res_225505 * x3w_j_225516;\n            double defunc_1_op_res_225482 = w_j_225513 + redout_228379;\n            double defunc_1_op_res_225485 = xw_j_225514 + redout_228380;\n            double defunc_1_op_res_225488 = x2w_j_225515 + redout_228381;\n            double defunc_1_op_res_225491 = x3w_j_225516 + redout_228382;\n            double defunc_1_op_res_225494 = x4w_j_225517 + redout_228383;\n            double redout_tmp_236025 = defunc_1_op_res_225482;\n            double redout_tmp_236026 = defunc_1_op_res_225485;\n            double redout_tmp_236027 = defunc_1_op_res_225488;\n            double redout_tmp_236028 = defunc_1_op_res_225491;\n            double redout_tmp_236029 = defunc_1_op_res_225494;\n            \n            redout_228379 = redout_tmp_236025;\n            redout_228380 = redout_tmp_236026;\n            redout_228381 = redout_tmp_236027;\n            redout_228382 = redout_tmp_236028;\n            redout_228383 = redout_tmp_236029;\n        }\n        defunc_2_reduce_res_225475 = redout_228379;\n        defunc_2_reduce_res_225476 = redout_228380;\n        defunc_2_reduce_res_225477 = redout_228381;\n        defunc_2_reduce_res_225478 = redout_228382;\n        defunc_2_reduce_res_225479 = redout_228383;\n        \n        double x_225518 = defunc_2_reduce_res_225477 *\n               defunc_2_reduce_res_225479;\n        double y_225519 = defunc_2_reduce_res_225478 *\n               defunc_2_reduce_res_225478;\n        double a12_225520 = x_225518 - y_225519;\n        double x_225521 = defunc_2_reduce_res_225477 *\n               defunc",
                   "_2_reduce_res_225478;\n        double y_225522 = defunc_2_reduce_res_225476 *\n               defunc_2_reduce_res_225479;\n        double b12_225523 = x_225521 - y_225522;\n        double x_225524 = defunc_2_reduce_res_225476 *\n               defunc_2_reduce_res_225478;\n        double y_225525 = defunc_2_reduce_res_225477 *\n               defunc_2_reduce_res_225477;\n        double c12_225526 = x_225524 - y_225525;\n        double x_225527 = defunc_2_reduce_res_225475 *\n               defunc_2_reduce_res_225479;\n        double b2_225528 = x_225527 - y_225525;\n        double x_225529 = defunc_2_reduce_res_225476 *\n               defunc_2_reduce_res_225477;\n        double y_225530 = defunc_2_reduce_res_225475 *\n               defunc_2_reduce_res_225478;\n        double c2_225531 = x_225529 - y_225530;\n        double x_225532 = defunc_2_reduce_res_225475 * a12_225520;\n        double y_225533 = defunc_2_reduce_res_225476 * b12_225523;\n        double x_225534 = x_225532 + y_225533;\n        double y_225535 = defunc_2_reduce_res_225477 * c12_225526;\n        double y_225536 = x_225534 + y_225535;\n        double det_225537 = 1.0 / y_225536;\n        double a12_225538 = a12_225520 * det_225537;\n        double b12_225539 = b12_225523 * det_225537;\n        double c12_225540 = c12_225526 * det_225537;\n        double b2_225541 = b2_225528 * det_225537;\n        double c2_225542 = c2_225531 * det_225537;\n        double defunc_2_reduce_res_225543;\n        double defunc_2_reduce_res_225544;\n        double redout_228385;\n        double redout_228386;\n        \n        redout_228385 = 0.0;\n        redout_228386 = 0.0;\n        for (int64_t i_228387 = 0; i_228387 < q_t_203576; i_228387++) {\n            bool cond_225552 = sle64(x_225466, i_228387);\n            int64_t defunc_0_f_res_225553;\n            \n            if (cond_225552) {\n                defunc_0_f_res_225553 = (int64_t) 0;\n            } else {\n                int64_t i_225554 = add64(x_225470, i_228387);\n                int64_t defunc",
                   "_0_add_arg_225555;\n                \n                defunc_0_add_arg_225555 = ((__global\n                                            int64_t *) ext_mem_229305)[gtid_225462 *\n                                                                       n_203572 +\n                                                                       i_225554];\n                \n                int64_t defunc_1_add_res_225556 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_225555);\n                \n                defunc_0_f_res_225553 = defunc_1_add_res_225556;\n            }\n            \n            double defunc_0_f_res_225557;\n            \n            if (cond_225552) {\n                defunc_0_f_res_225557 = 0.0;\n            } else {\n                int64_t i_225558 = add64(x_225470, i_228387);\n                double defunc_0_add_arg_225559;\n                \n                defunc_0_add_arg_225559 = ((__global\n                                            double *) mem_231428)[gtid_225462 *\n                                                                  n_203572 +\n                                                                  i_225558];\n                defunc_0_f_res_225557 = defunc_0_add_arg_225559;\n            }\n            \n            int64_t binop_p_225560 = sub64(defunc_0_f_res_225553,\n                                           defunc_0_g_res_225474);\n            double defunc_0_f_res_225561 = sitofp_i64_f64(binop_p_225560);\n            double abs_res_225562 = fabs(defunc_0_f_res_225561);\n            double tmp1_225563 = abs_res_225562 / x_225471;\n            double x_225564 = tmp1_225563 * tmp1_225563;\n            double y_225565 = tmp1_225563 * x_225564;\n            double tmp2_225566 = 1.0 - y_225565;\n            double x_225567 = tmp2_225566 * tmp2_225566;\n            double tmp3_225568 = tmp2_225566 * x_225567;\n            double tmp4_225569 = defunc_0_f_res_225557 * tmp3_225568;\n            double defunc_1_f_res_225570 = defunc_",
                   "0_f_res_225561 * tmp4_225569;\n            double defunc_1_f_res_225571 = defunc_0_f_res_225561 *\n                   defunc_1_f_res_225570;\n            double defunc_0_f_res_225572;\n            \n            if (cond_225552) {\n                defunc_0_f_res_225572 = 0.0;\n            } else {\n                int64_t i_225573 = add64(x_225470, i_228387);\n                double defunc_0_add_arg_225574;\n                \n                defunc_0_add_arg_225574 = ((__global\n                                            double *) mem_231432)[gtid_225462 *\n                                                                  n_203572 +\n                                                                  i_225573];\n                defunc_0_f_res_225572 = defunc_0_add_arg_225574;\n            }\n            \n            double x_225575 = a12_225538 * tmp4_225569;\n            double y_225576 = b12_225539 * defunc_1_f_res_225570;\n            double x_225577 = x_225575 + y_225576;\n            double y_225578 = c12_225540 * defunc_1_f_res_225571;\n            double x_225579 = x_225577 + y_225578;\n            double defunc_9_fit_fun_res_225580 = defunc_0_f_res_225572 *\n                   x_225579;\n            double x_225581 = b12_225539 * tmp4_225569;\n            double y_225582 = b2_225541 * defunc_1_f_res_225570;\n            double x_225583 = x_225581 + y_225582;\n            double y_225584 = c2_225542 * defunc_1_f_res_225571;\n            double x_225585 = x_225583 + y_225584;\n            double defunc_9_slope_fun_res_225586 = defunc_0_f_res_225572 *\n                   x_225585;\n            double defunc_1_op_res_225547 = defunc_9_fit_fun_res_225580 +\n                   redout_228385;\n            double defunc_1_op_res_225550 = defunc_9_slope_fun_res_225586 +\n                   redout_228386;\n            double redout_tmp_236030 = defunc_1_op_res_225547;\n            double redout_tmp_236031 = defunc_1_op_res_225550;\n            \n            redout_228385 = redout_tmp_236030;\n            red",
                   "out_228386 = redout_tmp_236031;\n        }\n        defunc_2_reduce_res_225543 = redout_228385;\n        defunc_2_reduce_res_225544 = redout_228386;\n        ((__global double *) mem_231437)[gtid_225462 * t_n_m_203740 +\n                                         gtid_225463] =\n            defunc_2_reduce_res_225543;\n        ((__global double *) mem_231441)[gtid_225462 * t_n_m_203740 +\n                                         gtid_225463] =\n            defunc_2_reduce_res_225544;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_225453\n}\n__kernel void mainzisegmap_225672(__global int *global_failure,\n                                  int64_t partition_sizze_203667,\n                                  int64_t t_n_m_203740, __global\n                                  unsigned char *mem_231446, __global\n                                  unsigned char *mem_231450, __global\n                                  unsigned char *mem_231454, __global\n                                  unsigned char *mem_231458, __global\n                                  unsigned char *mem_231462, __global\n                                  unsigned char *mem_231467, __global\n                                  unsigned char *mem_231471, __global\n                                  unsigned char *mem_231475, __global\n                                  unsigned char *mem_231479, __global\n                                  unsigned char *mem_231483)\n{\n    #define segmap_group_sizze_225663 (mainzisegmap_group_sizze_225010)\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_236160;\n    int32_t local_tid_236161;\n    int64_t group_sizze_236164;\n    int32_t wave_sizze_236163;\n    int32_t group_tid_236162;\n    \n    global_tid_236160 = get_global_id(0);\n    local_tid_236161 = get_local_id(0);\n    group_sizze_236164 = get_local_size(0);\n    wave_sizze_236163 = LOCKSTEP_WIDTH;\n    group_tid",
                   "_236162 = get_group_id(0);\n    \n    int32_t phys_tid_225672 = global_tid_236160;\n    int64_t global_tid_236165 = sext_i32_i64(group_tid_236162) *\n            segmap_group_sizze_225663 + sext_i32_i64(local_tid_236161);\n    int64_t slice_236166 = t_n_m_203740;\n    int64_t slice_236167 = partition_sizze_203667 * slice_236166;\n    int64_t gtid_225670 = squot64(global_tid_236165, slice_236166);\n    int64_t remnant_236168 = global_tid_236165 - gtid_225670 * slice_236166;\n    int64_t gtid_225671 = remnant_236168;\n    int64_t remnant_236169 = remnant_236168 - gtid_225671;\n    \n    if (slt64(gtid_225670, partition_sizze_203667) && slt64(gtid_225671,\n                                                            t_n_m_203740)) {\n        double defunc_2_reduce_res_225673;\n        \n        defunc_2_reduce_res_225673 = ((__global\n                                       double *) mem_231446)[gtid_225670 *\n                                                             t_n_m_203740 +\n                                                             gtid_225671];\n        \n        double defunc_2_reduce_res_225674;\n        \n        defunc_2_reduce_res_225674 = ((__global\n                                       double *) mem_231450)[gtid_225670 *\n                                                             t_n_m_203740 +\n                                                             gtid_225671];\n        \n        double defunc_2_reduce_res_225675;\n        \n        defunc_2_reduce_res_225675 = ((__global\n                                       double *) mem_231454)[gtid_225670 *\n                                                             t_n_m_203740 +\n                                                             gtid_225671];\n        \n        double defunc_2_reduce_res_225676;\n        \n        defunc_2_reduce_res_225676 = ((__global\n                                       double *) mem_231458)[gtid_225670 *\n                                                             t_n_m_203740 +\n                  ",
                   "                                           gtid_225671];\n        \n        double defunc_2_reduce_res_225677;\n        \n        defunc_2_reduce_res_225677 = ((__global\n                                       double *) mem_231462)[gtid_225670 *\n                                                             t_n_m_203740 +\n                                                             gtid_225671];\n        \n        double x_225678 = defunc_2_reduce_res_225675 *\n               defunc_2_reduce_res_225677;\n        double y_225679 = defunc_2_reduce_res_225676 *\n               defunc_2_reduce_res_225676;\n        double a12_225680 = x_225678 - y_225679;\n        double x_225681 = defunc_2_reduce_res_225675 *\n               defunc_2_reduce_res_225676;\n        double y_225682 = defunc_2_reduce_res_225674 *\n               defunc_2_reduce_res_225677;\n        double b12_225683 = x_225681 - y_225682;\n        double x_225684 = defunc_2_reduce_res_225674 *\n               defunc_2_reduce_res_225676;\n        double y_225685 = defunc_2_reduce_res_225675 *\n               defunc_2_reduce_res_225675;\n        double c12_225686 = x_225684 - y_225685;\n        double x_225687 = defunc_2_reduce_res_225673 *\n               defunc_2_reduce_res_225677;\n        double b2_225688 = x_225687 - y_225685;\n        double x_225689 = defunc_2_reduce_res_225674 *\n               defunc_2_reduce_res_225675;\n        double y_225690 = defunc_2_reduce_res_225673 *\n               defunc_2_reduce_res_225676;\n        double c2_225691 = x_225689 - y_225690;\n        double x_225692 = defunc_2_reduce_res_225673 * a12_225680;\n        double y_225693 = defunc_2_reduce_res_225674 * b12_225683;\n        double x_225694 = x_225692 + y_225693;\n        double y_225695 = defunc_2_reduce_res_225675 * c12_225686;\n        double y_225696 = x_225694 + y_225695;\n        double det_225697 = 1.0 / y_225696;\n        double a12_225698 = a12_225680 * det_225697;\n        double b12_225699 = b12_225683 * det_225697;\n        double c12_225700 = c",
                   "12_225686 * det_225697;\n        double b2_225701 = b2_225688 * det_225697;\n        double c2_225702 = c2_225691 * det_225697;\n        \n        ((__global double *) mem_231467)[gtid_225670 * t_n_m_203740 +\n                                         gtid_225671] = a12_225698;\n        ((__global double *) mem_231471)[gtid_225670 * t_n_m_203740 +\n                                         gtid_225671] = b12_225699;\n        ((__global double *) mem_231475)[gtid_225670 * t_n_m_203740 +\n                                         gtid_225671] = c12_225700;\n        ((__global double *) mem_231479)[gtid_225670 * t_n_m_203740 +\n                                         gtid_225671] = b2_225701;\n        ((__global double *) mem_231483)[gtid_225670 * t_n_m_203740 +\n                                         gtid_225671] = c2_225702;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_225663\n}\n__kernel void mainzisegmap_225963(__global int *global_failure,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667, __global\n                                  unsigned char *mem_229269, __global\n                                  unsigned char *mem_231028, __global\n                                  unsigned char *mem_231519)\n{\n    #define segmap_group_sizze_225958 (mainzisegmap_group_sizze_225932)\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_236258;\n    int32_t local_tid_236259;\n    int64_t group_sizze_236262;\n    int32_t wave_sizze_236261;\n    int32_t group_tid_236260;\n    \n    global_tid_236258 = get_global_id(0);\n    local_tid_236259 = get_local_id(0);\n    group_sizze_236262 = get_local_size(0);\n    wave_sizze_236261 = LOCKSTEP_WIDTH;\n    group_tid_236260 = get_group_id(0);\n    \n    int32_t phys_tid_225963 = global_tid_236258;\n    int64_t global_tid_236263 = sext_i32_i64(group_tid_236260) *\n   ",
                   "         segmap_group_sizze_225958 + sext_i32_i64(local_tid_236259);\n    int64_t slice_236264 = n_203572;\n    int64_t slice_236265 = partition_sizze_203667 * slice_236264;\n    int64_t gtid_225961 = squot64(global_tid_236263, slice_236264);\n    int64_t remnant_236266 = global_tid_236263 - gtid_225961 * slice_236264;\n    int64_t gtid_225962 = remnant_236266;\n    int64_t remnant_236267 = remnant_236266 - gtid_225962;\n    \n    if (slt64(gtid_225961, partition_sizze_203667) && slt64(gtid_225962,\n                                                            n_203572)) {\n        double x_225964;\n        \n        x_225964 = ((__global double *) mem_229269)[gtid_225961 * n_203572 +\n                                                    gtid_225962];\n        \n        double x_225965;\n        \n        x_225965 = ((__global double *) mem_231028)[gtid_225961 * n_203572 +\n                                                    gtid_225962];\n        \n        double defunc_1_f_res_225966 = x_225964 - x_225965;\n        \n        ((__global double *) mem_231519)[gtid_225961 * n_203572 + gtid_225962] =\n            defunc_1_f_res_225966;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_225958\n}\n__kernel void mainzisegmap_225980(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667,\n                                  int64_t ctx_param_ext_229596,\n                                  int64_t ctx_param_ext_229597,\n                                  int64_t ctx_param_ext_229599, __global\n                                  unsigned char *ext_mem_229305, __global\n                                  unsigned char *mem_param_229601, __global\n                                  unsigned char *mem_231519, __global\n                                  unsigned char *mem_231524, __gl",
                   "obal\n                                  unsigned char *mem_231528)\n{\n    #define segmap_group_sizze_225974 (mainzisegmap_group_sizze_225876)\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_236268;\n    int32_t local_tid_236269;\n    int64_t group_sizze_236272;\n    int32_t wave_sizze_236271;\n    int32_t group_tid_236270;\n    \n    global_tid_236268 = get_global_id(0);\n    local_tid_236269 = get_local_id(0);\n    group_sizze_236272 = get_local_size(0);\n    wave_sizze_236271 = LOCKSTEP_WIDTH;\n    group_tid_236270 = get_group_id(0);\n    \n    int32_t phys_tid_225980 = global_tid_236268;\n    int64_t global_tid_236273 = sext_i32_i64(group_tid_236270) *\n            segmap_group_sizze_225974 + sext_i32_i64(local_tid_236269);\n    int64_t slice_236274 = n_203572;\n    int64_t slice_236275 = partition_sizze_203667 * slice_236274;\n    int64_t gtid_225978 = squot64(global_tid_236273, slice_236274);\n    int64_t remnant_236276 = global_tid_236273 - gtid_225978 * slice_236274;\n    int64_t gtid_225979 = remnant_236276;\n    int64_t remnant_236277 = remnant_236276 - gtid_225979;\n    \n    if (slt64(gtid_225978, partition_sizze_203667) && slt64(gtid_225979,\n                                                            n_203572)) {\n        int64_t x_225983;\n        \n        x_225983 = ((__global int64_t *) ext_mem_229305)[gtid_225978 *\n                                                         n_203572 +\n                                                         gtid_225979];\n        \n        bool cond_225984 = sle64((int64_t) 0, x_225983);\n        double defunc_0_f_res_225985;\n        \n        if (cond_225984) {\n            bool y_225986 = slt64(x_225983, n_203572);\n            bool bounds_check_225987 = cond_225984 && y_225986;\n            bool index_certs_225988;\n            \n            if (!bounds_check_225987) {\n                {\n                    if (atomic_cmpxchg_i3",
                   "2_global(global_failure, -1, 64) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_225983;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_225989;\n            \n            defunc_0_f_res_t_res_225989 = ((__global\n                                            double *) mem_231519)[gtid_225978 *\n                                                                  n_203572 +\n                                                                  x_225983];\n            defunc_0_f_res_225985 = defunc_0_f_res_t_res_225989;\n        } else {\n            defunc_0_f_res_225985 = 0.0;\n        }\n        \n        double defunc_0_f_res_225990;\n        \n        if (cond_225984) {\n            bool y_225991 = slt64(x_225983, n_203572);\n            bool bounds_check_225992 = cond_225984 && y_225991;\n            bool index_certs_225993;\n            \n            if (!bounds_check_225992) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 65) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_225983;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_225994;\n            \n            defunc_0_f_res_t_res_225994 = ((__global\n                                            double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                        (gtid_225978 *\n                                                                         ctx_param_ext_229597 +\n                                                                         x_225983 *\n                                          ",
                   "                               ctx_param_ext_229599)];\n            defunc_0_f_res_225990 = defunc_0_f_res_t_res_225994;\n        } else {\n            defunc_0_f_res_225990 = 0.0;\n        }\n        ((__global double *) mem_231524)[gtid_225978 * n_203572 + gtid_225979] =\n            defunc_0_f_res_225990;\n        ((__global double *) mem_231528)[gtid_225978 * n_203572 + gtid_225979] =\n            defunc_0_f_res_225985;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_225974\n}\n__kernel void mainzisegmap_226275(__global int *global_failure,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667, __global\n                                  unsigned char *mem_229269, __global\n                                  unsigned char *mem_231028, __global\n                                  unsigned char *mem_231543)\n{\n    #define segmap_group_sizze_226270 (mainzisegmap_group_sizze_226244)\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_236298;\n    int32_t local_tid_236299;\n    int64_t group_sizze_236302;\n    int32_t wave_sizze_236301;\n    int32_t group_tid_236300;\n    \n    global_tid_236298 = get_global_id(0);\n    local_tid_236299 = get_local_id(0);\n    group_sizze_236302 = get_local_size(0);\n    wave_sizze_236301 = LOCKSTEP_WIDTH;\n    group_tid_236300 = get_group_id(0);\n    \n    int32_t phys_tid_226275 = global_tid_236298;\n    int64_t global_tid_236303 = sext_i32_i64(group_tid_236300) *\n            segmap_group_sizze_226270 + sext_i32_i64(local_tid_236299);\n    int64_t slice_236304 = n_203572;\n    int64_t slice_236305 = partition_sizze_203667 * slice_236304;\n    int64_t gtid_226273 = squot64(global_tid_236303, slice_236304);\n    int64_t remnant_236306 = global_tid_236303 - gtid_226273 * slice_236304;\n    int64_t gtid_226274 = remnant_236306;\n    int64_t remnant_236307 = remnant_236306 ",
                   "- gtid_226274;\n    \n    if (slt64(gtid_226273, partition_sizze_203667) && slt64(gtid_226274,\n                                                            n_203572)) {\n        double x_226276;\n        \n        x_226276 = ((__global double *) mem_229269)[gtid_226273 * n_203572 +\n                                                    gtid_226274];\n        \n        double x_226277;\n        \n        x_226277 = ((__global double *) mem_231028)[gtid_226273 * n_203572 +\n                                                    gtid_226274];\n        \n        double defunc_1_f_res_226278 = x_226276 - x_226277;\n        \n        ((__global double *) mem_231543)[gtid_226273 * n_203572 + gtid_226274] =\n            defunc_1_f_res_226278;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_226270\n}\n__kernel void mainzisegmap_226292(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667,\n                                  int64_t ctx_param_ext_229596,\n                                  int64_t ctx_param_ext_229597,\n                                  int64_t ctx_param_ext_229599, __global\n                                  unsigned char *ext_mem_229305, __global\n                                  unsigned char *mem_param_229601, __global\n                                  unsigned char *mem_231543, __global\n                                  unsigned char *mem_231548, __global\n                                  unsigned char *mem_231552)\n{\n    #define segmap_group_sizze_226286 (mainzisegmap_group_sizze_226188)\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_236308;\n    int32_t local_tid_236309;\n    int64_t group_sizze_236312;\n    int32_t wave_si",
                   "zze_236311;\n    int32_t group_tid_236310;\n    \n    global_tid_236308 = get_global_id(0);\n    local_tid_236309 = get_local_id(0);\n    group_sizze_236312 = get_local_size(0);\n    wave_sizze_236311 = LOCKSTEP_WIDTH;\n    group_tid_236310 = get_group_id(0);\n    \n    int32_t phys_tid_226292 = global_tid_236308;\n    int64_t global_tid_236313 = sext_i32_i64(group_tid_236310) *\n            segmap_group_sizze_226286 + sext_i32_i64(local_tid_236309);\n    int64_t slice_236314 = n_203572;\n    int64_t slice_236315 = partition_sizze_203667 * slice_236314;\n    int64_t gtid_226290 = squot64(global_tid_236313, slice_236314);\n    int64_t remnant_236316 = global_tid_236313 - gtid_226290 * slice_236314;\n    int64_t gtid_226291 = remnant_236316;\n    int64_t remnant_236317 = remnant_236316 - gtid_226291;\n    \n    if (slt64(gtid_226290, partition_sizze_203667) && slt64(gtid_226291,\n                                                            n_203572)) {\n        int64_t x_226295;\n        \n        x_226295 = ((__global int64_t *) ext_mem_229305)[gtid_226290 *\n                                                         n_203572 +\n                                                         gtid_226291];\n        \n        bool cond_226296 = sle64((int64_t) 0, x_226295);\n        double defunc_0_f_res_226297;\n        \n        if (cond_226296) {\n            bool y_226298 = slt64(x_226295, n_203572);\n            bool bounds_check_226299 = cond_226296 && y_226298;\n            bool index_certs_226300;\n            \n            if (!bounds_check_226299) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 66) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_226295;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_226301;\n            \n            defun",
                   "c_0_f_res_t_res_226301 = ((__global\n                                            double *) mem_231543)[gtid_226290 *\n                                                                  n_203572 +\n                                                                  x_226295];\n            defunc_0_f_res_226297 = defunc_0_f_res_t_res_226301;\n        } else {\n            defunc_0_f_res_226297 = 0.0;\n        }\n        \n        double defunc_0_f_res_226302;\n        \n        if (cond_226296) {\n            bool y_226303 = slt64(x_226295, n_203572);\n            bool bounds_check_226304 = cond_226296 && y_226303;\n            bool index_certs_226305;\n            \n            if (!bounds_check_226304) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 67) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_226295;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_226306;\n            \n            defunc_0_f_res_t_res_226306 = ((__global\n                                            double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                        (gtid_226290 *\n                                                                         ctx_param_ext_229597 +\n                                                                         x_226295 *\n                                                                         ctx_param_ext_229599)];\n            defunc_0_f_res_226302 = defunc_0_f_res_t_res_226306;\n        } else {\n            defunc_0_f_res_226302 = 0.0;\n        }\n        ((__global double *) mem_231548)[gtid_226290 * n_203572 + gtid_226291] =\n            defunc_0_f_res_226302;\n        ((__global double *) mem_231552)[gtid_226290 * n_203572 + gtid_226291] =\n            defunc",
                   "_0_f_res_226297;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_226286\n}\n__kernel void mainzisegmap_226679(__global int *global_failure,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667, __global\n                                  unsigned char *mem_229269, __global\n                                  unsigned char *mem_231028, __global\n                                  unsigned char *mem_231574)\n{\n    #define segmap_group_sizze_226674 (mainzisegmap_group_sizze_226648)\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_236344;\n    int32_t local_tid_236345;\n    int64_t group_sizze_236348;\n    int32_t wave_sizze_236347;\n    int32_t group_tid_236346;\n    \n    global_tid_236344 = get_global_id(0);\n    local_tid_236345 = get_local_id(0);\n    group_sizze_236348 = get_local_size(0);\n    wave_sizze_236347 = LOCKSTEP_WIDTH;\n    group_tid_236346 = get_group_id(0);\n    \n    int32_t phys_tid_226679 = global_tid_236344;\n    int64_t global_tid_236349 = sext_i32_i64(group_tid_236346) *\n            segmap_group_sizze_226674 + sext_i32_i64(local_tid_236345);\n    int64_t slice_236350 = n_203572;\n    int64_t slice_236351 = partition_sizze_203667 * slice_236350;\n    int64_t gtid_226677 = squot64(global_tid_236349, slice_236350);\n    int64_t remnant_236352 = global_tid_236349 - gtid_226677 * slice_236350;\n    int64_t gtid_226678 = remnant_236352;\n    int64_t remnant_236353 = remnant_236352 - gtid_226678;\n    \n    if (slt64(gtid_226677, partition_sizze_203667) && slt64(gtid_226678,\n                                                            n_203572)) {\n        double x_226680;\n        \n        x_226680 = ((__global double *) mem_229269)[gtid_226677 * n_203572 +\n                                                    gtid_226678];\n        \n        double x_226681;\n        \n        x_226681 ",
                   "= ((__global double *) mem_231028)[gtid_226677 * n_203572 +\n                                                    gtid_226678];\n        \n        double defunc_1_f_res_226682 = x_226680 - x_226681;\n        \n        ((__global double *) mem_231574)[gtid_226677 * n_203572 + gtid_226678] =\n            defunc_1_f_res_226682;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_226674\n}\n__kernel void mainzisegmap_226696(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667,\n                                  int64_t ctx_param_ext_229596,\n                                  int64_t ctx_param_ext_229597,\n                                  int64_t ctx_param_ext_229599, __global\n                                  unsigned char *ext_mem_229305, __global\n                                  unsigned char *mem_param_229601, __global\n                                  unsigned char *mem_231574, __global\n                                  unsigned char *mem_231579, __global\n                                  unsigned char *mem_231583)\n{\n    #define segmap_group_sizze_226690 (mainzisegmap_group_sizze_226592)\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_236354;\n    int32_t local_tid_236355;\n    int64_t group_sizze_236358;\n    int32_t wave_sizze_236357;\n    int32_t group_tid_236356;\n    \n    global_tid_236354 = get_global_id(0);\n    local_tid_236355 = get_local_id(0);\n    group_sizze_236358 = get_local_size(0);\n    wave_sizze_236357 = LOCKSTEP_WIDTH;\n    group_tid_236356 = get_group_id(0);\n    \n    int32_t phys_tid_226696 = global_tid_236354;\n    int64_t global_tid_236359 = sext_i32_i64(group_tid_236356) *\n            segmap_group_sizze_",
                   "226690 + sext_i32_i64(local_tid_236355);\n    int64_t slice_236360 = n_203572;\n    int64_t slice_236361 = partition_sizze_203667 * slice_236360;\n    int64_t gtid_226694 = squot64(global_tid_236359, slice_236360);\n    int64_t remnant_236362 = global_tid_236359 - gtid_226694 * slice_236360;\n    int64_t gtid_226695 = remnant_236362;\n    int64_t remnant_236363 = remnant_236362 - gtid_226695;\n    \n    if (slt64(gtid_226694, partition_sizze_203667) && slt64(gtid_226695,\n                                                            n_203572)) {\n        int64_t x_226699;\n        \n        x_226699 = ((__global int64_t *) ext_mem_229305)[gtid_226694 *\n                                                         n_203572 +\n                                                         gtid_226695];\n        \n        bool cond_226700 = sle64((int64_t) 0, x_226699);\n        double defunc_0_f_res_226701;\n        \n        if (cond_226700) {\n            bool y_226702 = slt64(x_226699, n_203572);\n            bool bounds_check_226703 = cond_226700 && y_226702;\n            bool index_certs_226704;\n            \n            if (!bounds_check_226703) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 68) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_226699;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_226705;\n            \n            defunc_0_f_res_t_res_226705 = ((__global\n                                            double *) mem_231574)[gtid_226694 *\n                                                                  n_203572 +\n                                                                  x_226699];\n            defunc_0_f_res_226701 = defunc_0_f_res_t_res_226705;\n        } else {\n            defunc_0_f_res_226701 = 0.0;\n        }\n",
                   "        \n        double defunc_0_f_res_226706;\n        \n        if (cond_226700) {\n            bool y_226707 = slt64(x_226699, n_203572);\n            bool bounds_check_226708 = cond_226700 && y_226707;\n            bool index_certs_226709;\n            \n            if (!bounds_check_226708) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 69) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_226699;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_226710;\n            \n            defunc_0_f_res_t_res_226710 = ((__global\n                                            double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                        (gtid_226694 *\n                                                                         ctx_param_ext_229597 +\n                                                                         x_226699 *\n                                                                         ctx_param_ext_229599)];\n            defunc_0_f_res_226706 = defunc_0_f_res_t_res_226710;\n        } else {\n            defunc_0_f_res_226706 = 0.0;\n        }\n        ((__global double *) mem_231579)[gtid_226694 * n_203572 + gtid_226695] =\n            defunc_0_f_res_226706;\n        ((__global double *) mem_231583)[gtid_226694 * n_203572 + gtid_226695] =\n            defunc_0_f_res_226701;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_226690\n}\n__kernel void mainzisegmap_226984(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572, int64_t jump_t_203582,\n                                  int64_t",
                   " partition_sizze_203667,\n                                  int64_t t_n_m_203740, int64_t i_203760,\n                                  int64_t y_206673, __global\n                                  unsigned char *ext_mem_231612, __global\n                                  unsigned char *ext_mem_231613, __global\n                                  unsigned char *mem_231618)\n{\n    #define segmap_group_sizze_226979 (mainzisegmap_group_sizze_226861)\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_236394;\n    int32_t local_tid_236395;\n    int64_t group_sizze_236398;\n    int32_t wave_sizze_236397;\n    int32_t group_tid_236396;\n    \n    global_tid_236394 = get_global_id(0);\n    local_tid_236395 = get_local_id(0);\n    group_sizze_236398 = get_local_size(0);\n    wave_sizze_236397 = LOCKSTEP_WIDTH;\n    group_tid_236396 = get_group_id(0);\n    \n    int32_t phys_tid_226984 = global_tid_236394;\n    int64_t global_tid_236399 = sext_i32_i64(group_tid_236396) *\n            segmap_group_sizze_226979 + sext_i32_i64(local_tid_236395);\n    int64_t slice_236400 = n_203572;\n    int64_t slice_236401 = partition_sizze_203667 * slice_236400;\n    int64_t gtid_226982 = squot64(global_tid_236399, slice_236400);\n    int64_t remnant_236402 = global_tid_236399 - gtid_226982 * slice_236400;\n    int64_t gtid_226983 = remnant_236402;\n    int64_t remnant_236403 = remnant_236402 - gtid_226983;\n    \n    if (slt64(gtid_226982, partition_sizze_203667) && slt64(gtid_226983,\n                                                            n_203572)) {\n        int64_t m_v_226988 = sdiv64(gtid_226983, jump_t_203582);\n        bool cond_226989 = m_v_226988 == y_206673;\n        int64_t j_226990;\n        \n        if (cond_226989) {\n            int64_t j_t_res_226991 = sub64(m_v_226988, (int64_t) 1);\n            \n            j_226990 = j_t_res_226991;\n        } else {\n            j_226990 = m_v_226988;",
                   "\n        }\n        \n        int64_t min_arg_226992 = mul64(jump_t_203582, j_226990);\n        int64_t min_res_226993 = smin64(i_203760, min_arg_226992);\n        int64_t defunc_0_m_fun_arg_226994 = add64((int64_t) 1, j_226990);\n        int64_t min_arg_226995 = mul64(jump_t_203582,\n                                       defunc_0_m_fun_arg_226994);\n        int64_t min_res_226996 = smin64(i_203760, min_arg_226995);\n        int64_t i64_arg_226997 = sub64(min_res_226996, min_res_226993);\n        double i64_res_226998 = sitofp_i64_f64(i64_arg_226997);\n        int64_t i64_arg_226999 = sub64(gtid_226983, min_res_226993);\n        double i64_res_227000 = sitofp_i64_f64(i64_arg_226999);\n        double u_227001 = i64_res_227000 / i64_res_226998;\n        double u2_227002 = u_227001 * u_227001;\n        double u3_227003 = u_227001 * u2_227002;\n        double x_227004 = 2.0 * u3_227003;\n        double y_227005 = 3.0 * u2_227002;\n        double x_227006 = x_227004 - y_227005;\n        double x_227007 = 1.0 + x_227006;\n        bool x_227008 = sle64((int64_t) 0, j_226990);\n        bool y_227009 = slt64(j_226990, t_n_m_203740);\n        bool bounds_check_227010 = x_227008 && y_227009;\n        bool index_certs_227011;\n        \n        if (!bounds_check_227010) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 70) == -1) {\n                    global_failure_args[0] = (int64_t) j_226990;\n                    global_failure_args[1] = (int64_t) t_n_m_203740;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        double y_227012;\n        \n        y_227012 = ((__global double *) ext_mem_231613)[gtid_226982 *\n                                                        t_n_m_203740 +\n                                                        j_226990];\n        \n        double x_227013 = x_227007 * y_227012;\n        double x_227014 = y_227005 - x_227004;\n        bool x_227015 = sle64((int64_t) 0, defunc_0_m_fun_arg_226994);\n  ",
                   "      bool y_227016 = slt64(defunc_0_m_fun_arg_226994, t_n_m_203740);\n        bool bounds_check_227017 = x_227015 && y_227016;\n        bool index_certs_227018;\n        \n        if (!bounds_check_227017) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 71) == -1) {\n                    global_failure_args[0] =\n                        (int64_t) defunc_0_m_fun_arg_226994;\n                    global_failure_args[1] = (int64_t) t_n_m_203740;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        double y_227019;\n        \n        y_227019 = ((__global double *) ext_mem_231613)[gtid_226982 *\n                                                        t_n_m_203740 +\n                                                        defunc_0_m_fun_arg_226994];\n        \n        double y_227020 = x_227014 * y_227019;\n        double x_227021 = x_227013 + y_227020;\n        double y_227022 = 2.0 * u2_227002;\n        double x_227023 = u3_227003 - y_227022;\n        double x_227024 = u_227001 + x_227023;\n        double y_227025;\n        \n        y_227025 = ((__global double *) ext_mem_231612)[gtid_226982 *\n                                                        t_n_m_203740 +\n                                                        j_226990];\n        \n        double x_227026 = x_227024 * y_227025;\n        double y_227027 = i64_res_226998 * x_227026;\n        double x_227028 = x_227021 + y_227027;\n        double x_227029 = u3_227003 - u2_227002;\n        double y_227030;\n        \n        y_227030 = ((__global double *) ext_mem_231612)[gtid_226982 *\n                                                        t_n_m_203740 +\n                                                        defunc_0_m_fun_arg_226994];\n        \n        double x_227031 = x_227029 * y_227030;\n        double y_227032 = i64_res_226998 * x_227031;\n        double defunc_4_interpolate_proc_res_227033 = x_227028 + y_227032;\n        \n        ((__global double *) me",
                   "m_231618)[gtid_226982 * n_203572 + gtid_226983] =\n            defunc_4_interpolate_proc_res_227033;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_226979\n}\n__kernel void mainzisegmap_227201(__global int *global_failure,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667,\n                                  int64_t ext_231630, __global\n                                  unsigned char *mem_229269, __global\n                                  unsigned char *ext_mem_231625, __global\n                                  unsigned char *ext_mem_231626, __global\n                                  unsigned char *mem_231662)\n{\n    #define segmap_group_sizze_227196 (mainzisegmap_group_sizze_227160)\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_236416;\n    int32_t local_tid_236417;\n    int64_t group_sizze_236420;\n    int32_t wave_sizze_236419;\n    int32_t group_tid_236418;\n    \n    global_tid_236416 = get_global_id(0);\n    local_tid_236417 = get_local_id(0);\n    group_sizze_236420 = get_local_size(0);\n    wave_sizze_236419 = LOCKSTEP_WIDTH;\n    group_tid_236418 = get_group_id(0);\n    \n    int32_t phys_tid_227201 = global_tid_236416;\n    int64_t global_tid_236421 = sext_i32_i64(group_tid_236418) *\n            segmap_group_sizze_227196 + sext_i32_i64(local_tid_236417);\n    int64_t slice_236422 = n_203572;\n    int64_t slice_236423 = partition_sizze_203667 * slice_236422;\n    int64_t gtid_227199 = squot64(global_tid_236421, slice_236422);\n    int64_t remnant_236424 = global_tid_236421 - gtid_227199 * slice_236422;\n    int64_t gtid_227200 = remnant_236424;\n    int64_t remnant_236425 = remnant_236424 - gtid_227200;\n    \n    if (slt64(gtid_227199, partition_sizze_203667) && slt64(gtid_227200,\n                                                            n_203572)) {\n        double x_22720",
                   "2;\n        \n        x_227202 = ((__global double *) mem_229269)[gtid_227199 * n_203572 +\n                                                    gtid_227200];\n        \n        double x_227203;\n        \n        x_227203 = ((__global double *) ext_mem_231626)[gtid_227199 * n_203572 +\n                                                        gtid_227200];\n        \n        double x_227204;\n        \n        x_227204 = ((__global double *) ext_mem_231625)[gtid_227199 *\n                                                        ext_231630 +\n                                                        gtid_227200];\n        \n        double x_227205 = x_227202 - x_227203;\n        double defunc_2_f_res_227206 = x_227205 - x_227204;\n        bool isnan_res_227207;\n        \n        isnan_res_227207 = futrts_isnan64(defunc_2_f_res_227206);\n        \n        double defunc_0_f_res_227208;\n        \n        if (isnan_res_227207) {\n            defunc_0_f_res_227208 = defunc_2_f_res_227206;\n        } else {\n            double abs_res_227209 = fabs(defunc_2_f_res_227206);\n            \n            defunc_0_f_res_227208 = abs_res_227209;\n        }\n        ((__global double *) mem_231662)[gtid_227199 * n_203572 + gtid_227200] =\n            defunc_0_f_res_227208;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_227196\n}\n__kernel void mainzisegmap_227222(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667, __global\n                                  unsigned char *ext_mem_229305, __global\n                                  unsigned char *mem_231662, __global\n                                  unsigned char *mem_231667)\n{\n    #define segmap_group_sizze_227217 (mainzisegmap_group_sizze_227117)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int bl",
                   "ock_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236426;\n    int32_t local_tid_236427;\n    int64_t group_sizze_236430;\n    int32_t wave_sizze_236429;\n    int32_t group_tid_236428;\n    \n    global_tid_236426 = get_global_id(0);\n    local_tid_236427 = get_local_id(0);\n    group_sizze_236430 = get_local_size(0);\n    wave_sizze_236429 = LOCKSTEP_WIDTH;\n    group_tid_236428 = get_group_id(0);\n    \n    int32_t phys_tid_227222 = global_tid_236426;\n    int64_t global_tid_236431 = sext_i32_i64(group_tid_236428) *\n            segmap_group_sizze_227217 + sext_i32_i64(local_tid_236427);\n    int64_t slice_236432 = n_203572;\n    int64_t slice_236433 = partition_sizze_203667 * slice_236432;\n    int64_t gtid_227220 = squot64(global_tid_236431, slice_236432);\n    int64_t remnant_236434 = global_tid_236431 - gtid_227220 * slice_236432;\n    int64_t gtid_227221 = remnant_236434;\n    int64_t remnant_236435 = remnant_236434 - gtid_227221;\n    \n    if (slt64(gtid_227220, partition_sizze_203667) && slt64(gtid_227221,\n                                                            n_203572)) {\n        int64_t x_227224;\n        \n        x_227224 = ((__global int64_t *) ext_mem_229305)[gtid_227220 *\n                                                         n_203572 +\n                                                         gtid_227221];\n        \n        bool cond_227225 = sle64((int64_t) 0, x_227224);\n        double defunc_0_f_res_227226;\n        \n        if (cond_227225) {\n            bool y_227227 = slt64(x_227224, n_203572);\n            bool bounds_check_227228 = cond_227225 && y_227227;\n            bool index_certs_227229;\n            \n            if (!bounds_check_227228) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 73) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_227224;\n                        global_failure_args[1] = (int64_t) n_203572;\n                 ",
                   "       ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_227230;\n            \n            defunc_0_f_res_t_res_227230 = ((__global\n                                            double *) mem_231662)[gtid_227220 *\n                                                                  n_203572 +\n                                                                  x_227224];\n            defunc_0_f_res_227226 = defunc_0_f_res_t_res_227230;\n        } else {\n            defunc_0_f_res_227226 = INFINITY;\n        }\n        ((__global double *) mem_231667)[gtid_227220 * n_203572 + gtid_227221] =\n            defunc_0_f_res_227226;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_227217\n}\n__kernel void mainzisegmap_227351(__global int *global_failure,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667,\n                                  int64_t i_203760, int32_t iters_206755,\n                                  int64_t num_groups_227347,\n                                  int64_t num_threads_232339, __global\n                                  unsigned char *mem_231672, __global\n                                  unsigned char *mem_231782, __global\n                                  unsigned char *color_232173, __global\n                                  unsigned char *color_232174, __global\n                                  unsigned char *color_232175, __global\n                                  unsigned char *color_232176, __global\n                                  unsigned char *color_232177, __global\n                                  unsigned char *color_232178, __global\n                                  unsigned char *color_232179)\n{\n    #define segmap_group_sizze_227346 (mainzisegmap_group_sizze_227248)\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_236439;\n    int32_t local_tid_236440;\n    int64_t group_sizze_236443;\n    int32_t wave_sizze_236442;\n    int32_t group_tid_236441;\n    \n    global_tid_236439 = get_global_id(0);\n    local_tid_236440 = get_local_id(0);\n    group_sizze_236443 = get_local_size(0);\n    wave_sizze_236442 = LOCKSTEP_WIDTH;\n    group_tid_236441 = get_group_id(0);\n    \n    int32_t phys_tid_227351 = global_tid_236439;\n    int32_t phys_group_id_236444;\n    \n    phys_group_id_236444 = get_group_id(0);\n    for (int32_t i_236445 = 0; i_236445 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667,\n                                          segmap_group_sizze_227346)) -\n                   phys_group_id_236444, sext_i64_i32(num_groups_227347));\n         i_236445++) {\n        int32_t virt_group_id_236446 = phys_group_id_236444 + i_236445 *\n                sext_i64_i32(num_groups_227347);\n        int64_t global_tid_236447 = sext_i32_i64(virt_group_id_236446) *\n                segmap_group_sizze_227346 + sext_i32_i64(local_tid_236440);\n        int64_t slice_236448 = partition_sizze_203667;\n        int64_t gtid_227350 = global_tid_236447;\n        int64_t remnant_236449 = global_tid_236447 - gtid_227350;\n        \n        if (slt64(gtid_227350, partition_sizze_203667)) {\n            for (int64_t i_236450 = 0; i_236450 < n_203572; i_236450++) {\n                double tmp_236451;\n                \n                tmp_236451 = ((__global double *) mem_231672)[gtid_227350 +\n                                                              i_236450 *\n                                                              partition_sizze_203667];\n                ((__global double *) color_232173)[phys_tid_227351 + i_236450 *\n                                                   num_threads_232339] =\n                    tmp_236451;\n            }\n            \n            __global unsigned char *ext_mem_231775;\n            __global unsigned char *ext_mem_unused_232066;\n",
                   "            __global unsigned char *mem_param_231682;\n            __global unsigned char *mem_param_out_232067;\n            \n            mem_param_231682 = color_232173;\n            mem_param_out_232067 = color_232174;\n            for (int32_t i_227354 = 0; i_227354 < iters_206755; i_227354++) {\n                int32_t defunc_2_radix_sort_step_arg_227356 = mul32(2,\n                                                                    i_227354);\n                int32_t defunc_0_get_bit_arg_227357 = add32(1,\n                                                            defunc_2_radix_sort_step_arg_227356);\n                bool cond_f_res_227358 = defunc_0_get_bit_arg_227357 == 63;\n                bool cond_f_res_227359 = defunc_2_radix_sort_step_arg_227356 ==\n                     63;\n                int64_t unsign_arg_227360 =\n                        zext_i32_i64(defunc_0_get_bit_arg_227357);\n                int64_t unsign_arg_227361 =\n                        zext_i32_i64(defunc_2_radix_sort_step_arg_227356);\n                int64_t discard_229166;\n                int64_t discard_229167;\n                int64_t discard_229168;\n                int64_t discard_229169;\n                int64_t scanacc_229151;\n                int64_t scanacc_229152;\n                int64_t scanacc_229153;\n                int64_t scanacc_229154;\n                \n                scanacc_229151 = (int64_t) 0;\n                scanacc_229152 = (int64_t) 0;\n                scanacc_229153 = (int64_t) 0;\n                scanacc_229154 = (int64_t) 0;\n                for (int64_t i_229160 = 0; i_229160 < n_203572; i_229160++) {\n                    double x_227379;\n                    \n                    x_227379 = ((__global\n                                 double *) mem_param_231682)[phys_tid_227351 +\n                                                             i_229160 *\n                                                             num_threads_232339];\n                    \n                    int64_t ",
                   "i64_arg_227380;\n                    \n                    i64_arg_227380 = futrts_to_bits64(x_227379);\n                    \n                    int64_t unsign_arg_227381 = ashr64(i64_arg_227380,\n                                                       unsign_arg_227360);\n                    int64_t unsign_arg_227382 = (int64_t) 1 & unsign_arg_227381;\n                    int32_t to_i32_res_227383 = zext_i64_i32(unsign_arg_227382);\n                    int64_t unsign_arg_227384 = ashr64(i64_arg_227380,\n                                                       (int64_t) 63);\n                    int64_t unsign_arg_227385 = (int64_t) 1 & unsign_arg_227384;\n                    int32_t to_i32_res_227386 = zext_i64_i32(unsign_arg_227385);\n                    bool cond_227387 = to_i32_res_227386 == 1;\n                    bool x_227388 = !cond_227387;\n                    bool y_227389 = cond_f_res_227358 && x_227388;\n                    bool cond_227390 = cond_227387 || y_227389;\n                    int32_t defunc_1_get_bit_res_227391;\n                    \n                    if (cond_227390) {\n                        int32_t defunc_1_get_bit_res_t_res_227392 = 1 ^\n                                to_i32_res_227383;\n                        \n                        defunc_1_get_bit_res_227391 =\n                            defunc_1_get_bit_res_t_res_227392;\n                    } else {\n                        defunc_1_get_bit_res_227391 = to_i32_res_227383;\n                    }\n                    \n                    int32_t x_227393 = mul32(2, defunc_1_get_bit_res_227391);\n                    int64_t unsign_arg_227394 = ashr64(i64_arg_227380,\n                                                       unsign_arg_227361);\n                    int64_t unsign_arg_227395 = (int64_t) 1 & unsign_arg_227394;\n                    int32_t to_i32_res_227396 = zext_i64_i32(unsign_arg_227395);\n                    bool y_227397 = cond_f_res_227359 && x_227388;\n                    bool cond_227398 = con",
                   "d_227387 || y_227397;\n                    int32_t defunc_1_get_bit_res_227399;\n                    \n                    if (cond_227398) {\n                        int32_t defunc_1_get_bit_res_t_res_227400 = 1 ^\n                                to_i32_res_227396;\n                        \n                        defunc_1_get_bit_res_227399 =\n                            defunc_1_get_bit_res_t_res_227400;\n                    } else {\n                        defunc_1_get_bit_res_227399 = to_i32_res_227396;\n                    }\n                    \n                    int32_t defunc_0_f_res_227401 = add32(x_227393,\n                                                          defunc_1_get_bit_res_227399);\n                    bool cond_227402 = defunc_0_f_res_227401 == 0;\n                    int64_t defunc_0_f_res_227403 = btoi_bool_i64(cond_227402);\n                    int64_t defunc_0_f_res_227404;\n                    int64_t defunc_0_f_res_227405;\n                    int64_t defunc_0_f_res_227406;\n                    \n                    if (cond_227402) {\n                        defunc_0_f_res_227404 = (int64_t) 0;\n                        defunc_0_f_res_227405 = (int64_t) 0;\n                        defunc_0_f_res_227406 = (int64_t) 0;\n                    } else {\n                        bool cond_227407 = defunc_0_f_res_227401 == 1;\n                        int64_t defunc_0_f_res_f_res_227408 =\n                                btoi_bool_i64(cond_227407);\n                        int64_t defunc_0_f_res_f_res_227409;\n                        int64_t defunc_0_f_res_f_res_227410;\n                        \n                        if (cond_227407) {\n                            defunc_0_f_res_f_res_227409 = (int64_t) 0;\n                            defunc_0_f_res_f_res_227410 = (int64_t) 0;\n                        } else {\n                            bool cond_227411 = defunc_0_f_res_227401 == 2;\n                            int64_t defunc_0_f_res_f_res_f_res_227412 =\n                  ",
                   "                  btoi_bool_i64(cond_227411);\n                            bool cond_neg_227413 = !cond_227411;\n                            int64_t defunc_0_f_res_f_res_f_res_227414 =\n                                    btoi_bool_i64(cond_neg_227413);\n                            \n                            defunc_0_f_res_f_res_227409 =\n                                defunc_0_f_res_f_res_f_res_227412;\n                            defunc_0_f_res_f_res_227410 =\n                                defunc_0_f_res_f_res_f_res_227414;\n                        }\n                        defunc_0_f_res_227404 = defunc_0_f_res_f_res_227408;\n                        defunc_0_f_res_227405 = defunc_0_f_res_f_res_227409;\n                        defunc_0_f_res_227406 = defunc_0_f_res_f_res_227410;\n                    }\n                    \n                    int64_t defunc_1_op_res_227375 =\n                            add64(defunc_0_f_res_227403, scanacc_229151);\n                    int64_t defunc_1_op_res_227376 =\n                            add64(defunc_0_f_res_227404, scanacc_229152);\n                    int64_t defunc_1_op_res_227377 =\n                            add64(defunc_0_f_res_227405, scanacc_229153);\n                    int64_t defunc_1_op_res_227378 =\n                            add64(defunc_0_f_res_227406, scanacc_229154);\n                    \n                    ((__global int64_t *) color_232179)[phys_tid_227351 +\n                                                        i_229160 *\n                                                        num_threads_232339] =\n                        defunc_1_op_res_227375;\n                    ((__global int64_t *) color_232178)[phys_tid_227351 +\n                                                        i_229160 *\n                                                        num_threads_232339] =\n                        defunc_1_op_res_227376;\n                    ((__global int64_t *) color_232177)[phys_tid_227351 +\n                                 ",
                   "                       i_229160 *\n                                                        num_threads_232339] =\n                        defunc_1_op_res_227377;\n                    ((__global int64_t *) color_232176)[phys_tid_227351 +\n                                                        i_229160 *\n                                                        num_threads_232339] =\n                        defunc_1_op_res_227378;\n                    ((__global int32_t *) color_232175)[phys_tid_227351 +\n                                                        i_229160 *\n                                                        num_threads_232339] =\n                        defunc_0_f_res_227401;\n                    \n                    int64_t scanacc_tmp_236455 = defunc_1_op_res_227375;\n                    int64_t scanacc_tmp_236456 = defunc_1_op_res_227376;\n                    int64_t scanacc_tmp_236457 = defunc_1_op_res_227377;\n                    int64_t scanacc_tmp_236458 = defunc_1_op_res_227378;\n                    \n                    scanacc_229151 = scanacc_tmp_236455;\n                    scanacc_229152 = scanacc_tmp_236456;\n                    scanacc_229153 = scanacc_tmp_236457;\n                    scanacc_229154 = scanacc_tmp_236458;\n                }\n                discard_229166 = scanacc_229151;\n                discard_229167 = scanacc_229152;\n                discard_229168 = scanacc_229153;\n                discard_229169 = scanacc_229154;\n                \n                int64_t last_res_227415;\n                \n                last_res_227415 = ((__global\n                                    int64_t *) color_232179)[phys_tid_227351 +\n                                                             i_203760 *\n                                                             num_threads_232339];\n                \n                int64_t last_res_227416;\n                \n                last_res_227416 = ((__global\n                                    int64_t *) color_23217",
                   "8)[phys_tid_227351 +\n                                                             i_203760 *\n                                                             num_threads_232339];\n                \n                int64_t last_res_227417;\n                \n                last_res_227417 = ((__global\n                                    int64_t *) color_232177)[phys_tid_227351 +\n                                                             i_203760 *\n                                                             num_threads_232339];\n                for (int64_t i_236464 = 0; i_236464 < n_203572; i_236464++) {\n                    double tmp_236465;\n                    \n                    tmp_236465 = ((__global\n                                   double *) mem_param_231682)[phys_tid_227351 +\n                                                               i_236464 *\n                                                               num_threads_232339];\n                    ((__global double *) mem_param_out_232067)[phys_tid_227351 +\n                                                               i_236464 *\n                                                               num_threads_232339] =\n                        tmp_236465;\n                }\n                for (int64_t write_iter_229170 = 0; write_iter_229170 <\n                     n_203572; write_iter_229170++) {\n                    int32_t write_iv_229172;\n                    \n                    write_iv_229172 = ((__global\n                                        int32_t *) color_232175)[phys_tid_227351 +\n                                                                 write_iter_229170 *\n                                                                 num_threads_232339];\n                    \n                    bool match_lit_227426 = 0 == write_iv_229172;\n                    int64_t defunc_1_f_res_227427;\n                    \n                    if (match_lit_227426) {\n                        int64_t write_iv_229173;\n          ",
                   "              \n                        write_iv_229173 = ((__global\n                                            int64_t *) color_232179)[phys_tid_227351 +\n                                                                     write_iter_229170 *\n                                                                     num_threads_232339];\n                        \n                        int64_t case_res_227428 = sub64(write_iv_229173,\n                                                        (int64_t) 1);\n                        \n                        defunc_1_f_res_227427 = case_res_227428;\n                    } else {\n                        bool match_lit_227429 = 1 == write_iv_229172;\n                        int64_t x_227430;\n                        \n                        if (match_lit_227429) {\n                            int64_t write_iv_229174;\n                            \n                            write_iv_229174 = ((__global\n                                                int64_t *) color_232178)[phys_tid_227351 +\n                                                                         write_iter_229170 *\n                                                                         num_threads_232339];\n                            \n                            int64_t x_227431 = add64(last_res_227415,\n                                                     write_iv_229174);\n                            int64_t case_res_227432 = sub64(x_227431,\n                                                            (int64_t) 1);\n                            \n                            x_227430 = case_res_227432;\n                        } else {\n                            bool match_lit_227433 = 2 == write_iv_229172;\n                            int64_t x_227434;\n                            \n                            if (match_lit_227433) {\n                                int64_t write_iv_229175;\n                                \n                                write_iv_229175 = ((__",
                   "global\n                                                    int64_t *) color_232177)[phys_tid_227351 +\n                                                                             write_iter_229170 *\n                                                                             num_threads_232339];\n                                \n                                int64_t x_227435 = add64(last_res_227415,\n                                                         last_res_227416);\n                                int64_t x_227436 = add64(x_227435,\n                                                         write_iv_229175);\n                                int64_t case_res_227437 = sub64(x_227436,\n                                                                (int64_t) 1);\n                                \n                                x_227434 = case_res_227437;\n                            } else {\n                                int64_t write_iv_229176;\n                                \n                                write_iv_229176 = ((__global\n                                                    int64_t *) color_232176)[phys_tid_227351 +\n                                                                             write_iter_229170 *\n                                                                             num_threads_232339];\n                                \n                                int64_t x_227438 = add64(last_res_227415,\n                                                         last_res_227416);\n                                int64_t x_227439 = add64(last_res_227417,\n                                                         x_227438);\n                                int64_t x_227440 = add64(x_227439,\n                                                         write_iv_229176);\n                                int64_t defunc_1_f_res_res_227441 =\n                                        sub64(x_227440, (int64_t) 1);\n                                \n                   ",
                   "             x_227434 = defunc_1_f_res_res_227441;\n                            }\n                            x_227430 = x_227434;\n                        }\n                        defunc_1_f_res_227427 = x_227430;\n                    }\n                    if (sle64((int64_t) 0, defunc_1_f_res_227427) &&\n                        slt64(defunc_1_f_res_227427, n_203572)) {\n                        for (int64_t i_236467 = 0; i_236467 < (int64_t) 1;\n                             i_236467++) {\n                            double tmp_236468;\n                            \n                            tmp_236468 = ((__global\n                                           double *) mem_param_231682)[phys_tid_227351 +\n                                                                       num_threads_232339 *\n                                                                       write_iter_229170 +\n                                                                       i_236467 *\n                                                                       num_threads_232339];\n                            ((__global\n                              double *) mem_param_out_232067)[phys_tid_227351 +\n                                                              num_threads_232339 *\n                                                              defunc_1_f_res_227427 +\n                                                              i_236467 *\n                                                              num_threads_232339] =\n                                tmp_236468;\n                        }\n                    }\n                }\n                \n                __global unsigned char *mem_param_tmp_236452;\n                \n                mem_param_tmp_236452 = mem_param_out_232067;\n                \n                __global unsigned char *mem_param_out_tmp_236453;\n                \n                mem_param_out_tmp_236453 = mem_param_231682;\n                mem_param_231682 = mem_param_tmp_236452;\n       ",
                   "         mem_param_out_232067 = mem_param_out_tmp_236453;\n            }\n            ext_mem_231775 = mem_param_231682;\n            ext_mem_unused_232066 = mem_param_out_232067;\n            for (int64_t i_236469 = 0; i_236469 < n_203572; i_236469++) {\n                double tmp_236470;\n                \n                tmp_236470 = ((__global\n                               double *) ext_mem_231775)[phys_tid_227351 +\n                                                         i_236469 *\n                                                         num_threads_232339];\n                ((__global double *) mem_231782)[gtid_227350 + i_236469 *\n                                                 partition_sizze_203667] =\n                    tmp_236470;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_227346\n}\n__kernel void mainzisegmap_228076(__global int *global_failure,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667,\n                                  int64_t i_203760, __global\n                                  unsigned char *mem_param_231841, __global\n                                  unsigned char *mem_231847, __global\n                                  unsigned char *mem_231877, __global\n                                  unsigned char *mem_231881, __global\n                                  unsigned char *mem_231885, __global\n                                  unsigned char *mem_231889, __global\n                                  unsigned char *mem_231893)\n{\n    #define segmap_group_sizze_228071 (mainzisegmap_group_sizze_227667)\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_236668;\n    int32_t local_tid_236669;\n    int64_t group_sizze_236672;\n    int32_t wave_sizze_236671;\n    int32_t group_",
                   "tid_236670;\n    \n    global_tid_236668 = get_global_id(0);\n    local_tid_236669 = get_local_id(0);\n    group_sizze_236672 = get_local_size(0);\n    wave_sizze_236671 = LOCKSTEP_WIDTH;\n    group_tid_236670 = get_group_id(0);\n    \n    int32_t phys_tid_228076 = global_tid_236668;\n    int64_t global_tid_236673 = sext_i32_i64(group_tid_236670) *\n            segmap_group_sizze_228071 + sext_i32_i64(local_tid_236669);\n    int64_t slice_236674 = n_203572;\n    int64_t slice_236675 = partition_sizze_203667 * slice_236674;\n    int64_t gtid_228074 = squot64(global_tid_236673, slice_236674);\n    int64_t remnant_236676 = global_tid_236673 - gtid_228074 * slice_236674;\n    int64_t gtid_228075 = remnant_236676;\n    int64_t remnant_236677 = remnant_236676 - gtid_228075;\n    \n    if (slt64(gtid_228074, partition_sizze_203667) && slt64(gtid_228075,\n                                                            n_203572)) {\n        int32_t x_228080;\n        \n        x_228080 = ((__global int32_t *) mem_231893)[gtid_228074 * n_203572 +\n                                                     gtid_228075];\n        \n        double write_value_228085;\n        \n        write_value_228085 = ((__global\n                               double *) mem_param_231841)[gtid_228074 *\n                                                           n_203572 +\n                                                           gtid_228075];\n        \n        bool match_lit_228086 = 0 == x_228080;\n        int64_t defunc_1_f_res_228087;\n        \n        if (match_lit_228086) {\n            int64_t x_228081;\n            \n            x_228081 = ((__global int64_t *) mem_231877)[gtid_228074 *\n                                                         n_203572 +\n                                                         gtid_228075];\n            \n            int64_t case_res_228088 = sub64(x_228081, (int64_t) 1);\n            \n            defunc_1_f_res_228087 = case_res_228088;\n        } else {\n            int64_t last_res_228077;\n       ",
                   "     \n            last_res_228077 = ((__global int64_t *) mem_231877)[gtid_228074 *\n                                                                n_203572 +\n                                                                i_203760];\n            \n            bool match_lit_228089 = 1 == x_228080;\n            int64_t x_228090;\n            \n            if (match_lit_228089) {\n                int64_t x_228082;\n                \n                x_228082 = ((__global int64_t *) mem_231881)[gtid_228074 *\n                                                             n_203572 +\n                                                             gtid_228075];\n                \n                int64_t x_228091 = add64(last_res_228077, x_228082);\n                int64_t case_res_228092 = sub64(x_228091, (int64_t) 1);\n                \n                x_228090 = case_res_228092;\n            } else {\n                int64_t last_res_228078;\n                \n                last_res_228078 = ((__global\n                                    int64_t *) mem_231881)[gtid_228074 *\n                                                           n_203572 + i_203760];\n                \n                bool match_lit_228093 = 2 == x_228080;\n                int64_t x_228094;\n                \n                if (match_lit_228093) {\n                    int64_t x_228083;\n                    \n                    x_228083 = ((__global int64_t *) mem_231885)[gtid_228074 *\n                                                                 n_203572 +\n                                                                 gtid_228075];\n                    \n                    int64_t x_228095 = add64(last_res_228077, last_res_228078);\n                    int64_t x_228096 = add64(x_228083, x_228095);\n                    int64_t case_res_228097 = sub64(x_228096, (int64_t) 1);\n                    \n                    x_228094 = case_res_228097;\n                } else {\n                    int64_t last_res_228079;\n               ",
                   "     \n                    last_res_228079 = ((__global\n                                        int64_t *) mem_231885)[gtid_228074 *\n                                                               n_203572 +\n                                                               i_203760];\n                    \n                    int64_t x_228084;\n                    \n                    x_228084 = ((__global int64_t *) mem_231889)[gtid_228074 *\n                                                                 n_203572 +\n                                                                 gtid_228075];\n                    \n                    int64_t x_228098 = add64(last_res_228077, last_res_228078);\n                    int64_t x_228099 = add64(last_res_228079, x_228098);\n                    int64_t x_228100 = add64(x_228084, x_228099);\n                    int64_t defunc_1_f_res_res_228101 = sub64(x_228100,\n                                                              (int64_t) 1);\n                    \n                    x_228094 = defunc_1_f_res_res_228101;\n                }\n                x_228090 = x_228094;\n            }\n            defunc_1_f_res_228087 = x_228090;\n        }\n        if ((sle64((int64_t) 0, gtid_228074) && slt64(gtid_228074,\n                                                      partition_sizze_203667)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_228087) &&\n             slt64(defunc_1_f_res_228087, n_203572))) {\n            ((__global double *) mem_231847)[gtid_228074 * n_203572 +\n                                             defunc_1_f_res_228087] =\n                write_value_228085;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_228071\n}\n__kernel void mainzisegmap_228131(__global int *global_failure,\n                                  int64_t partition_sizze_203667,\n                                  int64_t stl_res_203754, int64_t j_m_i_204223,\n                                  __global unsigned char *mem_231927, __global\n   ",
                   "                               unsigned char *mem_231931, __global\n                                  unsigned char *mem_231934, __global\n                                  unsigned char *mem_231937)\n{\n    #define segmap_group_sizze_228125 (mainzisegmap_group_sizze_228110)\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_236682;\n    int32_t local_tid_236683;\n    int64_t group_sizze_236686;\n    int32_t wave_sizze_236685;\n    int32_t group_tid_236684;\n    \n    global_tid_236682 = get_global_id(0);\n    local_tid_236683 = get_local_id(0);\n    group_sizze_236686 = get_local_size(0);\n    wave_sizze_236685 = LOCKSTEP_WIDTH;\n    group_tid_236684 = get_group_id(0);\n    \n    int32_t phys_tid_228131 = global_tid_236682;\n    int64_t global_tid_236687 = sext_i32_i64(group_tid_236684) *\n            segmap_group_sizze_228125 + sext_i32_i64(local_tid_236683);\n    int64_t slice_236688 = partition_sizze_203667;\n    int64_t gtid_228130 = global_tid_236687;\n    int64_t remnant_236689 = global_tid_236687 - gtid_228130;\n    \n    if (slt64(gtid_228130, partition_sizze_203667)) {\n        double defunc_2_reduce_res_228133;\n        double redout_229179 = 0.0;\n        \n        for (int64_t i_229180 = 0; i_229180 < j_m_i_204223; i_229180++) {\n            int64_t slice_229185 = stl_res_203754 + i_229180;\n            double x_228137;\n            \n            x_228137 = ((__global double *) mem_231927)[slice_229185 *\n                                                        partition_sizze_203667 +\n                                                        gtid_228130];\n            \n            double defunc_1_op_res_228136 = x_228137 + redout_229179;\n            double redout_tmp_236690 = defunc_1_op_res_228136;\n            \n            redout_229179 = redout_tmp_236690;\n        }\n        defunc_2_reduce_res_228133 = redout_229179;\n        \n        double h_228138 = 3.0 * defunc_",
                   "2_reduce_res_228133;\n        double h9_228139 = 0.999 * h_228138;\n        double h1_228140 = 1.0e-3 * h_228138;\n        \n        ((__global double *) mem_231931)[gtid_228130] = h_228138;\n        ((__global double *) mem_231934)[gtid_228130] = h9_228139;\n        ((__global double *) mem_231937)[gtid_228130] = h1_228140;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_228125\n}\n__kernel void mainzisegmap_228193(__global int *global_failure,\n                                  int64_t partition_sizze_203667, __global\n                                  unsigned char *mem_231941, __global\n                                  unsigned char *mem_231945, __global\n                                  unsigned char *mem_231948, __global\n                                  unsigned char *mem_231951)\n{\n    #define segmap_group_sizze_228187 (mainzisegmap_group_sizze_228145)\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_236759;\n    int32_t local_tid_236760;\n    int64_t group_sizze_236763;\n    int32_t wave_sizze_236762;\n    int32_t group_tid_236761;\n    \n    global_tid_236759 = get_global_id(0);\n    local_tid_236760 = get_local_id(0);\n    group_sizze_236763 = get_local_size(0);\n    wave_sizze_236762 = LOCKSTEP_WIDTH;\n    group_tid_236761 = get_group_id(0);\n    \n    int32_t phys_tid_228193 = global_tid_236759;\n    int64_t global_tid_236764 = sext_i32_i64(group_tid_236761) *\n            segmap_group_sizze_228187 + sext_i32_i64(local_tid_236760);\n    int64_t slice_236765 = partition_sizze_203667;\n    int64_t gtid_228192 = global_tid_236764;\n    int64_t remnant_236766 = global_tid_236764 - gtid_228192;\n    \n    if (slt64(gtid_228192, partition_sizze_203667)) {\n        double defunc_2_reduce_res_228194;\n        \n        defunc_2_reduce_res_228194 = ((__global\n                                       double *) mem_231941)[gtid_228192];\n        \n        double",
                   " h_228195 = 3.0 * defunc_2_reduce_res_228194;\n        double h9_228196 = 0.999 * h_228195;\n        double h1_228197 = 1.0e-3 * h_228195;\n        \n        ((__global double *) mem_231945)[gtid_228192] = h_228195;\n        ((__global double *) mem_231948)[gtid_228192] = h9_228196;\n        ((__global double *) mem_231951)[gtid_228192] = h1_228197;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_228187\n}\n__kernel void mainzisegmap_228279(__global int *global_failure,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667, __global\n                                  unsigned char *ext_mem_231668, __global\n                                  unsigned char *ext_mem_231952, __global\n                                  unsigned char *ext_mem_231953, __global\n                                  unsigned char *ext_mem_231954, __global\n                                  unsigned char *mem_231959)\n{\n    #define segmap_group_sizze_228274 (mainzisegmap_group_sizze_228214)\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_236768;\n    int32_t local_tid_236769;\n    int64_t group_sizze_236772;\n    int32_t wave_sizze_236771;\n    int32_t group_tid_236770;\n    \n    global_tid_236768 = get_global_id(0);\n    local_tid_236769 = get_local_id(0);\n    group_sizze_236772 = get_local_size(0);\n    wave_sizze_236771 = LOCKSTEP_WIDTH;\n    group_tid_236770 = get_group_id(0);\n    \n    int32_t phys_tid_228279 = global_tid_236768;\n    int64_t global_tid_236773 = sext_i32_i64(group_tid_236770) *\n            segmap_group_sizze_228274 + sext_i32_i64(local_tid_236769);\n    int64_t slice_236774 = n_203572;\n    int64_t slice_236775 = partition_sizze_203667 * slice_236774;\n    int64_t gtid_228277 = squot64(global_tid_236773, slice_236774);\n    int64_t remnant_236776 = global_tid_236773 - gtid_228277 * slice_236774;\n    ",
                   "int64_t gtid_228278 = remnant_236776;\n    int64_t remnant_236777 = remnant_236776 - gtid_228278;\n    \n    if (slt64(gtid_228277, partition_sizze_203667) && slt64(gtid_228278,\n                                                            n_203572)) {\n        double x_228280;\n        \n        x_228280 = ((__global double *) ext_mem_231954)[gtid_228277];\n        \n        double x_228282;\n        \n        x_228282 = ((__global double *) ext_mem_231952)[gtid_228277];\n        \n        double x_228283;\n        \n        x_228283 = ((__global double *) ext_mem_231668)[gtid_228277 * n_203572 +\n                                                        gtid_228278];\n        \n        double x_228284 = x_228283 / x_228280;\n        double y_228285 = fpow64(x_228284, 2.0);\n        double x_228286 = 1.0 - y_228285;\n        double bicube_228287 = fpow64(x_228286, 2.0);\n        bool isnan_res_228288;\n        \n        isnan_res_228288 = futrts_isnan64(x_228283);\n        \n        bool cond_f_res_228289 = x_228283 <= x_228282;\n        bool x_228290 = !isnan_res_228288;\n        bool y_228291 = cond_f_res_228289 && x_228290;\n        bool cond_228292 = isnan_res_228288 || y_228291;\n        double defunc_0_f_res_228293;\n        \n        if (cond_228292) {\n            defunc_0_f_res_228293 = 1.0;\n        } else {\n            double x_228281;\n            \n            x_228281 = ((__global double *) ext_mem_231953)[gtid_228277];\n            \n            bool cond_228294 = x_228281 <= x_228283;\n            bool cond_f_res_228295 = x_228283 <= 1.0e-6;\n            bool x_228296 = !cond_228294;\n            bool y_228297 = cond_f_res_228295 && x_228296;\n            bool cond_228298 = cond_228294 || y_228297;\n            double defunc_0_f_res_f_res_228299;\n            \n            if (cond_228298) {\n                defunc_0_f_res_f_res_228299 = 1.0e-6;\n            } else {\n                defunc_0_f_res_f_res_228299 = bicube_228287;\n            }\n            defunc_0_f_res_228293 = defunc_0_f_res_f_res_2",
                   "28299;\n        }\n        ((__global double *) mem_231959)[gtid_228277 * n_203572 + gtid_228278] =\n            defunc_0_f_res_228293;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_228274\n}\n__kernel void mainzisegmap_228302(__global int *global_failure,\n                                  int64_t m_203571, int64_t n_203572,\n                                  int64_t partition_sizze_203667,\n                                  int64_t num_groups_228307,\n                                  int64_t num_threads_232357, __global\n                                  unsigned char *mem_229269, __global\n                                  unsigned char *mem_229272, __global\n                                  unsigned char *mem_231995, __global\n                                  unsigned char *mem_231999, __global\n                                  unsigned char *mem_232003, __global\n                                  unsigned char *mem_232006, __global\n                                  unsigned char *mem_232009, __global\n                                  unsigned char *color_232194)\n{\n    #define segmap_group_sizze_228305 (mainzisegmap_group_sizze_228304)\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_236779;\n    int32_t local_tid_236780;\n    int64_t group_sizze_236783;\n    int32_t wave_sizze_236782;\n    int32_t group_tid_236781;\n    \n    global_tid_236779 = get_global_id(0);\n    local_tid_236780 = get_local_id(0);\n    group_sizze_236783 = get_local_size(0);\n    wave_sizze_236782 = LOCKSTEP_WIDTH;\n    group_tid_236781 = get_group_id(0);\n    \n    int32_t phys_tid_228302 = global_tid_236779;\n    int32_t phys_group_id_236784;\n    \n    phys_group_id_236784 = get_group_id(0);\n    for (int32_t i_236785 = 0; i_236785 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667,\n                                          segmap_group_sizze_228305)) -\n  ",
                   "                 phys_group_id_236784, sext_i64_i32(num_groups_228307));\n         i_236785++) {\n        int32_t virt_group_id_236786 = phys_group_id_236784 + i_236785 *\n                sext_i64_i32(num_groups_228307);\n        int64_t global_tid_236787 = sext_i32_i64(virt_group_id_236786) *\n                segmap_group_sizze_228305 + sext_i32_i64(local_tid_236780);\n        int64_t slice_236788 = partition_sizze_203667;\n        int64_t write_i_228301 = global_tid_236787;\n        int64_t remnant_236789 = global_tid_236787 - write_i_228301;\n        \n        if (slt64(write_i_228301, partition_sizze_203667)) {\n            int64_t write_index_206943;\n            \n            write_index_206943 = ((__global\n                                   int64_t *) mem_229272)[write_i_228301];\n            for (int64_t i_229183 = 0; i_229183 < n_203572; i_229183++) {\n                double x_206945;\n                \n                x_206945 = ((__global double *) mem_229269)[write_i_228301 *\n                                                            n_203572 +\n                                                            i_229183];\n                \n                double x_206946;\n                \n                x_206946 = ((__global double *) mem_232006)[i_229183 *\n                                                            partition_sizze_203667 +\n                                                            write_i_228301];\n                \n                double x_206947;\n                \n                x_206947 = ((__global double *) mem_232009)[i_229183 *\n                                                            partition_sizze_203667 +\n                                                            write_i_228301];\n                \n                double x_206948 = x_206945 - x_206946;\n                double defunc_2_f_res_206949 = x_206948 - x_206947;\n                \n                ((__global double *) color_232194)[phys_tid_228302 + i_229183 *\n                                   ",
                   "                num_threads_232357] =\n                    defunc_2_f_res_206949;\n            }\n            if (sle64((int64_t) 0, write_index_206943) &&\n                slt64(write_index_206943, m_203571)) {\n                for (int64_t i_236791 = 0; i_236791 < n_203572; i_236791++) {\n                    double tmp_236792;\n                    \n                    tmp_236792 = ((__global\n                                   double *) color_232194)[phys_tid_228302 +\n                                                           i_236791 *\n                                                           num_threads_232357];\n                    ((__global double *) mem_232003)[write_index_206943 *\n                                                     n_203572 + i_236791] =\n                        tmp_236792;\n                }\n            }\n            if (sle64((int64_t) 0, write_index_206943) &&\n                slt64(write_index_206943, m_203571)) {\n                for (int64_t i_236793 = 0; i_236793 < n_203572; i_236793++) {\n                    double tmp_236794;\n                    \n                    tmp_236794 = ((__global\n                                   double *) mem_232009)[write_i_228301 +\n                                                         i_236793 *\n                                                         partition_sizze_203667];\n                    ((__global double *) mem_231999)[write_index_206943 *\n                                                     n_203572 + i_236793] =\n                        tmp_236794;\n                }\n            }\n            if (sle64((int64_t) 0, write_index_206943) &&\n                slt64(write_index_206943, m_203571)) {\n                for (int64_t i_236795 = 0; i_236795 < n_203572; i_236795++) {\n                    double tmp_236796;\n                    \n                    tmp_236796 = ((__global\n                                   double *) mem_232006)[write_i_228301 +\n                                                         i_",
                   "236795 *\n                                                         partition_sizze_203667];\n                    ((__global double *) mem_231995)[write_index_206943 *\n                                                     n_203572 + i_236795] =\n                        tmp_236796;\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_228305\n}\n__kernel void mainzisegmap_intragroup_206983(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *color_232076_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *color_232075_backing_aligned_1,\n                                             int64_t n_203572,\n                                             int64_t partition_sizze_203667,\n                                             int64_t i_203760, __global\n                                             unsigned char *mem_229269, __global\n                                             unsigned char *mem_229286, __global\n                                             unsigned char *mem_229289)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict color_232076_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_232076_backing_aligned_0;\n    __local volatile unsigned char *restrict color_232075_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232075_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232440;\n    int32_t local_tid_232441;\n    int64_t group_sizze_232444;\n    int32_t wave_sizze_232443;\n    int32_t group_tid_232442;\n    \n    glo",
                   "bal_tid_232440 = get_global_id(0);\n    local_tid_232441 = get_local_id(0);\n    group_sizze_232444 = get_local_size(0);\n    wave_sizze_232443 = LOCKSTEP_WIDTH;\n    group_tid_232442 = get_group_id(0);\n    \n    int32_t phys_tid_206983 = group_tid_232442;\n    int64_t slice_232446 = n_203572;\n    int64_t ltid_pre_232445 = sext_i32_i64(local_tid_232441);\n    int64_t remnant_232447 = sext_i32_i64(local_tid_232441) - ltid_pre_232445;\n    int64_t slice_232448 = partition_sizze_203667;\n    int64_t gtid_206982 = sext_i32_i64(group_tid_232442);\n    int64_t remnant_232449 = sext_i32_i64(group_tid_232442) - gtid_206982;\n    __local unsigned char *color_232075;\n    \n    color_232075 = (__local unsigned char *) color_232075_backing_0;\n    \n    __local unsigned char *color_232076;\n    \n    color_232076 = (__local unsigned char *) color_232076_backing_1;\n    \n    int64_t gtid_206987 = sext_i32_i64(sext_i64_i32(ltid_pre_232445));\n    int32_t phys_tid_206988 = local_tid_232441;\n    double x_206992;\n    \n    x_206992 = ((__global double *) mem_229269)[gtid_206982 * n_203572 +\n                                                gtid_206987];\n    \n    bool isnan_res_206993;\n    \n    isnan_res_206993 = futrts_isnan64(x_206992);\n    \n    bool defunc_0_p_res_206994 = !isnan_res_206993;\n    int64_t defunc_0_f_res_206995 = btoi_bool_i64(defunc_0_p_res_206994);\n    \n    ((__local int64_t *) color_232076)[gtid_206987] = defunc_0_f_res_206995;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_232450 = n_203572;\n    int64_t x_206989;\n    int64_t x_206990;\n    int64_t x_232452;\n    int64_t x_232453;\n    bool ltid_in_bounds_232455 = slt64(sext_i32_i64(local_tid_232441),\n                                       n_203572);\n    int32_t skip_threads_232456;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_232455) {\n            x_206990 = ((volatile __local\n                         int64_t *) color_232076)[sext_i32_i64(local_tid_232441)];\n            if ((local_tid_232441 - ",
                   "squot32(local_tid_232441, 32) * 32) == 0) {\n                x_206989 = x_206990;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_232456 = 1;\n        while (slt32(skip_threads_232456, 32)) {\n            bool thread_active_232457 = sle32(skip_threads_232456,\n                                              local_tid_232441 -\n                                              squot32(local_tid_232441, 32) *\n                                              32) && ltid_in_bounds_232455;\n            \n            if (thread_active_232457) {\n                // read operands\n                {\n                    x_206989 = ((volatile __local\n                                 int64_t *) color_232076)[sext_i32_i64(local_tid_232441) -\n                                                          sext_i32_i64(skip_threads_232456)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_232458 =\n                     slt64(srem64(sext_i32_i64(local_tid_232441), n_203572),\n                           sext_i32_i64(local_tid_232441) -\n                           sext_i32_i64(local_tid_232441 -\n                           skip_threads_232456));\n                \n                if (thread_active_232457 && inactive_232458) {\n                    x_206989 = x_206990;\n                }\n                if (thread_active_232457) {\n                    if (!inactive_232458) {\n                        int64_t defunc_1_op_res_206991 = add64(x_206989,\n                                                               x_206990);\n                        \n                        x_206989 = defunc_1_op_res_206991;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_232443, skip_threads_232456)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_232457) {\n                // write result\n                {\n                    ((volatile __",
                   "local\n                      int64_t *) color_232076)[sext_i32_i64(local_tid_232441)] =\n                        x_206989;\n                    x_206990 = x_206989;\n                }\n            }\n            if (sle32(wave_sizze_232443, skip_threads_232456)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_232456 *= 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_232441 - squot32(local_tid_232441, 32) * 32) == 31 &&\n            ltid_in_bounds_232455) {\n            ((volatile __local\n              int64_t *) color_232076)[sext_i32_i64(squot32(local_tid_232441,\n                                                            32))] = x_206989;\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_232459;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_232441, 32) == 0 && ltid_in_bounds_232455) {\n                x_232453 = ((volatile __local\n                             int64_t *) color_232076)[sext_i32_i64(local_tid_232441)];\n                if ((local_tid_232441 - squot32(local_tid_232441, 32) * 32) ==\n                    0) {\n                    x_232452 = x_232453;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_232459 = 1;\n            while (slt32(skip_threads_232459, 32)) {\n                bool thread_active_232460 = sle32(skip_threads_232459,\n                                                  local_tid_232441 -\n                                                  squot32(local_tid_232441,\n                                                          32) * 32) &&\n                     (squot32(local_tid_232441, 32) == 0 &&\n                      ltid_in_bounds_232455);\n                \n                if ",
                   "(thread_active_232460) {\n                    // read operands\n                    {\n                        x_232452 = ((volatile __local\n                                     int64_t *) color_232076)[sext_i32_i64(local_tid_232441) -\n                                                              sext_i32_i64(skip_threads_232459)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_232461 =\n                         slt64(srem64(sext_i32_i64(local_tid_232441 * 32 + 32 -\n                                      1), n_203572),\n                               sext_i32_i64(local_tid_232441 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_232441 -\n                                             skip_threads_232459) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_232460 && inactive_232461) {\n                        x_232452 = x_232453;\n                    }\n                    if (thread_active_232460) {\n                        if (!inactive_232461) {\n                            int64_t defunc_1_op_res_232454 = add64(x_232452,\n                                                                   x_232453);\n                            \n                            x_232452 = defunc_1_op_res_232454;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_232443, skip_threads_232459)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_232460) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) color_232076)[sext_i32_i64(local_tid_232441)] =\n                            x_232452;\n                        x_232453 = x_232452;\n                    }\n                }\n                if (sle32(wave_sizze_232443, skip_threads_232459)) {\n                   ",
                   " barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_232459 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_232462 = squot32(local_tid_232441, 32) == 0 ||\n         !ltid_in_bounds_232455;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_232462) {\n                x_206990 = x_206989;\n                x_206989 = ((__local\n                             int64_t *) color_232076)[sext_i32_i64(squot32(local_tid_232441,\n                                                                           32)) -\n                                                      (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_232463 = slt64(srem64(sext_i32_i64(local_tid_232441),\n                                                n_203572),\n                                         sext_i32_i64(local_tid_232441) -\n                                         sext_i32_i64(squot32(local_tid_232441,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_232462) {\n                if (inactive_232463) {\n                    x_206989 = x_206990;\n                }\n            }\n            if (!no_carry_in_232462) {\n                if (!inactive_232463) {\n                    int64_t defunc_1_op_res_206991 = add64(x_206989, x_206990);\n                    \n                    x_206989 = defunc_1_op_res_206991;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_232462) {\n                ((__local\n                  int64_t *) color_232076)[sext_i32_i64(local_tid_232441)] =\n                    x_206989;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_232441, 32) == 0 && ltid_in_bounds_232455) {\n          ",
                   "  ((__local int64_t *) color_232076)[sext_i32_i64(local_tid_232441)] =\n                x_206990;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t last_res_206996;\n    \n    last_res_206996 = ((__local int64_t *) color_232076)[i_203760];\n    ((__local int64_t *) color_232075)[sext_i32_i64(local_tid_232441)] =\n        (int64_t) -1;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t write_i_206999 = sext_i32_i64(sext_i64_i32(ltid_pre_232445));\n    int32_t phys_tid_207000 = local_tid_232441;\n    double x_207001;\n    \n    x_207001 = ((__global double *) mem_229269)[gtid_206982 * n_203572 +\n                                                write_i_206999];\n    \n    bool isnan_res_207004;\n    \n    isnan_res_207004 = futrts_isnan64(x_207001);\n    \n    bool defunc_0_p_res_207005 = !isnan_res_207004;\n    int64_t defunc_1_f_res_207006;\n    \n    if (defunc_0_p_res_207005) {\n        int64_t x_207002;\n        \n        x_207002 = ((__local int64_t *) color_232076)[write_i_206999];\n        \n        int64_t defunc_1_f_res_t_res_207007 = sub64(x_207002, (int64_t) 1);\n        \n        defunc_1_f_res_207006 = defunc_1_f_res_t_res_207007;\n    } else {\n        defunc_1_f_res_207006 = (int64_t) -1;\n    }\n    if (sle64((int64_t) 0, defunc_1_f_res_207006) &&\n        slt64(defunc_1_f_res_207006, n_203572)) {\n        ((__local int64_t *) color_232075)[defunc_1_f_res_207006] =\n            write_i_206999;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t tmp_232464;\n    \n    tmp_232464 = ((__local\n                   int64_t *) color_232075)[sext_i32_i64(local_tid_232441)];\n    ((__global int64_t *) mem_229286)[gtid_206982 * n_203572 +\n                                      sext_i32_i64(local_tid_232441)] =\n        tmp_232464;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_tid_232441 == 0) {\n        ((__global int64_t *) mem_229289)[gtid_206982] = last_res_206996;\n    }\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_207338(__global int *global_failure,\n",
                   "                                             __local volatile\n                                             int64_t *color_232078_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *color_232077_backing_aligned_1,\n                                             int64_t n_p_203574,\n                                             int64_t partition_sizze_203667,\n                                             int64_t defunc_0_f_res_203721,\n                                             int64_t i_203808,\n                                             int64_t computed_group_sizze_207277,\n                                             __global unsigned char *mem_229314,\n                                             __global unsigned char *mem_229330,\n                                             __global unsigned char *mem_229334)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict color_232078_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_232078_backing_aligned_0;\n    __local volatile unsigned char *restrict color_232077_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232077_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232575;\n    int32_t local_tid_232576;\n    int64_t group_sizze_232579;\n    int32_t wave_sizze_232578;\n    int32_t group_tid_232577;\n    \n    global_tid_232575 = get_global_id(0);\n    local_tid_232576 = get_local_id(0);\n    group_sizze_232579 = get_local_size(0);\n    wave_sizze_232578 = LOCKSTEP_WIDTH;\n    group_tid_232577 = get_group_id(0);\n    \n    int32_t phys_tid_207338 = group_tid_232577;\n    int64_t slice_232582 = defunc_0_f_res_203721;\n    int64_t slice_232583 = n_p_203574 * slice_232582;\n    int64_t ",
                   "ltid_pre_232580 = squot64(sext_i32_i64(local_tid_232576),\n                                      slice_232582);\n    int64_t remnant_232584 = sext_i32_i64(local_tid_232576) - ltid_pre_232580 *\n            slice_232582;\n    int64_t ltid_pre_232581 = remnant_232584;\n    int64_t remnant_232585 = remnant_232584 - ltid_pre_232581;\n    int64_t slice_232586 = partition_sizze_203667;\n    int64_t gtid_207337 = sext_i32_i64(group_tid_232577);\n    int64_t remnant_232587 = sext_i32_i64(group_tid_232577) - gtid_207337;\n    __local unsigned char *color_232077;\n    \n    color_232077 = (__local unsigned char *) color_232077_backing_0;\n    \n    __local unsigned char *color_232078;\n    \n    color_232078 = (__local unsigned char *) color_232078_backing_1;\n    \n    int64_t gtid_207342 = sext_i32_i64(sext_i64_i32(ltid_pre_232580));\n    int64_t gtid_207343 = sext_i32_i64(sext_i64_i32(ltid_pre_232581));\n    int32_t phys_tid_207344 = local_tid_232576;\n    \n    if (slt64(gtid_207342, n_p_203574) && slt64(gtid_207343,\n                                                defunc_0_f_res_203721)) {\n        double x_207349;\n        \n        x_207349 = ((__global double *) mem_229314)[gtid_207337 *\n                                                    (defunc_0_f_res_203721 *\n                                                     n_p_203574) + gtid_207342 *\n                                                    defunc_0_f_res_203721 +\n                                                    gtid_207343];\n        \n        bool isnan_res_207350;\n        \n        isnan_res_207350 = futrts_isnan64(x_207349);\n        \n        bool defunc_0_p_res_207351 = !isnan_res_207350;\n        int64_t defunc_0_f_res_207352 = btoi_bool_i64(defunc_0_p_res_207351);\n        \n        ((__local int64_t *) color_232078)[gtid_207342 * defunc_0_f_res_203721 +\n                                           gtid_207343] = defunc_0_f_res_207352;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_232588 = n_p_203574 * defunc_0_f_res_",
                   "203721;\n    int64_t x_207345;\n    int64_t x_207346;\n    int64_t x_232590;\n    int64_t x_232591;\n    bool ltid_in_bounds_232593 = slt64(sext_i32_i64(local_tid_232576),\n                                       n_p_203574 * defunc_0_f_res_203721);\n    int32_t skip_threads_232594;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_232593) {\n            x_207346 = ((volatile __local\n                         int64_t *) color_232078)[sext_i32_i64(local_tid_232576)];\n            if ((local_tid_232576 - squot32(local_tid_232576, 32) * 32) == 0) {\n                x_207345 = x_207346;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_232594 = 1;\n        while (slt32(skip_threads_232594, 32)) {\n            bool thread_active_232595 = sle32(skip_threads_232594,\n                                              local_tid_232576 -\n                                              squot32(local_tid_232576, 32) *\n                                              32) && ltid_in_bounds_232593;\n            \n            if (thread_active_232595) {\n                // read operands\n                {\n                    x_207345 = ((volatile __local\n                                 int64_t *) color_232078)[sext_i32_i64(local_tid_232576) -\n                                                          sext_i32_i64(skip_threads_232594)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_232596 =\n                     slt64(srem64(sext_i32_i64(local_tid_232576),\n                                  defunc_0_f_res_203721),\n                           sext_i32_i64(local_tid_232576) -\n                           sext_i32_i64(local_tid_232576 -\n                           skip_threads_232594));\n                \n                if (thread_active_232595 && inactive_232596) {\n                    x_207345 = x_207346;\n                }\n                if (thread_active_232595) {\n         ",
                   "           if (!inactive_232596) {\n                        int64_t defunc_1_op_res_207347 = add64(x_207345,\n                                                               x_207346);\n                        \n                        x_207345 = defunc_1_op_res_207347;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_232578, skip_threads_232594)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_232595) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) color_232078)[sext_i32_i64(local_tid_232576)] =\n                        x_207345;\n                    x_207346 = x_207345;\n                }\n            }\n            if (sle32(wave_sizze_232578, skip_threads_232594)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_232594 *= 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_232576 - squot32(local_tid_232576, 32) * 32) == 31 &&\n            ltid_in_bounds_232593) {\n            ((volatile __local\n              int64_t *) color_232078)[sext_i32_i64(squot32(local_tid_232576,\n                                                            32))] = x_207345;\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_232597;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_232576, 32) == 0 && ltid_in_bounds_232593) {\n                x_232591 = ((volatile __local\n                             int64_t *) color_232078)[sext_i32_i64(local_tid_232576)];\n                if ((local_tid_232576 - squot32(local_tid_232576, 32) * 32) ==\n                    0) {\n                    x_232590 = x_232591;\n                }\n            }\n        }\n        // in-blo",
                   "ck scan (hopefully no barriers needed)\n        {\n            skip_threads_232597 = 1;\n            while (slt32(skip_threads_232597, 32)) {\n                bool thread_active_232598 = sle32(skip_threads_232597,\n                                                  local_tid_232576 -\n                                                  squot32(local_tid_232576,\n                                                          32) * 32) &&\n                     (squot32(local_tid_232576, 32) == 0 &&\n                      ltid_in_bounds_232593);\n                \n                if (thread_active_232598) {\n                    // read operands\n                    {\n                        x_232590 = ((volatile __local\n                                     int64_t *) color_232078)[sext_i32_i64(local_tid_232576) -\n                                                              sext_i32_i64(skip_threads_232597)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_232599 =\n                         slt64(srem64(sext_i32_i64(local_tid_232576 * 32 + 32 -\n                                      1), defunc_0_f_res_203721),\n                               sext_i32_i64(local_tid_232576 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_232576 -\n                                             skip_threads_232597) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_232598 && inactive_232599) {\n                        x_232590 = x_232591;\n                    }\n                    if (thread_active_232598) {\n                        if (!inactive_232599) {\n                            int64_t defunc_1_op_res_232592 = add64(x_232590,\n                                                                   x_232591);\n                            \n                            x_232590 = defunc_1_op_res_232592;\n                        }\n                    }\n               ",
                   " }\n                if (sle32(wave_sizze_232578, skip_threads_232597)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_232598) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) color_232078)[sext_i32_i64(local_tid_232576)] =\n                            x_232590;\n                        x_232591 = x_232590;\n                    }\n                }\n                if (sle32(wave_sizze_232578, skip_threads_232597)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_232597 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_232600 = squot32(local_tid_232576, 32) == 0 ||\n         !ltid_in_bounds_232593;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_232600) {\n                x_207346 = x_207345;\n                x_207345 = ((__local\n                             int64_t *) color_232078)[sext_i32_i64(squot32(local_tid_232576,\n                                                                           32)) -\n                                                      (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_232601 = slt64(srem64(sext_i32_i64(local_tid_232576),\n                                                defunc_0_f_res_203721),\n                                         sext_i32_i64(local_tid_232576) -\n                                         sext_i32_i64(squot32(local_tid_232576,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_232600) {\n                if (inactive_232601) {\n                    x_207345 = x_207346;\n                }\n            }\n            if (!no_carry_in_232600) {\n                if (!inactive_232601) {\n                 ",
                   "   int64_t defunc_1_op_res_207347 = add64(x_207345, x_207346);\n                    \n                    x_207345 = defunc_1_op_res_207347;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_232600) {\n                ((__local\n                  int64_t *) color_232078)[sext_i32_i64(local_tid_232576)] =\n                    x_207345;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_232576, 32) == 0 && ltid_in_bounds_232593) {\n            ((__local int64_t *) color_232078)[sext_i32_i64(local_tid_232576)] =\n                x_207346;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232602 = 0; i_232602 < sdiv_up64(n_p_203574 *\n                                                    defunc_0_f_res_203721 -\n                                                    sext_i32_i64(local_tid_232576),\n                                                    computed_group_sizze_207277);\n         i_232602++) {\n        ((__local int64_t *) color_232077)[squot64(i_232602 *\n                                                   computed_group_sizze_207277 +\n                                                   sext_i32_i64(local_tid_232576),\n                                                   defunc_0_f_res_203721) *\n                                           defunc_0_f_res_203721 + (i_232602 *\n                                                                    computed_group_sizze_207277 +\n                                                                    sext_i32_i64(local_tid_232576) -\n                                                                    squot64(i_232602 *\n                                                                            computed_group_sizze_207277 +\n                                                                            sext_i32_i64(local_tid_232576),\n                                                ",
                   "                            defunc_0_f_res_203721) *\n                                                                    defunc_0_f_res_203721)] =\n            (int64_t) -1;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_207364 = sext_i32_i64(sext_i64_i32(ltid_pre_232580));\n    int64_t gtid_207365 = sext_i32_i64(sext_i64_i32(ltid_pre_232581));\n    int32_t phys_tid_207366 = local_tid_232576;\n    \n    if (slt64(gtid_207364, n_p_203574) && slt64(gtid_207365,\n                                                defunc_0_f_res_203721)) {\n        double x_207367;\n        \n        x_207367 = ((__global double *) mem_229314)[gtid_207337 *\n                                                    (defunc_0_f_res_203721 *\n                                                     n_p_203574) + gtid_207364 *\n                                                    defunc_0_f_res_203721 +\n                                                    gtid_207365];\n        \n        bool isnan_res_207370;\n        \n        isnan_res_207370 = futrts_isnan64(x_207367);\n        \n        bool defunc_0_p_res_207371 = !isnan_res_207370;\n        int64_t defunc_1_f_res_207372;\n        \n        if (defunc_0_p_res_207371) {\n            int64_t x_207368;\n            \n            x_207368 = ((__local int64_t *) color_232078)[gtid_207364 *\n                                                          defunc_0_f_res_203721 +\n                                                          gtid_207365];\n            \n            int64_t defunc_1_f_res_t_res_207373 = sub64(x_207368, (int64_t) 1);\n            \n            defunc_1_f_res_207372 = defunc_1_f_res_t_res_207373;\n        } else {\n            defunc_1_f_res_207372 = (int64_t) -1;\n        }\n        if ((sle64((int64_t) 0, gtid_207364) && slt64(gtid_207364,\n                                                      n_p_203574)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_207372) &&\n             slt64(defunc_1_f_res_207372, defunc_0_f_res_203721))) {\n            ((__loc",
                   "al int64_t *) color_232077)[gtid_207364 *\n                                               defunc_0_f_res_203721 +\n                                               defunc_1_f_res_207372] =\n                gtid_207365;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232603 = 0; i_232603 < sdiv_up64(n_p_203574 *\n                                                    defunc_0_f_res_203721 -\n                                                    sext_i32_i64(local_tid_232576),\n                                                    computed_group_sizze_207277);\n         i_232603++) {\n        int64_t tmp_232604;\n        \n        tmp_232604 = ((__local int64_t *) color_232077)[squot64(i_232603 *\n                                                                computed_group_sizze_207277 +\n                                                                sext_i32_i64(local_tid_232576),\n                                                                defunc_0_f_res_203721) *\n                                                        defunc_0_f_res_203721 +\n                                                        (i_232603 *\n                                                         computed_group_sizze_207277 +\n                                                         sext_i32_i64(local_tid_232576) -\n                                                         squot64(i_232603 *\n                                                                 computed_group_sizze_207277 +\n                                                                 sext_i32_i64(local_tid_232576),\n                                                                 defunc_0_f_res_203721) *\n                                                         defunc_0_f_res_203721)];\n        ((__global int64_t *) mem_229330)[gtid_207337 * (defunc_0_f_res_203721 *\n                                                         n_p_203574) +\n                                          squot64(i_232603 *\n                                     ",
                   "             computed_group_sizze_207277 +\n                                                  sext_i32_i64(local_tid_232576),\n                                                  defunc_0_f_res_203721) *\n                                          defunc_0_f_res_203721 + (i_232603 *\n                                                                   computed_group_sizze_207277 +\n                                                                   sext_i32_i64(local_tid_232576) -\n                                                                   squot64(i_232603 *\n                                                                           computed_group_sizze_207277 +\n                                                                           sext_i32_i64(local_tid_232576),\n                                                                           defunc_0_f_res_203721) *\n                                                                   defunc_0_f_res_203721)] =\n            tmp_232604;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232605 = 0; i_232605 < sdiv_up64(n_p_203574 -\n                                                    sext_i32_i64(local_tid_232576),\n                                                    computed_group_sizze_207277);\n         i_232605++) {\n        int64_t tmp_232606;\n        \n        tmp_232606 = ((__local int64_t *) color_232078)[i_203808 + (i_232605 *\n                                                                    computed_group_sizze_207277 +\n                                                                    sext_i32_i64(local_tid_232576)) *\n                                                        defunc_0_f_res_203721];\n        ((__global int64_t *) mem_229334)[gtid_207337 * n_p_203574 + (i_232605 *\n                                                                      computed_group_sizze_207277 +\n                                                                      sext_i32_i64(local_tid_232576))] =\n            tmp_232606;\n    }\n    ",
                   "barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_207614(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *color_232080_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *color_232079_backing_aligned_1,\n                                             int64_t n_p_203574,\n                                             int64_t partition_sizze_203667,\n                                             int64_t defunc_0_f_res_203721,\n                                             int64_t i_203808, __global\n                                             unsigned char *mem_229314, __global\n                                             unsigned char *mem_229348, __global\n                                             unsigned char *mem_229352)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict color_232080_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_232080_backing_aligned_0;\n    __local volatile unsigned char *restrict color_232079_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232079_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232607;\n    int32_t local_tid_232608;\n    int64_t group_sizze_232611;\n    int32_t wave_sizze_232610;\n    int32_t group_tid_232609;\n    \n    global_tid_232607 = get_global_id(0);\n    local_tid_232608 = get_local_id(0);\n    group_sizze_232611 = get_local_size(0);\n    wave_sizze_232610 = LOCKSTEP_WIDTH;\n    group_tid_232609 = get_group_id(0);\n    \n    int32_t phys_tid_207614 = group_tid_232609;\n    int64_t slice_232613 = defunc_0_f_res_203721;\n    int64_t l",
                   "tid_pre_232612 = sext_i32_i64(local_tid_232608);\n    int64_t remnant_232614 = sext_i32_i64(local_tid_232608) - ltid_pre_232612;\n    int64_t slice_232615 = n_p_203574;\n    int64_t slice_232616 = partition_sizze_203667 * slice_232615;\n    int64_t gtid_207612 = squot64(sext_i32_i64(group_tid_232609), slice_232615);\n    int64_t remnant_232617 = sext_i32_i64(group_tid_232609) - gtid_207612 *\n            slice_232615;\n    int64_t gtid_207613 = remnant_232617;\n    int64_t remnant_232618 = remnant_232617 - gtid_207613;\n    __local unsigned char *color_232079;\n    \n    color_232079 = (__local unsigned char *) color_232079_backing_0;\n    \n    __local unsigned char *color_232080;\n    \n    color_232080 = (__local unsigned char *) color_232080_backing_1;\n    \n    int64_t gtid_207618 = sext_i32_i64(sext_i64_i32(ltid_pre_232612));\n    int32_t phys_tid_207619 = local_tid_232608;\n    double x_207623;\n    \n    x_207623 = ((__global double *) mem_229314)[gtid_207612 *\n                                                (defunc_0_f_res_203721 *\n                                                 n_p_203574) + gtid_207613 *\n                                                defunc_0_f_res_203721 +\n                                                gtid_207618];\n    \n    bool isnan_res_207624;\n    \n    isnan_res_207624 = futrts_isnan64(x_207623);\n    \n    bool defunc_0_p_res_207625 = !isnan_res_207624;\n    int64_t defunc_0_f_res_207626 = btoi_bool_i64(defunc_0_p_res_207625);\n    \n    ((__local int64_t *) color_232080)[gtid_207618] = defunc_0_f_res_207626;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_232619 = defunc_0_f_res_203721;\n    int64_t x_207620;\n    int64_t x_207621;\n    int64_t x_232621;\n    int64_t x_232622;\n    bool ltid_in_bounds_232624 = slt64(sext_i32_i64(local_tid_232608),\n                                       defunc_0_f_res_203721);\n    int32_t skip_threads_232625;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_232624) {\n            x_207621 ",
                   "= ((volatile __local\n                         int64_t *) color_232080)[sext_i32_i64(local_tid_232608)];\n            if ((local_tid_232608 - squot32(local_tid_232608, 32) * 32) == 0) {\n                x_207620 = x_207621;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_232625 = 1;\n        while (slt32(skip_threads_232625, 32)) {\n            bool thread_active_232626 = sle32(skip_threads_232625,\n                                              local_tid_232608 -\n                                              squot32(local_tid_232608, 32) *\n                                              32) && ltid_in_bounds_232624;\n            \n            if (thread_active_232626) {\n                // read operands\n                {\n                    x_207620 = ((volatile __local\n                                 int64_t *) color_232080)[sext_i32_i64(local_tid_232608) -\n                                                          sext_i32_i64(skip_threads_232625)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_232627 =\n                     slt64(srem64(sext_i32_i64(local_tid_232608),\n                                  defunc_0_f_res_203721),\n                           sext_i32_i64(local_tid_232608) -\n                           sext_i32_i64(local_tid_232608 -\n                           skip_threads_232625));\n                \n                if (thread_active_232626 && inactive_232627) {\n                    x_207620 = x_207621;\n                }\n                if (thread_active_232626) {\n                    if (!inactive_232627) {\n                        int64_t defunc_1_op_res_207622 = add64(x_207620,\n                                                               x_207621);\n                        \n                        x_207620 = defunc_1_op_res_207622;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_232610, skip_threads_232625)",
                   ") {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_232626) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) color_232080)[sext_i32_i64(local_tid_232608)] =\n                        x_207620;\n                    x_207621 = x_207620;\n                }\n            }\n            if (sle32(wave_sizze_232610, skip_threads_232625)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_232625 *= 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_232608 - squot32(local_tid_232608, 32) * 32) == 31 &&\n            ltid_in_bounds_232624) {\n            ((volatile __local\n              int64_t *) color_232080)[sext_i32_i64(squot32(local_tid_232608,\n                                                            32))] = x_207620;\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_232628;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_232608, 32) == 0 && ltid_in_bounds_232624) {\n                x_232622 = ((volatile __local\n                             int64_t *) color_232080)[sext_i32_i64(local_tid_232608)];\n                if ((local_tid_232608 - squot32(local_tid_232608, 32) * 32) ==\n                    0) {\n                    x_232621 = x_232622;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_232628 = 1;\n            while (slt32(skip_threads_232628, 32)) {\n                bool thread_active_232629 = sle32(skip_threads_232628,\n                                                  local_tid_232608 -\n                                                  squot32(local_tid_232608,\n                          ",
                   "                                32) * 32) &&\n                     (squot32(local_tid_232608, 32) == 0 &&\n                      ltid_in_bounds_232624);\n                \n                if (thread_active_232629) {\n                    // read operands\n                    {\n                        x_232621 = ((volatile __local\n                                     int64_t *) color_232080)[sext_i32_i64(local_tid_232608) -\n                                                              sext_i32_i64(skip_threads_232628)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_232630 =\n                         slt64(srem64(sext_i32_i64(local_tid_232608 * 32 + 32 -\n                                      1), defunc_0_f_res_203721),\n                               sext_i32_i64(local_tid_232608 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_232608 -\n                                             skip_threads_232628) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_232629 && inactive_232630) {\n                        x_232621 = x_232622;\n                    }\n                    if (thread_active_232629) {\n                        if (!inactive_232630) {\n                            int64_t defunc_1_op_res_232623 = add64(x_232621,\n                                                                   x_232622);\n                            \n                            x_232621 = defunc_1_op_res_232623;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_232610, skip_threads_232628)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_232629) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) color_232080)[sext_i32_i64(local_tid_232608)] =\n           ",
                   "                 x_232621;\n                        x_232622 = x_232621;\n                    }\n                }\n                if (sle32(wave_sizze_232610, skip_threads_232628)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_232628 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_232631 = squot32(local_tid_232608, 32) == 0 ||\n         !ltid_in_bounds_232624;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_232631) {\n                x_207621 = x_207620;\n                x_207620 = ((__local\n                             int64_t *) color_232080)[sext_i32_i64(squot32(local_tid_232608,\n                                                                           32)) -\n                                                      (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_232632 = slt64(srem64(sext_i32_i64(local_tid_232608),\n                                                defunc_0_f_res_203721),\n                                         sext_i32_i64(local_tid_232608) -\n                                         sext_i32_i64(squot32(local_tid_232608,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_232631) {\n                if (inactive_232632) {\n                    x_207620 = x_207621;\n                }\n            }\n            if (!no_carry_in_232631) {\n                if (!inactive_232632) {\n                    int64_t defunc_1_op_res_207622 = add64(x_207620, x_207621);\n                    \n                    x_207620 = defunc_1_op_res_207622;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_232631) {\n                ((__local\n                  int64_t *) color_232080)[sext_i32_i64(local_tid_232608)] =\n                  ",
                   "  x_207620;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_232608, 32) == 0 && ltid_in_bounds_232624) {\n            ((__local int64_t *) color_232080)[sext_i32_i64(local_tid_232608)] =\n                x_207621;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t last_res_207627;\n    \n    last_res_207627 = ((__local int64_t *) color_232080)[i_203808];\n    ((__local int64_t *) color_232079)[sext_i32_i64(local_tid_232608)] =\n        (int64_t) -1;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t write_i_207630 = sext_i32_i64(sext_i64_i32(ltid_pre_232612));\n    int32_t phys_tid_207631 = local_tid_232608;\n    double x_207632;\n    \n    x_207632 = ((__global double *) mem_229314)[gtid_207612 *\n                                                (defunc_0_f_res_203721 *\n                                                 n_p_203574) + gtid_207613 *\n                                                defunc_0_f_res_203721 +\n                                                write_i_207630];\n    \n    bool isnan_res_207635;\n    \n    isnan_res_207635 = futrts_isnan64(x_207632);\n    \n    bool defunc_0_p_res_207636 = !isnan_res_207635;\n    int64_t defunc_1_f_res_207637;\n    \n    if (defunc_0_p_res_207636) {\n        int64_t x_207633;\n        \n        x_207633 = ((__local int64_t *) color_232080)[write_i_207630];\n        \n        int64_t defunc_1_f_res_t_res_207638 = sub64(x_207633, (int64_t) 1);\n        \n        defunc_1_f_res_207637 = defunc_1_f_res_t_res_207638;\n    } else {\n        defunc_1_f_res_207637 = (int64_t) -1;\n    }\n    if (sle64((int64_t) 0, defunc_1_f_res_207637) &&\n        slt64(defunc_1_f_res_207637, defunc_0_f_res_203721)) {\n        ((__local int64_t *) color_232079)[defunc_1_f_res_207637] =\n            write_i_207630;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t tmp_232633;\n    \n    tmp_232633 = ((__local\n                   int64_t *) color_232079)[sex",
                   "t_i32_i64(local_tid_232608)];\n    ((__global int64_t *) mem_229348)[gtid_207612 * (defunc_0_f_res_203721 *\n                                                     n_p_203574) + gtid_207613 *\n                                      defunc_0_f_res_203721 +\n                                      sext_i32_i64(local_tid_232608)] =\n        tmp_232633;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_tid_232608 == 0) {\n        ((__global int64_t *) mem_229352)[gtid_207612 * n_p_203574 +\n                                          gtid_207613] = last_res_207627;\n    }\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_207867(__global int *global_failure,\n                                             int failure_is_an_option, __global\n                                             int64_t *global_failure_args,\n                                             __local volatile\n                                             int64_t *color_232087_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *color_232086_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *color_232085_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *color_232084_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *color_232083_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *color_232082_backing_aligned_5,\n                                             __local volatile\n                                             int64_t *color_232081_backing_aligned_6,\n                                             int64_t n_p_203574,\n                                             int64_t q_s_203575,\n                ",
                   "                             int64_t jump_s_203581,\n                                             int64_t partition_sizze_203667,\n                                             int64_t defunc_0_f_res_203721,\n                                             int64_t pad_css_len_203722,\n                                             int64_t s_n_m_203726,\n                                             int64_t i_203808,\n                                             unsigned char x_203809_bits,\n                                             int64_t min_res_203839,\n                                             unsigned char loop_cond_203844_bits,\n                                             double i64_res_203845,\n                                             int64_t computed_group_sizze_207709,\n                                             __global\n                                             unsigned char *ext_mem_229372,\n                                             __global\n                                             unsigned char *ext_mem_229373,\n                                             __global unsigned char *mem_229406,\n                                             __global unsigned char *mem_229411)\n{\n    bool x_203809 = x_203809_bits;\n    bool loop_cond_203844 = loop_cond_203844_bits;\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict color_232087_backing_6 =\n                                   (__local volatile\n                                    unsigned char *) color_232087_backing_aligned_0;\n    __local volatile unsigned char *restrict color_232086_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) color_232086_backing_aligned_1;\n    __local volatile unsigned char *restrict color_232085_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) color_232085_backing_alig",
                   "ned_2;\n    __local volatile unsigned char *restrict color_232084_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) color_232084_backing_aligned_3;\n    __local volatile unsigned char *restrict color_232083_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) color_232083_backing_aligned_4;\n    __local volatile unsigned char *restrict color_232082_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_232082_backing_aligned_5;\n    __local volatile unsigned char *restrict color_232081_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232081_backing_aligned_6;\n    volatile __local bool local_failure;\n    \n    if (failure_is_an_option) {\n        int failed = *global_failure >= 0;\n        \n        if (failed)\n            return;\n    }\n    local_failure = false;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t global_tid_232725;\n    int32_t local_tid_232726;\n    int64_t group_sizze_232729;\n    int32_t wave_sizze_232728;\n    int32_t group_tid_232727;\n    \n    global_tid_232725 = get_global_id(0);\n    local_tid_232726 = get_local_id(0);\n    group_sizze_232729 = get_local_size(0);\n    wave_sizze_232728 = LOCKSTEP_WIDTH;\n    group_tid_232727 = get_group_id(0);\n    \n    int32_t phys_tid_207867 = group_tid_232727;\n    int64_t slice_232731 = n_p_203574;\n    int64_t ltid_pre_232730 = sext_i32_i64(local_tid_232726);\n    int64_t remnant_232732 = sext_i32_i64(local_tid_232726) - ltid_pre_232730;\n    int64_t slice_232735 = defunc_0_f_res_203721;\n    int64_t slice_232736 = n_p_203574 * slice_232735;\n    int64_t ltid_pre_232733 = squot64(sext_i32_i64(local_tid_232726),\n                                      slice_232735);\n    int64_t remnant_232737 = sext_i32_i64(local_tid_232726) - ltid_pre_232733 *\n            sl",
                   "ice_232735;\n    int64_t ltid_pre_232734 = remnant_232737;\n    int64_t remnant_232738 = remnant_232737 - ltid_pre_232734;\n    int64_t slice_232741 = s_n_m_203726;\n    int64_t slice_232742 = n_p_203574 * slice_232741;\n    int64_t ltid_pre_232739 = squot64(sext_i32_i64(local_tid_232726),\n                                      slice_232741);\n    int64_t remnant_232743 = sext_i32_i64(local_tid_232726) - ltid_pre_232739 *\n            slice_232741;\n    int64_t ltid_pre_232740 = remnant_232743;\n    int64_t remnant_232744 = remnant_232743 - ltid_pre_232740;\n    int64_t slice_232745 = partition_sizze_203667;\n    int64_t gtid_207866 = sext_i32_i64(group_tid_232727);\n    int64_t remnant_232746 = sext_i32_i64(group_tid_232727) - gtid_207866;\n    __local unsigned char *color_232081;\n    \n    color_232081 = (__local unsigned char *) color_232081_backing_0;\n    \n    __local unsigned char *color_232082;\n    \n    color_232082 = (__local unsigned char *) color_232082_backing_1;\n    \n    __local unsigned char *color_232083;\n    \n    color_232083 = (__local unsigned char *) color_232083_backing_2;\n    \n    __local unsigned char *color_232084;\n    \n    color_232084 = (__local unsigned char *) color_232084_backing_3;\n    \n    __local unsigned char *color_232085;\n    \n    color_232085 = (__local unsigned char *) color_232085_backing_4;\n    \n    __local unsigned char *color_232086;\n    \n    color_232086 = (__local unsigned char *) color_232086_backing_5;\n    \n    __local unsigned char *color_232087;\n    \n    color_232087 = (__local unsigned char *) color_232087_backing_6;\n    \n    int64_t gtid_207873 = sext_i32_i64(sext_i64_i32(ltid_pre_232733));\n    int64_t gtid_207874 = sext_i32_i64(sext_i64_i32(ltid_pre_232734));\n    int32_t phys_tid_207875 = local_tid_232726;\n    \n    if (slt64(gtid_207873, n_p_203574) && slt64(gtid_207874,\n                                                defunc_0_f_res_203721)) {\n        int64_t x_207876;\n        \n        x_207876 = ((__global int64_t *) ext_mem_229373)[",
                   "gtid_207866 *\n                                                         (defunc_0_f_res_203721 *\n                                                          n_p_203574) +\n                                                         gtid_207873 *\n                                                         defunc_0_f_res_203721 +\n                                                         gtid_207874];\n        \n        int64_t defunc_0_f_res_207877 = add64((int64_t) 1, x_207876);\n        \n        ((__local int64_t *) color_232087)[gtid_207873 * defunc_0_f_res_203721 +\n                                           gtid_207874] = defunc_0_f_res_207877;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_207882 = sext_i32_i64(sext_i64_i32(ltid_pre_232730));\n    int32_t phys_tid_207883 = local_tid_232726;\n    \n    if (slt64(gtid_207882, n_p_203574)) {\n        int64_t x_207884;\n        \n        x_207884 = ((__global int64_t *) ext_mem_229372)[gtid_207866 *\n                                                         n_p_203574 +\n                                                         gtid_207882];\n        \n        int64_t min_arg_207885 = sub64(x_207884, (int64_t) 1);\n        int64_t min_arg_207886 = sub64(x_207884, min_res_203839);\n        int64_t min_res_207887 = smin64(q_s_203575, x_207884);\n        double i64_res_207888 = sitofp_i64_f64(x_207884);\n        double x_207889 = i64_res_203845 - i64_res_207888;\n        double max_arg_207890 = x_207889 / 2.0;\n        double max_res_207891 = fmax64(0.0, max_arg_207890);\n        \n        ((__local int64_t *) color_232086)[gtid_207882] = min_arg_207885;\n        ((__local int64_t *) color_232085)[gtid_207882] = min_arg_207886;\n        ((__local int64_t *) color_232084)[gtid_207882] = min_res_207887;\n        ((__local double *) color_232083)[gtid_207882] = max_res_207891;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_207894 = sext_i32_i64(sext_i64_i32(ltid_pre_232739));\n    int64_t gtid_207895 = sext_i32_i64(sext_i64_i32(lt",
                   "id_pre_232740));\n    int32_t phys_tid_207896 = local_tid_232726;\n    \n    if (slt64(gtid_207894, n_p_203574) && slt64(gtid_207895, s_n_m_203726)) {\n        int64_t min_arg_207898;\n        \n        min_arg_207898 = ((__local int64_t *) color_232086)[gtid_207894];\n        \n        int64_t min_arg_207899;\n        \n        min_arg_207899 = ((__local int64_t *) color_232085)[gtid_207894];\n        \n        int64_t min_res_207900;\n        \n        min_res_207900 = ((__local int64_t *) color_232084)[gtid_207894];\n        \n        double max_res_207901;\n        \n        max_res_207901 = ((__local double *) color_232083)[gtid_207894];\n        \n        bool cond_207903 = gtid_207895 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_207904;\n        \n        if (cond_207903) {\n            defunc_0_m_fun_res_207904 = (int64_t) 0;\n        } else {\n            int64_t y_207905 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_207906 = gtid_207895 == y_207905;\n            int64_t defunc_0_m_fun_res_f_res_207907;\n            \n            if (cond_207906) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_207908 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_207907 =\n                    defunc_0_m_fun_res_f_res_t_res_207908;\n            } else {\n                int64_t x_207909 = sub64(gtid_207895, (int64_t) 1);\n                int64_t x_207910 = mul64(jump_s_203581, x_207909);\n                int64_t min_arg_207911 = add64((int64_t) 1, x_207910);\n                int64_t min_res_207912 = smin64(defunc_0_f_res_203721,\n                                                min_arg_207911);\n                \n                defunc_0_m_fun_res_f_res_207907 = min_res_207912;\n            }\n            defunc_0_m_fun_res_207904 = defunc_0_m_fun_res_f_res_207907;\n        }\n        \n        bool init_idx_207913;\n        int64_t init_idx_207914;\n        int64_t init_idx_207915;\n        bool loop_while_207916;\n  ",
                   "      int64_t low_207917;\n        int64_t high_207918;\n        \n        loop_while_207916 = x_203809;\n        low_207917 = (int64_t) 0;\n        high_207918 = i_203808;\n        while (loop_while_207916) {\n            int64_t x_207919 = add64(low_207917, high_207918);\n            int64_t mid_207920 = sdiv64(x_207919, (int64_t) 2);\n            bool x_207921 = sle64((int64_t) 0, mid_207920);\n            bool y_207922 = slt64(mid_207920, defunc_0_f_res_203721);\n            bool bounds_check_207923 = x_207921 && y_207922;\n            bool index_certs_207924;\n            \n            if (!bounds_check_207923) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 2) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_207920;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203721;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_2;\n                }\n            }\n            \n            int64_t mid_id_207925;\n            \n            mid_id_207925 = ((__local int64_t *) color_232087)[gtid_207894 *\n                                                               defunc_0_f_res_203721 +\n                                                               mid_207920];\n            \n            bool cond_207926 = slt64(mid_id_207925, (int64_t) 0);\n            int64_t mid_idx_207927;\n            \n            if (cond_207926) {\n                mid_idx_207927 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_207927 = mid_id_207925;\n            }\n            \n            bool cond_207928 = sle64(defunc_0_m_fun_res_207904, mid_idx_207927);\n            int64_t loopres_207929;\n            int64_t loopres_207930;\n            \n            if (cond_207928) {\n                int64_t loopres_t_res_207931 = sub64(mid_207920, (int64_t) 1);\n                \n              ",
                   "  loopres_207929 = low_207917;\n                loopres_207930 = loopres_t_res_207931;\n            } else {\n                int64_t loopres_f_res_207932 = add64((int64_t) 1, mid_207920);\n                \n                loopres_207929 = loopres_f_res_207932;\n                loopres_207930 = high_207918;\n            }\n            \n            bool loop_cond_207933 = sle64(loopres_207929, loopres_207930);\n            bool loop_while_tmp_232747 = loop_cond_207933;\n            int64_t low_tmp_232748 = loopres_207929;\n            int64_t high_tmp_232749 = loopres_207930;\n            \n            loop_while_207916 = loop_while_tmp_232747;\n            low_207917 = low_tmp_232748;\n            high_207918 = high_tmp_232749;\n        }\n        init_idx_207913 = loop_while_207916;\n        init_idx_207914 = low_207917;\n        init_idx_207915 = high_207918;\n        \n        bool idx_207934;\n        int64_t idx_207935;\n        int64_t idx_207936;\n        int64_t idx_207937;\n        bool loop_while_207938;\n        int64_t l_idx_207939;\n        int64_t r_idx_207940;\n        int64_t span_207941;\n        \n        loop_while_207938 = loop_cond_203844;\n        l_idx_207939 = init_idx_207914;\n        r_idx_207940 = init_idx_207914;\n        span_207941 = (int64_t) 1;\n        while (loop_while_207938) {\n            int64_t max_arg_207942 = sub64(l_idx_207939, (int64_t) 1);\n            int64_t max_res_207943 = smax64((int64_t) 0, max_arg_207942);\n            int64_t min_arg_207944 = add64((int64_t) 1, r_idx_207940);\n            int64_t min_res_207945 = smin64(min_arg_207898, min_arg_207944);\n            bool x_207946 = sle64((int64_t) 0, max_res_207943);\n            bool y_207947 = slt64(max_res_207943, defunc_0_f_res_203721);\n            bool bounds_check_207948 = x_207946 && y_207947;\n            bool index_certs_207949;\n            \n            if (!bounds_check_207948) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 3) ==\n                       ",
                   " -1) {\n                        global_failure_args[0] = (int64_t) max_res_207943;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203721;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_2;\n                }\n            }\n            \n            int64_t x_207950;\n            \n            x_207950 = ((__local int64_t *) color_232087)[gtid_207894 *\n                                                          defunc_0_f_res_203721 +\n                                                          max_res_207943];\n            \n            int64_t abs_arg_207951 = sub64(x_207950, defunc_0_m_fun_res_207904);\n            int64_t abs_res_207952 = abs64(abs_arg_207951);\n            bool x_207953 = sle64((int64_t) 0, min_res_207945);\n            bool y_207954 = slt64(min_res_207945, defunc_0_f_res_203721);\n            bool bounds_check_207955 = x_207953 && y_207954;\n            bool index_certs_207956;\n            \n            if (!bounds_check_207955) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 4) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_207945;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203721;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_2;\n                }\n            }\n            \n            int64_t x_207957;\n            \n            x_207957 = ((__local int64_t *) color_232087)[gtid_207894 *\n                                                          defunc_0_f_res_203721 +\n                                                          min_res_207945];\n            \n            int64_t abs_arg_207958 = sub64(x_207957, defunc_0_m_fun_res_207904);\n            int64_t abs_res_207959 = abs64(abs_arg_207958);\n            bool con",
                   "d_207960 = max_res_207943 == l_idx_207939;\n            int64_t loopres_207961;\n            int64_t loopres_207962;\n            int64_t loopres_207963;\n            \n            if (cond_207960) {\n                loopres_207961 = l_idx_207939;\n                loopres_207962 = r_idx_207940;\n                loopres_207963 = min_res_203839;\n            } else {\n                bool cond_207964 = slt64(abs_res_207952, abs_res_207959);\n                bool cond_f_res_207965 = min_res_207945 == r_idx_207940;\n                bool x_207966 = !cond_207964;\n                bool y_207967 = cond_f_res_207965 && x_207966;\n                bool cond_207968 = cond_207964 || y_207967;\n                int64_t loopres_f_res_207969;\n                \n                if (cond_207968) {\n                    loopres_f_res_207969 = max_res_207943;\n                } else {\n                    loopres_f_res_207969 = l_idx_207939;\n                }\n                \n                int64_t loopres_f_res_207970;\n                \n                if (cond_207968) {\n                    loopres_f_res_207970 = r_idx_207940;\n                } else {\n                    loopres_f_res_207970 = min_res_207945;\n                }\n                \n                int64_t loopres_f_res_207971;\n                \n                if (cond_207968) {\n                    int64_t loopres_f_res_t_res_207972 = add64((int64_t) 1,\n                                                               span_207941);\n                    \n                    loopres_f_res_207971 = loopres_f_res_t_res_207972;\n                } else {\n                    int64_t loopres_f_res_f_res_207973 = add64((int64_t) 1,\n                                                               span_207941);\n                    \n                    loopres_f_res_207971 = loopres_f_res_f_res_207973;\n                }\n                loopres_207961 = loopres_f_res_207969;\n                loopres_207962 = loopres_f_res_207970;\n                loopres_207963 = loo",
                   "pres_f_res_207971;\n            }\n            \n            bool loop_cond_207974 = slt64(loopres_207963, min_res_203839);\n            bool loop_while_tmp_232750 = loop_cond_207974;\n            int64_t l_idx_tmp_232751 = loopres_207961;\n            int64_t r_idx_tmp_232752 = loopres_207962;\n            int64_t span_tmp_232753 = loopres_207963;\n            \n            loop_while_207938 = loop_while_tmp_232750;\n            l_idx_207939 = l_idx_tmp_232751;\n            r_idx_207940 = r_idx_tmp_232752;\n            span_207941 = span_tmp_232753;\n        }\n        idx_207934 = loop_while_207938;\n        idx_207935 = l_idx_207939;\n        idx_207936 = r_idx_207940;\n        idx_207937 = span_207941;\n        \n        int64_t min_res_207975 = smin64(min_arg_207899, idx_207935);\n        int64_t max_res_207976 = smax64((int64_t) 0, min_res_207975);\n        int64_t defunc_0_m_fun_res_207977;\n        \n        if (cond_207903) {\n            defunc_0_m_fun_res_207977 = (int64_t) 0;\n        } else {\n            int64_t y_207978 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_207979 = gtid_207895 == y_207978;\n            int64_t defunc_0_m_fun_res_f_res_207980;\n            \n            if (cond_207979) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_207981 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_207980 =\n                    defunc_0_m_fun_res_f_res_t_res_207981;\n            } else {\n                int64_t x_207982 = sub64(gtid_207895, (int64_t) 1);\n                int64_t x_207983 = mul64(jump_s_203581, x_207982);\n                int64_t min_arg_207984 = add64((int64_t) 1, x_207983);\n                int64_t min_res_207985 = smin64(defunc_0_f_res_203721,\n                                                min_arg_207984);\n                \n                defunc_0_m_fun_res_f_res_207980 = min_res_207985;\n            }\n            defunc_0_m_fun_res_207977 = defunc_0_m_fun_res_f_res_207980;",
                   "\n        }\n        \n        int64_t x_207986 = add64(min_res_207900, max_res_207976);\n        int64_t r_207987 = sub64(x_207986, (int64_t) 1);\n        bool x_207988 = sle64((int64_t) 0, r_207987);\n        bool y_207989 = slt64(r_207987, defunc_0_f_res_203721);\n        bool bounds_check_207990 = x_207988 && y_207989;\n        bool index_certs_207991;\n        \n        if (!bounds_check_207990) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 5) == -1) {\n                    global_failure_args[0] = (int64_t) r_207987;\n                    global_failure_args[1] = (int64_t) defunc_0_f_res_203721;\n                    ;\n                }\n                local_failure = true;\n                goto error_2;\n            }\n        }\n        \n        int64_t x_207992;\n        \n        x_207992 = ((__local int64_t *) color_232087)[gtid_207894 *\n                                                      defunc_0_f_res_203721 +\n                                                      r_207987];\n        \n        int64_t abs_arg_207993 = sub64(x_207992, defunc_0_m_fun_res_207977);\n        int64_t abs_res_207994 = abs64(abs_arg_207993);\n        bool x_207995 = sle64((int64_t) 0, max_res_207976);\n        bool y_207996 = slt64(max_res_207976, defunc_0_f_res_203721);\n        bool bounds_check_207997 = x_207995 && y_207996;\n        bool index_certs_207998;\n        \n        if (!bounds_check_207997) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 6) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_207976;\n                    global_failure_args[1] = (int64_t) defunc_0_f_res_203721;\n                    ;\n                }\n                local_failure = true;\n                goto error_2;\n            }\n        }\n        \n        int64_t x_207999;\n        \n        x_207999 = ((__local int64_t *) color_232087)[gtid_207894 *\n                                                      defunc_0_f_res_203721 +\n            ",
                   "                                          max_res_207976];\n        \n        int64_t abs_arg_208000 = sub64(x_207999, defunc_0_m_fun_res_207977);\n        int64_t abs_res_208001 = abs64(abs_arg_208000);\n        int64_t max_res_208002 = smax64(abs_res_207994, abs_res_208001);\n        double defunc_0_f_res_208003 = sitofp_i64_f64(max_res_208002);\n        double defunc_1_f_res_208004 = max_res_207901 + defunc_0_f_res_208003;\n        \n        ((__local double *) color_232082)[gtid_207894 * s_n_m_203726 +\n                                          gtid_207895] = defunc_1_f_res_208004;\n        ((__local int64_t *) color_232081)[gtid_207894 * s_n_m_203726 +\n                                           gtid_207895] = max_res_207976;\n    }\n    \n  error_2:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232754 = 0; i_232754 < sdiv_up64(n_p_203574 * s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_232726),\n                                                    computed_group_sizze_207709);\n         i_232754++) {\n        int64_t tmp_232755;\n        \n        tmp_232755 = ((__local int64_t *) color_232081)[squot64(i_232754 *\n                                                                computed_group_sizze_207709 +\n                                                                sext_i32_i64(local_tid_232726),\n                                                                s_n_m_203726) *\n                                                        s_n_m_203726 +\n                                                        (i_232754 *\n                                                         computed_group_sizze_207709 +\n                                                         sext_i32_i64(local_tid_232726) -\n                                                         squot64(i_232754 *\n                                                                 computed_group_sizze_207709 +\n   ",
                   "                                                              sext_i32_i64(local_tid_232726),\n                                                                 s_n_m_203726) *\n                                                         s_n_m_203726)];\n        ((__global int64_t *) mem_229406)[gtid_207866 * (s_n_m_203726 *\n                                                         n_p_203574) +\n                                          squot64(i_232754 *\n                                                  computed_group_sizze_207709 +\n                                                  sext_i32_i64(local_tid_232726),\n                                                  s_n_m_203726) * s_n_m_203726 +\n                                          (i_232754 *\n                                           computed_group_sizze_207709 +\n                                           sext_i32_i64(local_tid_232726) -\n                                           squot64(i_232754 *\n                                                   computed_group_sizze_207709 +\n                                                   sext_i32_i64(local_tid_232726),\n                                                   s_n_m_203726) *\n                                           s_n_m_203726)] = tmp_232755;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232756 = 0; i_232756 < sdiv_up64(n_p_203574 * s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_232726),\n                                                    computed_group_sizze_207709);\n         i_232756++) {\n        double tmp_232757;\n        \n        tmp_232757 = ((__local double *) color_232082)[squot64(i_232756 *\n                                                               computed_group_sizze_207709 +\n                                                               sext_i32_i64(local_tid_232726),\n                                                               s_n_m_203726) *\n                                                   ",
                   "    s_n_m_203726 +\n                                                       (i_232756 *\n                                                        computed_group_sizze_207709 +\n                                                        sext_i32_i64(local_tid_232726) -\n                                                        squot64(i_232756 *\n                                                                computed_group_sizze_207709 +\n                                                                sext_i32_i64(local_tid_232726),\n                                                                s_n_m_203726) *\n                                                        s_n_m_203726)];\n        ((__global double *) mem_229411)[gtid_207866 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         squot64(i_232756 *\n                                                 computed_group_sizze_207709 +\n                                                 sext_i32_i64(local_tid_232726),\n                                                 s_n_m_203726) * s_n_m_203726 +\n                                         (i_232756 *\n                                          computed_group_sizze_207709 +\n                                          sext_i32_i64(local_tid_232726) -\n                                          squot64(i_232756 *\n                                                  computed_group_sizze_207709 +\n                                                  sext_i32_i64(local_tid_232726),\n                                                  s_n_m_203726) *\n                                          s_n_m_203726)] = tmp_232757;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_3:\n    return;\n}\n__kernel void mainzisegmap_intragroup_208771(__global int *global_failure,\n                                             int failure_is_an_option, __global\n                                             int64_t *global_failure_args,\n                     ",
                   "                        __local volatile\n                                             int64_t *color_232090_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *color_232089_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *color_232088_backing_aligned_2,\n                                             int64_t n_p_203574,\n                                             int64_t q_s_203575,\n                                             int64_t jump_s_203581,\n                                             int64_t partition_sizze_203667,\n                                             int64_t defunc_0_f_res_203721,\n                                             int64_t pad_css_len_203722,\n                                             int64_t s_n_m_203726,\n                                             int64_t i_203808,\n                                             unsigned char x_203809_bits,\n                                             int64_t min_res_203839,\n                                             unsigned char loop_cond_203844_bits,\n                                             double i64_res_203845,\n                                             int64_t computed_group_sizze_208757,\n                                             __global\n                                             unsigned char *ext_mem_229372,\n                                             __global\n                                             unsigned char *ext_mem_229373,\n                                             __global unsigned char *mem_229428,\n                                             __global unsigned char *mem_229433)\n{\n    bool x_203809 = x_203809_bits;\n    bool loop_cond_203844 = loop_cond_203844_bits;\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict col",
                   "or_232090_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) color_232090_backing_aligned_0;\n    __local volatile unsigned char *restrict color_232089_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_232089_backing_aligned_1;\n    __local volatile unsigned char *restrict color_232088_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232088_backing_aligned_2;\n    volatile __local bool local_failure;\n    \n    if (failure_is_an_option) {\n        int failed = *global_failure >= 0;\n        \n        if (failed)\n            return;\n    }\n    local_failure = false;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t global_tid_232758;\n    int32_t local_tid_232759;\n    int64_t group_sizze_232762;\n    int32_t wave_sizze_232761;\n    int32_t group_tid_232760;\n    \n    global_tid_232758 = get_global_id(0);\n    local_tid_232759 = get_local_id(0);\n    group_sizze_232762 = get_local_size(0);\n    wave_sizze_232761 = LOCKSTEP_WIDTH;\n    group_tid_232760 = get_group_id(0);\n    \n    int32_t phys_tid_208771 = group_tid_232760;\n    int64_t slice_232764 = defunc_0_f_res_203721;\n    int64_t ltid_pre_232763 = sext_i32_i64(local_tid_232759);\n    int64_t remnant_232765 = sext_i32_i64(local_tid_232759) - ltid_pre_232763;\n    int64_t slice_232767 = s_n_m_203726;\n    int64_t ltid_pre_232766 = sext_i32_i64(local_tid_232759);\n    int64_t remnant_232768 = sext_i32_i64(local_tid_232759) - ltid_pre_232766;\n    int64_t slice_232769 = n_p_203574;\n    int64_t slice_232770 = partition_sizze_203667 * slice_232769;\n    int64_t gtid_208769 = squot64(sext_i32_i64(group_tid_232760), slice_232769);\n    int64_t remnant_232771 = sext_i32_i64(group_tid_232760) - gtid_208769 *\n            slice_232769;\n    int64_t gtid_208770 = remnant_232771;\n    int64_t remnant_232772 = remnant_232771 - gtid_208770;\n  ",
                   "  __local unsigned char *color_232088;\n    \n    color_232088 = (__local unsigned char *) color_232088_backing_0;\n    \n    __local unsigned char *color_232089;\n    \n    color_232089 = (__local unsigned char *) color_232089_backing_1;\n    \n    __local unsigned char *color_232090;\n    \n    color_232090 = (__local unsigned char *) color_232090_backing_2;\n    \n    int64_t x_208774;\n    \n    x_208774 = ((__global int64_t *) ext_mem_229372)[gtid_208769 * n_p_203574 +\n                                                     gtid_208770];\n    \n    int64_t gtid_208776 = sext_i32_i64(sext_i64_i32(ltid_pre_232763));\n    int32_t phys_tid_208777 = local_tid_232759;\n    \n    if (slt64(gtid_208776, defunc_0_f_res_203721)) {\n        int64_t x_208778;\n        \n        x_208778 = ((__global int64_t *) ext_mem_229373)[gtid_208769 *\n                                                         (defunc_0_f_res_203721 *\n                                                          n_p_203574) +\n                                                         gtid_208770 *\n                                                         defunc_0_f_res_203721 +\n                                                         gtid_208776];\n        \n        int64_t defunc_0_f_res_208779 = add64((int64_t) 1, x_208778);\n        \n        ((__local int64_t *) color_232090)[gtid_208776] = defunc_0_f_res_208779;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t min_arg_208780 = sub64(x_208774, (int64_t) 1);\n    int64_t min_arg_208781 = sub64(x_208774, min_res_203839);\n    int64_t min_res_208782 = smin64(q_s_203575, x_208774);\n    double i64_res_208783 = sitofp_i64_f64(x_208774);\n    double x_208784 = i64_res_203845 - i64_res_208783;\n    double max_arg_208785 = x_208784 / 2.0;\n    double max_res_208786 = fmax64(0.0, max_arg_208785);\n    int64_t gtid_208789 = sext_i32_i64(sext_i64_i32(ltid_pre_232766));\n    int32_t phys_tid_208790 = local_tid_232759;\n    \n    if (slt64(gtid_208789, s_n_m_203726)) {\n        bool cond_208792 = gtid",
                   "_208789 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_208793;\n        \n        if (cond_208792) {\n            defunc_0_m_fun_res_208793 = (int64_t) 0;\n        } else {\n            int64_t y_208794 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_208795 = gtid_208789 == y_208794;\n            int64_t defunc_0_m_fun_res_f_res_208796;\n            \n            if (cond_208795) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_208797 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_208796 =\n                    defunc_0_m_fun_res_f_res_t_res_208797;\n            } else {\n                int64_t x_208798 = sub64(gtid_208789, (int64_t) 1);\n                int64_t x_208799 = mul64(jump_s_203581, x_208798);\n                int64_t min_arg_208800 = add64((int64_t) 1, x_208799);\n                int64_t min_res_208801 = smin64(defunc_0_f_res_203721,\n                                                min_arg_208800);\n                \n                defunc_0_m_fun_res_f_res_208796 = min_res_208801;\n            }\n            defunc_0_m_fun_res_208793 = defunc_0_m_fun_res_f_res_208796;\n        }\n        \n        bool init_idx_208802;\n        int64_t init_idx_208803;\n        int64_t init_idx_208804;\n        bool loop_while_208805;\n        int64_t low_208806;\n        int64_t high_208807;\n        \n        loop_while_208805 = x_203809;\n        low_208806 = (int64_t) 0;\n        high_208807 = i_203808;\n        while (loop_while_208805) {\n            int64_t x_208808 = add64(low_208806, high_208807);\n            int64_t mid_208809 = sdiv64(x_208808, (int64_t) 2);\n            bool x_208810 = sle64((int64_t) 0, mid_208809);\n            bool y_208811 = slt64(mid_208809, defunc_0_f_res_203721);\n            bool bounds_check_208812 = x_208810 && y_208811;\n            bool index_certs_208813;\n            \n            if (!bounds_check_208812) {\n                {\n                    if (atomic_cmpxchg_i32_",
                   "global(global_failure, -1, 7) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_208809;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203721;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t mid_id_208814;\n            \n            mid_id_208814 = ((__local int64_t *) color_232090)[mid_208809];\n            \n            bool cond_208815 = slt64(mid_id_208814, (int64_t) 0);\n            int64_t mid_idx_208816;\n            \n            if (cond_208815) {\n                mid_idx_208816 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_208816 = mid_id_208814;\n            }\n            \n            bool cond_208817 = sle64(defunc_0_m_fun_res_208793, mid_idx_208816);\n            int64_t loopres_208818;\n            int64_t loopres_208819;\n            \n            if (cond_208817) {\n                int64_t loopres_t_res_208820 = sub64(mid_208809, (int64_t) 1);\n                \n                loopres_208818 = low_208806;\n                loopres_208819 = loopres_t_res_208820;\n            } else {\n                int64_t loopres_f_res_208821 = add64((int64_t) 1, mid_208809);\n                \n                loopres_208818 = loopres_f_res_208821;\n                loopres_208819 = high_208807;\n            }\n            \n            bool loop_cond_208822 = sle64(loopres_208818, loopres_208819);\n            bool loop_while_tmp_232773 = loop_cond_208822;\n            int64_t low_tmp_232774 = loopres_208818;\n            int64_t high_tmp_232775 = loopres_208819;\n            \n            loop_while_208805 = loop_while_tmp_232773;\n            low_208806 = low_tmp_232774;\n            high_208807 = high_tmp_232775;\n        }\n        init_idx_208802 = loop_while_208805;\n        init_idx_208803 = low_208806;\n        init_idx_208",
                   "804 = high_208807;\n        \n        bool idx_208823;\n        int64_t idx_208824;\n        int64_t idx_208825;\n        int64_t idx_208826;\n        bool loop_while_208827;\n        int64_t l_idx_208828;\n        int64_t r_idx_208829;\n        int64_t span_208830;\n        \n        loop_while_208827 = loop_cond_203844;\n        l_idx_208828 = init_idx_208803;\n        r_idx_208829 = init_idx_208803;\n        span_208830 = (int64_t) 1;\n        while (loop_while_208827) {\n            int64_t max_arg_208831 = sub64(l_idx_208828, (int64_t) 1);\n            int64_t max_res_208832 = smax64((int64_t) 0, max_arg_208831);\n            int64_t min_arg_208833 = add64((int64_t) 1, r_idx_208829);\n            int64_t min_res_208834 = smin64(min_arg_208780, min_arg_208833);\n            bool x_208835 = sle64((int64_t) 0, max_res_208832);\n            bool y_208836 = slt64(max_res_208832, defunc_0_f_res_203721);\n            bool bounds_check_208837 = x_208835 && y_208836;\n            bool index_certs_208838;\n            \n            if (!bounds_check_208837) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 8) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_208832;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203721;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t x_208839;\n            \n            x_208839 = ((__local int64_t *) color_232090)[max_res_208832];\n            \n            int64_t abs_arg_208840 = sub64(x_208839, defunc_0_m_fun_res_208793);\n            int64_t abs_res_208841 = abs64(abs_arg_208840);\n            bool x_208842 = sle64((int64_t) 0, min_res_208834);\n            bool y_208843 = slt64(min_res_208834, defunc_0_f_res_203721);\n            bool bounds_check_208844 = x_208842 && y_208843;\n     ",
                   "       bool index_certs_208845;\n            \n            if (!bounds_check_208844) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 9) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_208834;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203721;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t x_208846;\n            \n            x_208846 = ((__local int64_t *) color_232090)[min_res_208834];\n            \n            int64_t abs_arg_208847 = sub64(x_208846, defunc_0_m_fun_res_208793);\n            int64_t abs_res_208848 = abs64(abs_arg_208847);\n            bool cond_208849 = max_res_208832 == l_idx_208828;\n            int64_t loopres_208850;\n            int64_t loopres_208851;\n            int64_t loopres_208852;\n            \n            if (cond_208849) {\n                loopres_208850 = l_idx_208828;\n                loopres_208851 = r_idx_208829;\n                loopres_208852 = min_res_203839;\n            } else {\n                bool cond_208853 = slt64(abs_res_208841, abs_res_208848);\n                bool cond_f_res_208854 = min_res_208834 == r_idx_208829;\n                bool x_208855 = !cond_208853;\n                bool y_208856 = cond_f_res_208854 && x_208855;\n                bool cond_208857 = cond_208853 || y_208856;\n                int64_t loopres_f_res_208858;\n                \n                if (cond_208857) {\n                    loopres_f_res_208858 = max_res_208832;\n                } else {\n                    loopres_f_res_208858 = l_idx_208828;\n                }\n                \n                int64_t loopres_f_res_208859;\n                \n                if (cond_208857) {\n                    loopres_f_res_208859 = r_idx_208829;\n                } else {\n                ",
                   "    loopres_f_res_208859 = min_res_208834;\n                }\n                \n                int64_t loopres_f_res_208860;\n                \n                if (cond_208857) {\n                    int64_t loopres_f_res_t_res_208861 = add64((int64_t) 1,\n                                                               span_208830);\n                    \n                    loopres_f_res_208860 = loopres_f_res_t_res_208861;\n                } else {\n                    int64_t loopres_f_res_f_res_208862 = add64((int64_t) 1,\n                                                               span_208830);\n                    \n                    loopres_f_res_208860 = loopres_f_res_f_res_208862;\n                }\n                loopres_208850 = loopres_f_res_208858;\n                loopres_208851 = loopres_f_res_208859;\n                loopres_208852 = loopres_f_res_208860;\n            }\n            \n            bool loop_cond_208863 = slt64(loopres_208852, min_res_203839);\n            bool loop_while_tmp_232776 = loop_cond_208863;\n            int64_t l_idx_tmp_232777 = loopres_208850;\n            int64_t r_idx_tmp_232778 = loopres_208851;\n            int64_t span_tmp_232779 = loopres_208852;\n            \n            loop_while_208827 = loop_while_tmp_232776;\n            l_idx_208828 = l_idx_tmp_232777;\n            r_idx_208829 = r_idx_tmp_232778;\n            span_208830 = span_tmp_232779;\n        }\n        idx_208823 = loop_while_208827;\n        idx_208824 = l_idx_208828;\n        idx_208825 = r_idx_208829;\n        idx_208826 = span_208830;\n        \n        int64_t min_res_208864 = smin64(min_arg_208781, idx_208824);\n        int64_t max_res_208865 = smax64((int64_t) 0, min_res_208864);\n        int64_t defunc_0_m_fun_res_208866;\n        \n        if (cond_208792) {\n            defunc_0_m_fun_res_208866 = (int64_t) 0;\n        } else {\n            int64_t y_208867 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_208868 = gtid_208789 == y_208867;\n            int64_t defunc_0",
                   "_m_fun_res_f_res_208869;\n            \n            if (cond_208868) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_208870 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_208869 =\n                    defunc_0_m_fun_res_f_res_t_res_208870;\n            } else {\n                int64_t x_208871 = sub64(gtid_208789, (int64_t) 1);\n                int64_t x_208872 = mul64(jump_s_203581, x_208871);\n                int64_t min_arg_208873 = add64((int64_t) 1, x_208872);\n                int64_t min_res_208874 = smin64(defunc_0_f_res_203721,\n                                                min_arg_208873);\n                \n                defunc_0_m_fun_res_f_res_208869 = min_res_208874;\n            }\n            defunc_0_m_fun_res_208866 = defunc_0_m_fun_res_f_res_208869;\n        }\n        \n        int64_t x_208875 = add64(min_res_208782, max_res_208865);\n        int64_t r_208876 = sub64(x_208875, (int64_t) 1);\n        bool x_208877 = sle64((int64_t) 0, r_208876);\n        bool y_208878 = slt64(r_208876, defunc_0_f_res_203721);\n        bool bounds_check_208879 = x_208877 && y_208878;\n        bool index_certs_208880;\n        \n        if (!bounds_check_208879) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 10) == -1) {\n                    global_failure_args[0] = (int64_t) r_208876;\n                    global_failure_args[1] = (int64_t) defunc_0_f_res_203721;\n                    ;\n                }\n                local_failure = true;\n                goto error_1;\n            }\n        }\n        \n        int64_t x_208881;\n        \n        x_208881 = ((__local int64_t *) color_232090)[r_208876];\n        \n        int64_t abs_arg_208882 = sub64(x_208881, defunc_0_m_fun_res_208866);\n        int64_t abs_res_208883 = abs64(abs_arg_208882);\n        bool x_208884 = sle64((int64_t) 0, max_res_208865);\n        bool y_208885 = slt64(max_res_208865, defunc_0_f_res_203721);\n",
                   "        bool bounds_check_208886 = x_208884 && y_208885;\n        bool index_certs_208887;\n        \n        if (!bounds_check_208886) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 11) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_208865;\n                    global_failure_args[1] = (int64_t) defunc_0_f_res_203721;\n                    ;\n                }\n                local_failure = true;\n                goto error_1;\n            }\n        }\n        \n        int64_t x_208888;\n        \n        x_208888 = ((__local int64_t *) color_232090)[max_res_208865];\n        \n        int64_t abs_arg_208889 = sub64(x_208888, defunc_0_m_fun_res_208866);\n        int64_t abs_res_208890 = abs64(abs_arg_208889);\n        int64_t max_res_208891 = smax64(abs_res_208883, abs_res_208890);\n        double defunc_0_f_res_208892 = sitofp_i64_f64(max_res_208891);\n        double defunc_1_f_res_208893 = max_res_208786 + defunc_0_f_res_208892;\n        \n        ((__local double *) color_232089)[gtid_208789] = defunc_1_f_res_208893;\n        ((__local int64_t *) color_232088)[gtid_208789] = max_res_208865;\n    }\n    \n  error_1:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232780 = 0; i_232780 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_232759),\n                                                    computed_group_sizze_208757);\n         i_232780++) {\n        int64_t tmp_232781;\n        \n        tmp_232781 = ((__local int64_t *) color_232088)[i_232780 *\n                                                        computed_group_sizze_208757 +\n                                                        sext_i32_i64(local_tid_232759)];\n        ((__global int64_t *) mem_229428)[gtid_208769 * (s_n_m_203726 *\n                                                         n_p_203574) +\n                                         ",
                   " gtid_208770 * s_n_m_203726 +\n                                          (i_232780 *\n                                           computed_group_sizze_208757 +\n                                           sext_i32_i64(local_tid_232759))] =\n            tmp_232781;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232782 = 0; i_232782 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_232759),\n                                                    computed_group_sizze_208757);\n         i_232782++) {\n        double tmp_232783;\n        \n        tmp_232783 = ((__local double *) color_232089)[i_232782 *\n                                                       computed_group_sizze_208757 +\n                                                       sext_i32_i64(local_tid_232759)];\n        ((__global double *) mem_229433)[gtid_208769 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_208770 * s_n_m_203726 +\n                                         (i_232782 *\n                                          computed_group_sizze_208757 +\n                                          sext_i32_i64(local_tid_232759))] =\n            tmp_232783;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_209172(__global int *global_failure,\n                                             int failure_is_an_option, __global\n                                             int64_t *global_failure_args,\n                                             __local volatile\n                                             int64_t *color_232093_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *color_232092_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *color_232091_backing_",
                   "aligned_2,\n                                             int64_t n_203572,\n                                             int64_t q_l_203577,\n                                             int64_t jump_l_203583,\n                                             int64_t partition_sizze_203667,\n                                             int64_t l_n_m_203733,\n                                             int64_t i_203760,\n                                             unsigned char x_203761_bits,\n                                             int64_t min_res_203971,\n                                             unsigned char loop_cond_203976_bits,\n                                             double i64_res_203977,\n                                             int64_t computed_group_sizze_209063,\n                                             __global\n                                             unsigned char *ext_mem_229304,\n                                             __global\n                                             unsigned char *ext_mem_229305,\n                                             __global unsigned char *mem_229487,\n                                             __global unsigned char *mem_229491)\n{\n    bool x_203761 = x_203761_bits;\n    bool loop_cond_203976 = loop_cond_203976_bits;\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict color_232093_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) color_232093_backing_aligned_0;\n    __local volatile unsigned char *restrict color_232092_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_232092_backing_aligned_1;\n    __local volatile unsigned char *restrict color_232091_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232091_backin",
                   "g_aligned_2;\n    volatile __local bool local_failure;\n    \n    if (failure_is_an_option) {\n        int failed = *global_failure >= 0;\n        \n        if (failed)\n            return;\n    }\n    local_failure = false;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t global_tid_232827;\n    int32_t local_tid_232828;\n    int64_t group_sizze_232831;\n    int32_t wave_sizze_232830;\n    int32_t group_tid_232829;\n    \n    global_tid_232827 = get_global_id(0);\n    local_tid_232828 = get_local_id(0);\n    group_sizze_232831 = get_local_size(0);\n    wave_sizze_232830 = LOCKSTEP_WIDTH;\n    group_tid_232829 = get_group_id(0);\n    \n    int32_t phys_tid_209172 = group_tid_232829;\n    int64_t slice_232833 = n_203572;\n    int64_t ltid_pre_232832 = sext_i32_i64(local_tid_232828);\n    int64_t remnant_232834 = sext_i32_i64(local_tid_232828) - ltid_pre_232832;\n    int64_t slice_232836 = l_n_m_203733;\n    int64_t ltid_pre_232835 = sext_i32_i64(local_tid_232828);\n    int64_t remnant_232837 = sext_i32_i64(local_tid_232828) - ltid_pre_232835;\n    int64_t slice_232838 = partition_sizze_203667;\n    int64_t gtid_209171 = sext_i32_i64(group_tid_232829);\n    int64_t remnant_232839 = sext_i32_i64(group_tid_232829) - gtid_209171;\n    __local unsigned char *color_232091;\n    \n    color_232091 = (__local unsigned char *) color_232091_backing_0;\n    \n    __local unsigned char *color_232092;\n    \n    color_232092 = (__local unsigned char *) color_232092_backing_1;\n    \n    __local unsigned char *color_232093;\n    \n    color_232093 = (__local unsigned char *) color_232093_backing_2;\n    \n    int64_t x_209175;\n    \n    x_209175 = ((__global int64_t *) ext_mem_229304)[gtid_209171];\n    \n    int64_t gtid_209177 = sext_i32_i64(sext_i64_i32(ltid_pre_232832));\n    int32_t phys_tid_209178 = local_tid_232828;\n    \n    if (slt64(gtid_209177, n_203572)) {\n        int64_t x_209179;\n        \n        x_209179 = ((__global int64_t *) ext_mem_229305)[gtid_209171 *\n                                                      ",
                   "   n_203572 +\n                                                         gtid_209177];\n        \n        int64_t defunc_0_f_res_209180 = add64((int64_t) 1, x_209179);\n        \n        ((__local int64_t *) color_232093)[gtid_209177] = defunc_0_f_res_209180;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t min_arg_209181 = sub64(x_209175, (int64_t) 1);\n    int64_t min_arg_209182 = sub64(x_209175, min_res_203971);\n    int64_t min_res_209183 = smin64(q_l_203577, x_209175);\n    double i64_res_209184 = sitofp_i64_f64(x_209175);\n    double x_209185 = i64_res_203977 - i64_res_209184;\n    double max_arg_209186 = x_209185 / 2.0;\n    double max_res_209187 = fmax64(0.0, max_arg_209186);\n    int64_t gtid_209190 = sext_i32_i64(sext_i64_i32(ltid_pre_232835));\n    int32_t phys_tid_209191 = local_tid_232828;\n    \n    if (slt64(gtid_209190, l_n_m_203733)) {\n        int64_t min_arg_209193 = mul64(jump_l_203583, gtid_209190);\n        int64_t min_res_209194 = smin64(i_203760, min_arg_209193);\n        int64_t defunc_0_g_res_209195 = add64((int64_t) 1, min_res_209194);\n        bool init_idx_209196;\n        int64_t init_idx_209197;\n        int64_t init_idx_209198;\n        bool loop_while_209199;\n        int64_t low_209200;\n        int64_t high_209201;\n        \n        loop_while_209199 = x_203761;\n        low_209200 = (int64_t) 0;\n        high_209201 = i_203760;\n        while (loop_while_209199) {\n            int64_t x_209202 = add64(low_209200, high_209201);\n            int64_t mid_209203 = sdiv64(x_209202, (int64_t) 2);\n            bool x_209204 = sle64((int64_t) 0, mid_209203);\n            bool y_209205 = slt64(mid_209203, n_203572);\n            bool bounds_check_209206 = x_209204 && y_209205;\n            bool index_certs_209207;\n            \n            if (!bounds_check_209206) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 17) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_209203;\n       ",
                   "                 global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t mid_id_209208;\n            \n            mid_id_209208 = ((__local int64_t *) color_232093)[mid_209203];\n            \n            bool cond_209209 = slt64(mid_id_209208, (int64_t) 0);\n            int64_t mid_idx_209210;\n            \n            if (cond_209209) {\n                mid_idx_209210 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_209210 = mid_id_209208;\n            }\n            \n            bool cond_209211 = sle64(defunc_0_g_res_209195, mid_idx_209210);\n            int64_t loopres_209212;\n            int64_t loopres_209213;\n            \n            if (cond_209211) {\n                int64_t loopres_t_res_209214 = sub64(mid_209203, (int64_t) 1);\n                \n                loopres_209212 = low_209200;\n                loopres_209213 = loopres_t_res_209214;\n            } else {\n                int64_t loopres_f_res_209215 = add64((int64_t) 1, mid_209203);\n                \n                loopres_209212 = loopres_f_res_209215;\n                loopres_209213 = high_209201;\n            }\n            \n            bool loop_cond_209216 = sle64(loopres_209212, loopres_209213);\n            bool loop_while_tmp_232840 = loop_cond_209216;\n            int64_t low_tmp_232841 = loopres_209212;\n            int64_t high_tmp_232842 = loopres_209213;\n            \n            loop_while_209199 = loop_while_tmp_232840;\n            low_209200 = low_tmp_232841;\n            high_209201 = high_tmp_232842;\n        }\n        init_idx_209196 = loop_while_209199;\n        init_idx_209197 = low_209200;\n        init_idx_209198 = high_209201;\n        \n        bool idx_209217;\n        int64_t idx_209218;\n        int64_t idx_209219;\n        int64_t idx_209220;\n        bool loop_while_209221;\n        int64_t l",
                   "_idx_209222;\n        int64_t r_idx_209223;\n        int64_t span_209224;\n        \n        loop_while_209221 = loop_cond_203976;\n        l_idx_209222 = init_idx_209197;\n        r_idx_209223 = init_idx_209197;\n        span_209224 = (int64_t) 1;\n        while (loop_while_209221) {\n            int64_t max_arg_209225 = sub64(l_idx_209222, (int64_t) 1);\n            int64_t max_res_209226 = smax64((int64_t) 0, max_arg_209225);\n            int64_t min_arg_209227 = add64((int64_t) 1, r_idx_209223);\n            int64_t min_res_209228 = smin64(min_arg_209181, min_arg_209227);\n            bool x_209229 = sle64((int64_t) 0, max_res_209226);\n            bool y_209230 = slt64(max_res_209226, n_203572);\n            bool bounds_check_209231 = x_209229 && y_209230;\n            bool index_certs_209232;\n            \n            if (!bounds_check_209231) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 18) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_209226;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t x_209233;\n            \n            x_209233 = ((__local int64_t *) color_232093)[max_res_209226];\n            \n            int64_t abs_arg_209234 = sub64(x_209233, defunc_0_g_res_209195);\n            int64_t abs_res_209235 = abs64(abs_arg_209234);\n            bool x_209236 = sle64((int64_t) 0, min_res_209228);\n            bool y_209237 = slt64(min_res_209228, n_203572);\n            bool bounds_check_209238 = x_209236 && y_209237;\n            bool index_certs_209239;\n            \n            if (!bounds_check_209238) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 19) ==\n                        -1) {\n                        global_failure_args[0]",
                   " = (int64_t) min_res_209228;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t x_209240;\n            \n            x_209240 = ((__local int64_t *) color_232093)[min_res_209228];\n            \n            int64_t abs_arg_209241 = sub64(x_209240, defunc_0_g_res_209195);\n            int64_t abs_res_209242 = abs64(abs_arg_209241);\n            bool cond_209243 = max_res_209226 == l_idx_209222;\n            int64_t loopres_209244;\n            int64_t loopres_209245;\n            int64_t loopres_209246;\n            \n            if (cond_209243) {\n                loopres_209244 = l_idx_209222;\n                loopres_209245 = r_idx_209223;\n                loopres_209246 = min_res_203971;\n            } else {\n                bool cond_209247 = slt64(abs_res_209235, abs_res_209242);\n                bool cond_f_res_209248 = min_res_209228 == r_idx_209223;\n                bool x_209249 = !cond_209247;\n                bool y_209250 = cond_f_res_209248 && x_209249;\n                bool cond_209251 = cond_209247 || y_209250;\n                int64_t loopres_f_res_209252;\n                \n                if (cond_209251) {\n                    loopres_f_res_209252 = max_res_209226;\n                } else {\n                    loopres_f_res_209252 = l_idx_209222;\n                }\n                \n                int64_t loopres_f_res_209253;\n                \n                if (cond_209251) {\n                    loopres_f_res_209253 = r_idx_209223;\n                } else {\n                    loopres_f_res_209253 = min_res_209228;\n                }\n                \n                int64_t loopres_f_res_209254;\n                \n                if (cond_209251) {\n                    int64_t loopres_f_res_t_res_209255 = add64((int64_t) 1,\n                                                ",
                   "               span_209224);\n                    \n                    loopres_f_res_209254 = loopres_f_res_t_res_209255;\n                } else {\n                    int64_t loopres_f_res_f_res_209256 = add64((int64_t) 1,\n                                                               span_209224);\n                    \n                    loopres_f_res_209254 = loopres_f_res_f_res_209256;\n                }\n                loopres_209244 = loopres_f_res_209252;\n                loopres_209245 = loopres_f_res_209253;\n                loopres_209246 = loopres_f_res_209254;\n            }\n            \n            bool loop_cond_209257 = slt64(loopres_209246, min_res_203971);\n            bool loop_while_tmp_232843 = loop_cond_209257;\n            int64_t l_idx_tmp_232844 = loopres_209244;\n            int64_t r_idx_tmp_232845 = loopres_209245;\n            int64_t span_tmp_232846 = loopres_209246;\n            \n            loop_while_209221 = loop_while_tmp_232843;\n            l_idx_209222 = l_idx_tmp_232844;\n            r_idx_209223 = r_idx_tmp_232845;\n            span_209224 = span_tmp_232846;\n        }\n        idx_209217 = loop_while_209221;\n        idx_209218 = l_idx_209222;\n        idx_209219 = r_idx_209223;\n        idx_209220 = span_209224;\n        \n        int64_t min_res_209258 = smin64(min_arg_209182, idx_209218);\n        int64_t max_res_209259 = smax64((int64_t) 0, min_res_209258);\n        int64_t x_209260 = add64(min_res_209183, max_res_209259);\n        int64_t r_209261 = sub64(x_209260, (int64_t) 1);\n        bool x_209262 = sle64((int64_t) 0, r_209261);\n        bool y_209263 = slt64(r_209261, n_203572);\n        bool bounds_check_209264 = x_209262 && y_209263;\n        bool index_certs_209265;\n        \n        if (!bounds_check_209264) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 20) == -1) {\n                    global_failure_args[0] = (int64_t) r_209261;\n                    global_failure_args[1] = (int64_t) n_203572;\n            ",
                   "        ;\n                }\n                local_failure = true;\n                goto error_1;\n            }\n        }\n        \n        int64_t x_209266;\n        \n        x_209266 = ((__global int64_t *) ext_mem_229305)[gtid_209171 *\n                                                         n_203572 + r_209261];\n        \n        int64_t abs_arg_209267 = sub64(x_209266, min_res_209194);\n        int64_t abs_res_209268 = abs64(abs_arg_209267);\n        bool x_209269 = sle64((int64_t) 0, max_res_209259);\n        bool y_209270 = slt64(max_res_209259, n_203572);\n        bool bounds_check_209271 = x_209269 && y_209270;\n        bool index_certs_209272;\n        \n        if (!bounds_check_209271) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 21) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_209259;\n                    global_failure_args[1] = (int64_t) n_203572;\n                    ;\n                }\n                local_failure = true;\n                goto error_1;\n            }\n        }\n        \n        int64_t x_209273;\n        \n        x_209273 = ((__global int64_t *) ext_mem_229305)[gtid_209171 *\n                                                         n_203572 +\n                                                         max_res_209259];\n        \n        int64_t abs_arg_209274 = sub64(x_209273, min_res_209194);\n        int64_t abs_res_209275 = abs64(abs_arg_209274);\n        int64_t max_res_209276 = smax64(abs_res_209268, abs_res_209275);\n        double defunc_0_f_res_209277 = sitofp_i64_f64(max_res_209276);\n        double defunc_1_f_res_209278 = max_res_209187 + defunc_0_f_res_209277;\n        \n        ((__local double *) color_232092)[gtid_209190] = defunc_1_f_res_209278;\n        ((__local int64_t *) color_232091)[gtid_209190] = max_res_209259;\n    }\n    \n  error_1:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232847 = 0; i_232847",
                   " < sdiv_up64(l_n_m_203733 -\n                                                    sext_i32_i64(local_tid_232828),\n                                                    computed_group_sizze_209063);\n         i_232847++) {\n        int64_t tmp_232848;\n        \n        tmp_232848 = ((__local int64_t *) color_232091)[i_232847 *\n                                                        computed_group_sizze_209063 +\n                                                        sext_i32_i64(local_tid_232828)];\n        ((__global int64_t *) mem_229487)[gtid_209171 * l_n_m_203733 +\n                                          (i_232847 *\n                                           computed_group_sizze_209063 +\n                                           sext_i32_i64(local_tid_232828))] =\n            tmp_232848;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232849 = 0; i_232849 < sdiv_up64(l_n_m_203733 -\n                                                    sext_i32_i64(local_tid_232828),\n                                                    computed_group_sizze_209063);\n         i_232849++) {\n        double tmp_232850;\n        \n        tmp_232850 = ((__local double *) color_232092)[i_232849 *\n                                                       computed_group_sizze_209063 +\n                                                       sext_i32_i64(local_tid_232828)];\n        ((__global double *) mem_229491)[gtid_209171 * l_n_m_203733 +\n                                         (i_232849 *\n                                          computed_group_sizze_209063 +\n                                          sext_i32_i64(local_tid_232828))] =\n            tmp_232850;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_209798(__global int *global_failure,\n                                             int failure_is_an_option, __global\n                                             int64_t *global_failure_args,\n                                     ",
                   "        __local volatile\n                                             int64_t *color_232096_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *color_232095_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *color_232094_backing_aligned_2,\n                                             int64_t n_203572,\n                                             int64_t q_t_203576,\n                                             int64_t jump_t_203582,\n                                             int64_t partition_sizze_203667,\n                                             int64_t t_n_m_203740,\n                                             int64_t i_203760,\n                                             unsigned char x_203761_bits,\n                                             int64_t min_res_204083,\n                                             unsigned char loop_cond_204088_bits,\n                                             double i64_res_204089,\n                                             int64_t computed_group_sizze_209689,\n                                             __global\n                                             unsigned char *ext_mem_229304,\n                                             __global\n                                             unsigned char *ext_mem_229305,\n                                             __global unsigned char *mem_229536,\n                                             __global unsigned char *mem_229540)\n{\n    bool x_203761 = x_203761_bits;\n    bool loop_cond_204088 = loop_cond_204088_bits;\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict color_232096_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) color_232096_backing_aligned_0;\n    __l",
                   "ocal volatile unsigned char *restrict color_232095_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_232095_backing_aligned_1;\n    __local volatile unsigned char *restrict color_232094_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232094_backing_aligned_2;\n    volatile __local bool local_failure;\n    \n    if (failure_is_an_option) {\n        int failed = *global_failure >= 0;\n        \n        if (failed)\n            return;\n    }\n    local_failure = false;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t global_tid_232887;\n    int32_t local_tid_232888;\n    int64_t group_sizze_232891;\n    int32_t wave_sizze_232890;\n    int32_t group_tid_232889;\n    \n    global_tid_232887 = get_global_id(0);\n    local_tid_232888 = get_local_id(0);\n    group_sizze_232891 = get_local_size(0);\n    wave_sizze_232890 = LOCKSTEP_WIDTH;\n    group_tid_232889 = get_group_id(0);\n    \n    int32_t phys_tid_209798 = group_tid_232889;\n    int64_t slice_232893 = n_203572;\n    int64_t ltid_pre_232892 = sext_i32_i64(local_tid_232888);\n    int64_t remnant_232894 = sext_i32_i64(local_tid_232888) - ltid_pre_232892;\n    int64_t slice_232896 = t_n_m_203740;\n    int64_t ltid_pre_232895 = sext_i32_i64(local_tid_232888);\n    int64_t remnant_232897 = sext_i32_i64(local_tid_232888) - ltid_pre_232895;\n    int64_t slice_232898 = partition_sizze_203667;\n    int64_t gtid_209797 = sext_i32_i64(group_tid_232889);\n    int64_t remnant_232899 = sext_i32_i64(group_tid_232889) - gtid_209797;\n    __local unsigned char *color_232094;\n    \n    color_232094 = (__local unsigned char *) color_232094_backing_0;\n    \n    __local unsigned char *color_232095;\n    \n    color_232095 = (__local unsigned char *) color_232095_backing_1;\n    \n    __local unsigned char *color_232096;\n    \n    color_232096 = (__local unsigned char *) color_232096_backing_2;\n    \n    int64_t x_209801;\n    \n",
                   "    x_209801 = ((__global int64_t *) ext_mem_229304)[gtid_209797];\n    \n    int64_t gtid_209803 = sext_i32_i64(sext_i64_i32(ltid_pre_232892));\n    int32_t phys_tid_209804 = local_tid_232888;\n    \n    if (slt64(gtid_209803, n_203572)) {\n        int64_t x_209805;\n        \n        x_209805 = ((__global int64_t *) ext_mem_229305)[gtid_209797 *\n                                                         n_203572 +\n                                                         gtid_209803];\n        \n        int64_t defunc_0_f_res_209806 = add64((int64_t) 1, x_209805);\n        \n        ((__local int64_t *) color_232096)[gtid_209803] = defunc_0_f_res_209806;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t min_arg_209807 = sub64(x_209801, (int64_t) 1);\n    int64_t min_arg_209808 = sub64(x_209801, min_res_204083);\n    int64_t min_res_209809 = smin64(q_t_203576, x_209801);\n    double i64_res_209810 = sitofp_i64_f64(x_209801);\n    double x_209811 = i64_res_204089 - i64_res_209810;\n    double max_arg_209812 = x_209811 / 2.0;\n    double max_res_209813 = fmax64(0.0, max_arg_209812);\n    int64_t gtid_209816 = sext_i32_i64(sext_i64_i32(ltid_pre_232895));\n    int32_t phys_tid_209817 = local_tid_232888;\n    \n    if (slt64(gtid_209816, t_n_m_203740)) {\n        int64_t min_arg_209819 = mul64(jump_t_203582, gtid_209816);\n        int64_t min_res_209820 = smin64(i_203760, min_arg_209819);\n        int64_t defunc_0_g_res_209821 = add64((int64_t) 1, min_res_209820);\n        bool init_idx_209822;\n        int64_t init_idx_209823;\n        int64_t init_idx_209824;\n        bool loop_while_209825;\n        int64_t low_209826;\n        int64_t high_209827;\n        \n        loop_while_209825 = x_203761;\n        low_209826 = (int64_t) 0;\n        high_209827 = i_203760;\n        while (loop_while_209825) {\n            int64_t x_209828 = add64(low_209826, high_209827);\n            int64_t mid_209829 = sdiv64(x_209828, (int64_t) 2);\n            bool x_209830 = sle64((int64_t) 0, mid_209829);\n            boo",
                   "l y_209831 = slt64(mid_209829, n_203572);\n            bool bounds_check_209832 = x_209830 && y_209831;\n            bool index_certs_209833;\n            \n            if (!bounds_check_209832) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 27) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_209829;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t mid_id_209834;\n            \n            mid_id_209834 = ((__local int64_t *) color_232096)[mid_209829];\n            \n            bool cond_209835 = slt64(mid_id_209834, (int64_t) 0);\n            int64_t mid_idx_209836;\n            \n            if (cond_209835) {\n                mid_idx_209836 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_209836 = mid_id_209834;\n            }\n            \n            bool cond_209837 = sle64(defunc_0_g_res_209821, mid_idx_209836);\n            int64_t loopres_209838;\n            int64_t loopres_209839;\n            \n            if (cond_209837) {\n                int64_t loopres_t_res_209840 = sub64(mid_209829, (int64_t) 1);\n                \n                loopres_209838 = low_209826;\n                loopres_209839 = loopres_t_res_209840;\n            } else {\n                int64_t loopres_f_res_209841 = add64((int64_t) 1, mid_209829);\n                \n                loopres_209838 = loopres_f_res_209841;\n                loopres_209839 = high_209827;\n            }\n            \n            bool loop_cond_209842 = sle64(loopres_209838, loopres_209839);\n            bool loop_while_tmp_232900 = loop_cond_209842;\n            int64_t low_tmp_232901 = loopres_209838;\n            int64_t high_tmp_232902 = loopres_209839;\n            \n            loop_while_209825 = loop_while",
                   "_tmp_232900;\n            low_209826 = low_tmp_232901;\n            high_209827 = high_tmp_232902;\n        }\n        init_idx_209822 = loop_while_209825;\n        init_idx_209823 = low_209826;\n        init_idx_209824 = high_209827;\n        \n        bool idx_209843;\n        int64_t idx_209844;\n        int64_t idx_209845;\n        int64_t idx_209846;\n        bool loop_while_209847;\n        int64_t l_idx_209848;\n        int64_t r_idx_209849;\n        int64_t span_209850;\n        \n        loop_while_209847 = loop_cond_204088;\n        l_idx_209848 = init_idx_209823;\n        r_idx_209849 = init_idx_209823;\n        span_209850 = (int64_t) 1;\n        while (loop_while_209847) {\n            int64_t max_arg_209851 = sub64(l_idx_209848, (int64_t) 1);\n            int64_t max_res_209852 = smax64((int64_t) 0, max_arg_209851);\n            int64_t min_arg_209853 = add64((int64_t) 1, r_idx_209849);\n            int64_t min_res_209854 = smin64(min_arg_209807, min_arg_209853);\n            bool x_209855 = sle64((int64_t) 0, max_res_209852);\n            bool y_209856 = slt64(max_res_209852, n_203572);\n            bool bounds_check_209857 = x_209855 && y_209856;\n            bool index_certs_209858;\n            \n            if (!bounds_check_209857) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 28) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_209852;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t x_209859;\n            \n            x_209859 = ((__local int64_t *) color_232096)[max_res_209852];\n            \n            int64_t abs_arg_209860 = sub64(x_209859, defunc_0_g_res_209821);\n            int64_t abs_res_209861 = abs64(abs_arg_209860);\n            bool x_209862 = sle64((int64_t) 0, min_",
                   "res_209854);\n            bool y_209863 = slt64(min_res_209854, n_203572);\n            bool bounds_check_209864 = x_209862 && y_209863;\n            bool index_certs_209865;\n            \n            if (!bounds_check_209864) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 29) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_209854;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t x_209866;\n            \n            x_209866 = ((__local int64_t *) color_232096)[min_res_209854];\n            \n            int64_t abs_arg_209867 = sub64(x_209866, defunc_0_g_res_209821);\n            int64_t abs_res_209868 = abs64(abs_arg_209867);\n            bool cond_209869 = max_res_209852 == l_idx_209848;\n            int64_t loopres_209870;\n            int64_t loopres_209871;\n            int64_t loopres_209872;\n            \n            if (cond_209869) {\n                loopres_209870 = l_idx_209848;\n                loopres_209871 = r_idx_209849;\n                loopres_209872 = min_res_204083;\n            } else {\n                bool cond_209873 = slt64(abs_res_209861, abs_res_209868);\n                bool cond_f_res_209874 = min_res_209854 == r_idx_209849;\n                bool x_209875 = !cond_209873;\n                bool y_209876 = cond_f_res_209874 && x_209875;\n                bool cond_209877 = cond_209873 || y_209876;\n                int64_t loopres_f_res_209878;\n                \n                if (cond_209877) {\n                    loopres_f_res_209878 = max_res_209852;\n                } else {\n                    loopres_f_res_209878 = l_idx_209848;\n                }\n                \n                int64_t loopres_f_res_209879;\n                \n                if (cond_209877) {\n  ",
                   "                  loopres_f_res_209879 = r_idx_209849;\n                } else {\n                    loopres_f_res_209879 = min_res_209854;\n                }\n                \n                int64_t loopres_f_res_209880;\n                \n                if (cond_209877) {\n                    int64_t loopres_f_res_t_res_209881 = add64((int64_t) 1,\n                                                               span_209850);\n                    \n                    loopres_f_res_209880 = loopres_f_res_t_res_209881;\n                } else {\n                    int64_t loopres_f_res_f_res_209882 = add64((int64_t) 1,\n                                                               span_209850);\n                    \n                    loopres_f_res_209880 = loopres_f_res_f_res_209882;\n                }\n                loopres_209870 = loopres_f_res_209878;\n                loopres_209871 = loopres_f_res_209879;\n                loopres_209872 = loopres_f_res_209880;\n            }\n            \n            bool loop_cond_209883 = slt64(loopres_209872, min_res_204083);\n            bool loop_while_tmp_232903 = loop_cond_209883;\n            int64_t l_idx_tmp_232904 = loopres_209870;\n            int64_t r_idx_tmp_232905 = loopres_209871;\n            int64_t span_tmp_232906 = loopres_209872;\n            \n            loop_while_209847 = loop_while_tmp_232903;\n            l_idx_209848 = l_idx_tmp_232904;\n            r_idx_209849 = r_idx_tmp_232905;\n            span_209850 = span_tmp_232906;\n        }\n        idx_209843 = loop_while_209847;\n        idx_209844 = l_idx_209848;\n        idx_209845 = r_idx_209849;\n        idx_209846 = span_209850;\n        \n        int64_t min_res_209884 = smin64(min_arg_209808, idx_209844);\n        int64_t max_res_209885 = smax64((int64_t) 0, min_res_209884);\n        int64_t x_209886 = add64(min_res_209809, max_res_209885);\n        int64_t r_209887 = sub64(x_209886, (int64_t) 1);\n        bool x_209888 = sle64((int64_t) 0, r_209887);\n        bool y_209889 = s",
                   "lt64(r_209887, n_203572);\n        bool bounds_check_209890 = x_209888 && y_209889;\n        bool index_certs_209891;\n        \n        if (!bounds_check_209890) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 30) == -1) {\n                    global_failure_args[0] = (int64_t) r_209887;\n                    global_failure_args[1] = (int64_t) n_203572;\n                    ;\n                }\n                local_failure = true;\n                goto error_1;\n            }\n        }\n        \n        int64_t x_209892;\n        \n        x_209892 = ((__global int64_t *) ext_mem_229305)[gtid_209797 *\n                                                         n_203572 + r_209887];\n        \n        int64_t abs_arg_209893 = sub64(x_209892, min_res_209820);\n        int64_t abs_res_209894 = abs64(abs_arg_209893);\n        bool x_209895 = sle64((int64_t) 0, max_res_209885);\n        bool y_209896 = slt64(max_res_209885, n_203572);\n        bool bounds_check_209897 = x_209895 && y_209896;\n        bool index_certs_209898;\n        \n        if (!bounds_check_209897) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 31) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_209885;\n                    global_failure_args[1] = (int64_t) n_203572;\n                    ;\n                }\n                local_failure = true;\n                goto error_1;\n            }\n        }\n        \n        int64_t x_209899;\n        \n        x_209899 = ((__global int64_t *) ext_mem_229305)[gtid_209797 *\n                                                         n_203572 +\n                                                         max_res_209885];\n        \n        int64_t abs_arg_209900 = sub64(x_209899, min_res_209820);\n        int64_t abs_res_209901 = abs64(abs_arg_209900);\n        int64_t max_res_209902 = smax64(abs_res_209894, abs_res_209901);\n        double defunc_0_f_res_209903 = sitofp_i64_f64(max_res_209902);\n        double",
                   " defunc_1_f_res_209904 = max_res_209813 + defunc_0_f_res_209903;\n        \n        ((__local double *) color_232095)[gtid_209816] = defunc_1_f_res_209904;\n        ((__local int64_t *) color_232094)[gtid_209816] = max_res_209885;\n    }\n    \n  error_1:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232907 = 0; i_232907 < sdiv_up64(t_n_m_203740 -\n                                                    sext_i32_i64(local_tid_232888),\n                                                    computed_group_sizze_209689);\n         i_232907++) {\n        int64_t tmp_232908;\n        \n        tmp_232908 = ((__local int64_t *) color_232094)[i_232907 *\n                                                        computed_group_sizze_209689 +\n                                                        sext_i32_i64(local_tid_232888)];\n        ((__global int64_t *) mem_229536)[gtid_209797 * t_n_m_203740 +\n                                          (i_232907 *\n                                           computed_group_sizze_209689 +\n                                           sext_i32_i64(local_tid_232888))] =\n            tmp_232908;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232909 = 0; i_232909 < sdiv_up64(t_n_m_203740 -\n                                                    sext_i32_i64(local_tid_232888),\n                                                    computed_group_sizze_209689);\n         i_232909++) {\n        double tmp_232910;\n        \n        tmp_232910 = ((__local double *) color_232095)[i_232909 *\n                                                       computed_group_sizze_209689 +\n                                                       sext_i32_i64(local_tid_232888)];\n        ((__global double *) mem_229540)[gtid_209797 * t_n_m_203740 +\n                                         (i_232909 *\n                                          computed_group_sizze_209689 +\n                                          ",
                   "sext_i32_i64(local_tid_232888))] =\n            tmp_232910;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_211858(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *red_arr_mem_233084_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *red_arr_mem_233066_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *color_232102_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *color_232101_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *color_232100_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *color_232099_backing_aligned_5,\n                                             int64_t n_p_203574,\n                                             int64_t q_s_203575,\n                                             int64_t jump_s_203581,\n                                             int64_t partition_sizze_203667,\n                                             int64_t defunc_0_f_res_203721,\n                                             int64_t pad_css_len_203722,\n                                             int64_t s_n_m_203726,\n                                             int64_t computed_group_sizze_211760,\n                                             __global\n                                             unsigned char *ext_mem_229372,\n                                             __global\n                                             unsigned char *ext_mem_229373,\n                                             __global\n         ",
                   "                                    unsigned char *ext_mem_229470,\n                                             __global\n                                             unsigned char *ext_mem_229471,\n                                             __global unsigned char *mem_229634,\n                                             __global unsigned char *mem_229639,\n                                             __global unsigned char *mem_229783)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_233084_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233084_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_233066_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233066_backing_aligned_1;\n    __local volatile unsigned char *restrict color_232102_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) color_232102_backing_aligned_2;\n    __local volatile unsigned char *restrict color_232101_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) color_232101_backing_aligned_3;\n    __local volatile unsigned char *restrict color_232100_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_232100_backing_aligned_4;\n    __local volatile unsigned char *restrict color_232099_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232099_backing_aligned_5;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233048;\n    int32_t local_tid_233049;\n    int64_t group_sizze_233052;\n    int32_t wave_sizze_233051;\n    int32_t grou",
                   "p_tid_233050;\n    \n    global_tid_233048 = get_global_id(0);\n    local_tid_233049 = get_local_id(0);\n    group_sizze_233052 = get_local_size(0);\n    wave_sizze_233051 = LOCKSTEP_WIDTH;\n    group_tid_233050 = get_group_id(0);\n    \n    int32_t phys_tid_211858 = group_tid_233050;\n    int64_t slice_233054 = s_n_m_203726;\n    int64_t ltid_pre_233053 = sext_i32_i64(local_tid_233049);\n    int64_t remnant_233055 = sext_i32_i64(local_tid_233049) - ltid_pre_233053;\n    int64_t slice_233058 = q_s_203575;\n    int64_t slice_233059 = s_n_m_203726 * slice_233058;\n    int64_t ltid_pre_233056 = squot64(sext_i32_i64(local_tid_233049),\n                                      slice_233058);\n    int64_t remnant_233060 = sext_i32_i64(local_tid_233049) - ltid_pre_233056 *\n            slice_233058;\n    int64_t ltid_pre_233057 = remnant_233060;\n    int64_t remnant_233061 = remnant_233060 - ltid_pre_233057;\n    int64_t slice_233062 = n_p_203574;\n    int64_t slice_233063 = partition_sizze_203667 * slice_233062;\n    int64_t gtid_211856 = squot64(sext_i32_i64(group_tid_233050), slice_233062);\n    int64_t remnant_233064 = sext_i32_i64(group_tid_233050) - gtid_211856 *\n            slice_233062;\n    int64_t gtid_211857 = remnant_233064;\n    int64_t remnant_233065 = remnant_233064 - gtid_211857;\n    __local unsigned char *color_232099;\n    \n    color_232099 = (__local unsigned char *) color_232099_backing_0;\n    \n    __local unsigned char *color_232100;\n    \n    color_232100 = (__local unsigned char *) color_232100_backing_1;\n    \n    __local unsigned char *color_232101;\n    \n    color_232101 = (__local unsigned char *) color_232101_backing_2;\n    \n    __local unsigned char *color_232102;\n    \n    color_232102 = (__local unsigned char *) color_232102_backing_3;\n    \n    int64_t x_211865;\n    \n    x_211865 = ((__global int64_t *) ext_mem_229372)[gtid_211856 * n_p_203574 +\n                                                     gtid_211857];\n    \n    int64_t gtid_211872 = sext_i32_i64(sext_i64_i32(ltid_pr",
                   "e_233053));\n    int32_t phys_tid_211873 = local_tid_233049;\n    \n    if (slt64(gtid_211872, s_n_m_203726)) {\n        bool cond_211875 = gtid_211872 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_211876;\n        \n        if (cond_211875) {\n            defunc_0_m_fun_res_211876 = (int64_t) 0;\n        } else {\n            int64_t y_211877 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_211878 = gtid_211872 == y_211877;\n            int64_t defunc_0_m_fun_res_f_res_211879;\n            \n            if (cond_211878) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_211880 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_211879 =\n                    defunc_0_m_fun_res_f_res_t_res_211880;\n            } else {\n                int64_t x_211881 = sub64(gtid_211872, (int64_t) 1);\n                int64_t x_211882 = mul64(jump_s_203581, x_211881);\n                int64_t min_arg_211883 = add64((int64_t) 1, x_211882);\n                int64_t min_res_211884 = smin64(defunc_0_f_res_203721,\n                                                min_arg_211883);\n                \n                defunc_0_m_fun_res_f_res_211879 = min_res_211884;\n            }\n            defunc_0_m_fun_res_211876 = defunc_0_m_fun_res_f_res_211879;\n        }\n        ((__local int64_t *) color_232100)[gtid_211872] =\n            defunc_0_m_fun_res_211876;\n        ((__local bool *) color_232102)[gtid_211872] = cond_211875;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_211886 = sext_i32_i64(sext_i64_i32(ltid_pre_233056));\n    int64_t gtid_211887 = sext_i32_i64(sext_i64_i32(ltid_pre_233057));\n    int32_t phys_tid_211888 = local_tid_233049;\n    __local unsigned char *red_arr_mem_233066;\n    \n    red_arr_mem_233066 = (__local unsigned char *) red_arr_mem_233066_backing_4;\n    if (slt64(gtid_211886, s_n_m_203726) && slt64(gtid_211887, q_s_203575)) {\n        int64_t x_211892;\n        \n        x_211892 = ((__glo",
                   "bal int64_t *) ext_mem_229471)[gtid_211856 *\n                                                         (s_n_m_203726 *\n                                                          n_p_203574) +\n                                                         gtid_211857 *\n                                                         s_n_m_203726 +\n                                                         gtid_211886];\n        \n        double x_211893;\n        \n        x_211893 = ((__global double *) ext_mem_229470)[gtid_211856 *\n                                                        (s_n_m_203726 *\n                                                         n_p_203574) +\n                                                        gtid_211857 *\n                                                        s_n_m_203726 +\n                                                        gtid_211886];\n        \n        int64_t defunc_0_m_fun_res_211894;\n        \n        defunc_0_m_fun_res_211894 = ((__local\n                                      int64_t *) color_232100)[gtid_211886];\n        \n        bool cond_211896 = sle64(x_211865, gtid_211887);\n        int64_t defunc_0_f_res_211897;\n        \n        if (cond_211896) {\n            defunc_0_f_res_211897 = (int64_t) 0;\n        } else {\n            int64_t i_211898 = add64(gtid_211887, x_211892);\n            int64_t defunc_0_add_arg_211899;\n            \n            defunc_0_add_arg_211899 = ((__global\n                                        int64_t *) ext_mem_229373)[gtid_211856 *\n                                                                   (defunc_0_f_res_203721 *\n                                                                    n_p_203574) +\n                                                                   gtid_211857 *\n                                                                   defunc_0_f_res_203721 +\n                                                                   i_211898];\n            \n            int64_t defunc_1_add_res_211900 = add64(",
                   "(int64_t) 1,\n                                                    defunc_0_add_arg_211899);\n            \n            defunc_0_f_res_211897 = defunc_1_add_res_211900;\n        }\n        \n        double defunc_0_f_res_211901;\n        \n        if (cond_211896) {\n            defunc_0_f_res_211901 = 0.0;\n        } else {\n            int64_t i_211902 = add64(gtid_211887, x_211892);\n            double defunc_0_add_arg_211903;\n            \n            defunc_0_add_arg_211903 = ((__global\n                                        double *) mem_229639)[gtid_211856 *\n                                                              (defunc_0_f_res_203721 *\n                                                               n_p_203574) +\n                                                              gtid_211857 *\n                                                              defunc_0_f_res_203721 +\n                                                              i_211902];\n            defunc_0_f_res_211901 = defunc_0_add_arg_211903;\n        }\n        \n        int64_t binop_p_211904 = sub64(defunc_0_f_res_211897,\n                                       defunc_0_m_fun_res_211894);\n        double defunc_0_f_res_211905 = sitofp_i64_f64(binop_p_211904);\n        double abs_res_211906 = fabs(defunc_0_f_res_211905);\n        double tmp1_211907 = abs_res_211906 / x_211893;\n        double x_211908 = tmp1_211907 * tmp1_211907;\n        double y_211909 = tmp1_211907 * x_211908;\n        double tmp2_211910 = 1.0 - y_211909;\n        double x_211911 = tmp2_211910 * tmp2_211910;\n        double tmp3_211912 = tmp2_211910 * x_211911;\n        double w_j_211913 = defunc_0_f_res_211901 * tmp3_211912;\n        \n        ((__local double *) red_arr_mem_233066)[gtid_211886 * q_s_203575 +\n                                                gtid_211887] = w_j_211913;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_233068 = s_n_m_203726 * q_s_203575;\n    double x_211889;\n    double x_211890;\n    double x_233070;\n ",
                   "   double x_233071;\n    bool ltid_in_bounds_233073 = slt64(sext_i32_i64(local_tid_233049),\n                                       s_n_m_203726 * q_s_203575);\n    int32_t skip_threads_233074;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_233073) {\n            x_211890 = ((volatile __local\n                         double *) red_arr_mem_233066)[sext_i32_i64(local_tid_233049)];\n            if ((local_tid_233049 - squot32(local_tid_233049, 32) * 32) == 0) {\n                x_211889 = x_211890;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_233074 = 1;\n        while (slt32(skip_threads_233074, 32)) {\n            bool thread_active_233075 = sle32(skip_threads_233074,\n                                              local_tid_233049 -\n                                              squot32(local_tid_233049, 32) *\n                                              32) && ltid_in_bounds_233073;\n            \n            if (thread_active_233075) {\n                // read operands\n                {\n                    x_211889 = ((volatile __local\n                                 double *) red_arr_mem_233066)[sext_i32_i64(local_tid_233049) -\n                                                               sext_i32_i64(skip_threads_233074)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_233076 =\n                     slt64(srem64(sext_i32_i64(local_tid_233049), q_s_203575),\n                           sext_i32_i64(local_tid_233049) -\n                           sext_i32_i64(local_tid_233049 -\n                           skip_threads_233074));\n                \n                if (thread_active_233075 && inactive_233076) {\n                    x_211889 = x_211890;\n                }\n                if (thread_active_233075) {\n                    if (!inactive_233076) {\n                        double defunc_1_op_res_211891 = x_211889 + x_211890;\n   ",
                   "                     \n                        x_211889 = defunc_1_op_res_211891;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_233051, skip_threads_233074)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_233075) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233066)[sext_i32_i64(local_tid_233049)] =\n                        x_211889;\n                    x_211890 = x_211889;\n                }\n            }\n            if (sle32(wave_sizze_233051, skip_threads_233074)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_233074 *= 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_233049 - squot32(local_tid_233049, 32) * 32) == 31 &&\n            ltid_in_bounds_233073) {\n            ((volatile __local\n              double *) red_arr_mem_233066)[sext_i32_i64(squot32(local_tid_233049,\n                                                                 32))] =\n                x_211889;\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_233077;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_233049, 32) == 0 && ltid_in_bounds_233073) {\n                x_233071 = ((volatile __local\n                             double *) red_arr_mem_233066)[sext_i32_i64(local_tid_233049)];\n                if ((local_tid_233049 - squot32(local_tid_233049, 32) * 32) ==\n                    0) {\n                    x_233070 = x_233071;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_233077 = 1;\n            while (slt32(skip_threads_233077, 32)) {\n          ",
                   "      bool thread_active_233078 = sle32(skip_threads_233077,\n                                                  local_tid_233049 -\n                                                  squot32(local_tid_233049,\n                                                          32) * 32) &&\n                     (squot32(local_tid_233049, 32) == 0 &&\n                      ltid_in_bounds_233073);\n                \n                if (thread_active_233078) {\n                    // read operands\n                    {\n                        x_233070 = ((volatile __local\n                                     double *) red_arr_mem_233066)[sext_i32_i64(local_tid_233049) -\n                                                                   sext_i32_i64(skip_threads_233077)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_233079 =\n                         slt64(srem64(sext_i32_i64(local_tid_233049 * 32 + 32 -\n                                      1), q_s_203575),\n                               sext_i32_i64(local_tid_233049 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_233049 -\n                                             skip_threads_233077) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_233078 && inactive_233079) {\n                        x_233070 = x_233071;\n                    }\n                    if (thread_active_233078) {\n                        if (!inactive_233079) {\n                            double defunc_1_op_res_233072 = x_233070 + x_233071;\n                            \n                            x_233070 = defunc_1_op_res_233072;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_233051, skip_threads_233077)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_233078) {\n                    // write result\n    ",
                   "                {\n                        ((volatile __local\n                          double *) red_arr_mem_233066)[sext_i32_i64(local_tid_233049)] =\n                            x_233070;\n                        x_233071 = x_233070;\n                    }\n                }\n                if (sle32(wave_sizze_233051, skip_threads_233077)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_233077 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_233080 = squot32(local_tid_233049, 32) == 0 ||\n         !ltid_in_bounds_233073;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_233080) {\n                x_211890 = x_211889;\n                x_211889 = ((__local\n                             double *) red_arr_mem_233066)[sext_i32_i64(squot32(local_tid_233049,\n                                                                                32)) -\n                                                           (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_233081 = slt64(srem64(sext_i32_i64(local_tid_233049),\n                                                q_s_203575),\n                                         sext_i32_i64(local_tid_233049) -\n                                         sext_i32_i64(squot32(local_tid_233049,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_233080) {\n                if (inactive_233081) {\n                    x_211889 = x_211890;\n                }\n            }\n            if (!no_carry_in_233080) {\n                if (!inactive_233081) {\n                    double defunc_1_op_res_211891 = x_211889 + x_211890;\n                    \n                    x_211889 = defunc_1_op_res_211891;\n                }\n            }\n        }\n        // write final result\n        {\n ",
                   "           if (!no_carry_in_233080) {\n                ((__local\n                  double *) red_arr_mem_233066)[sext_i32_i64(local_tid_233049)] =\n                    x_211889;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_233049, 32) == 0 && ltid_in_bounds_233073) {\n            ((__local\n              double *) red_arr_mem_233066)[sext_i32_i64(local_tid_233049)] =\n                x_211890;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233082 = 0; i_233082 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233049),\n                                                    computed_group_sizze_211760);\n         i_233082++) {\n        double tmp_233083;\n        \n        tmp_233083 = ((__local double *) red_arr_mem_233066)[q_s_203575 -\n                                                             (int64_t) 1 +\n                                                             (i_233082 *\n                                                              computed_group_sizze_211760 +\n                                                              sext_i32_i64(local_tid_233049)) *\n                                                             q_s_203575];\n        ((__local double *) color_232099)[i_233082 *\n                                          computed_group_sizze_211760 +\n                                          sext_i32_i64(local_tid_233049)] =\n            tmp_233083;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_211916 = sext_i32_i64(sext_i64_i32(ltid_pre_233053));\n    int32_t phys_tid_211917 = local_tid_233049;\n    \n    if (slt64(gtid_211916, s_n_m_203726)) {\n        bool index_primexp_228805 = gtid_211916 == (int64_t) 0;\n        double defunc_2_reduce_res_211920;\n        \n        defunc_2_reduce_res_211920 = ((__local\n            ",
                   "                           double *) color_232099)[gtid_211916];\n        \n        double a0_211921 = 1.0 / defunc_2_reduce_res_211920;\n        int64_t defunc_0_m_fun_res_211922;\n        \n        if (index_primexp_228805) {\n            defunc_0_m_fun_res_211922 = (int64_t) 0;\n        } else {\n            int64_t y_211923 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_211924 = gtid_211916 == y_211923;\n            int64_t defunc_0_m_fun_res_f_res_211925;\n            \n            if (cond_211924) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_211926 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_211925 =\n                    defunc_0_m_fun_res_f_res_t_res_211926;\n            } else {\n                int64_t x_211927 = sub64(gtid_211916, (int64_t) 1);\n                int64_t x_211928 = mul64(jump_s_203581, x_211927);\n                int64_t min_arg_211929 = add64((int64_t) 1, x_211928);\n                int64_t min_res_211930 = smin64(defunc_0_f_res_203721,\n                                                min_arg_211929);\n                \n                defunc_0_m_fun_res_f_res_211925 = min_res_211930;\n            }\n            defunc_0_m_fun_res_211922 = defunc_0_m_fun_res_f_res_211925;\n        }\n        ((__local double *) color_232101)[gtid_211916] = a0_211921;\n        ((__local int64_t *) color_232100)[gtid_211916] =\n            defunc_0_m_fun_res_211922;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_211932 = sext_i32_i64(sext_i64_i32(ltid_pre_233056));\n    int64_t gtid_211933 = sext_i32_i64(sext_i64_i32(ltid_pre_233057));\n    int32_t phys_tid_211934 = local_tid_233049;\n    __local unsigned char *red_arr_mem_233084;\n    \n    red_arr_mem_233084 = (__local unsigned char *) red_arr_mem_233084_backing_5;\n    if (slt64(gtid_211932, s_n_m_203726) && slt64(gtid_211933, q_s_203575)) {\n        int64_t x_211938;\n        \n        x_211938 = ((__global int64_t *) ext_m",
                   "em_229471)[gtid_211856 *\n                                                         (s_n_m_203726 *\n                                                          n_p_203574) +\n                                                         gtid_211857 *\n                                                         s_n_m_203726 +\n                                                         gtid_211932];\n        \n        double x_211939;\n        \n        x_211939 = ((__global double *) ext_mem_229470)[gtid_211856 *\n                                                        (s_n_m_203726 *\n                                                         n_p_203574) +\n                                                        gtid_211857 *\n                                                        s_n_m_203726 +\n                                                        gtid_211932];\n        \n        double a0_211940;\n        \n        a0_211940 = ((__local double *) color_232101)[gtid_211932];\n        \n        int64_t defunc_0_m_fun_res_211941;\n        \n        defunc_0_m_fun_res_211941 = ((__local\n                                      int64_t *) color_232100)[gtid_211932];\n        \n        bool cond_211943 = sle64(x_211865, gtid_211933);\n        int64_t defunc_0_f_res_211944;\n        \n        if (cond_211943) {\n            defunc_0_f_res_211944 = (int64_t) 0;\n        } else {\n            int64_t i_211945 = add64(gtid_211933, x_211938);\n            int64_t defunc_0_add_arg_211946;\n            \n            defunc_0_add_arg_211946 = ((__global\n                                        int64_t *) ext_mem_229373)[gtid_211856 *\n                                                                   (defunc_0_f_res_203721 *\n                                                                    n_p_203574) +\n                                                                   gtid_211857 *\n                                                                   defunc_0_f_res_203721 +\n                                                   ",
                   "                i_211945];\n            \n            int64_t defunc_1_add_res_211947 = add64((int64_t) 1,\n                                                    defunc_0_add_arg_211946);\n            \n            defunc_0_f_res_211944 = defunc_1_add_res_211947;\n        }\n        \n        double defunc_0_f_res_211948;\n        \n        if (cond_211943) {\n            defunc_0_f_res_211948 = 0.0;\n        } else {\n            int64_t i_211949 = add64(gtid_211933, x_211938);\n            double defunc_0_add_arg_211950;\n            \n            defunc_0_add_arg_211950 = ((__global\n                                        double *) mem_229639)[gtid_211856 *\n                                                              (defunc_0_f_res_203721 *\n                                                               n_p_203574) +\n                                                              gtid_211857 *\n                                                              defunc_0_f_res_203721 +\n                                                              i_211949];\n            defunc_0_f_res_211948 = defunc_0_add_arg_211950;\n        }\n        \n        int64_t binop_p_211951 = sub64(defunc_0_f_res_211944,\n                                       defunc_0_m_fun_res_211941);\n        double defunc_0_f_res_211952 = sitofp_i64_f64(binop_p_211951);\n        double abs_res_211953 = fabs(defunc_0_f_res_211952);\n        double tmp1_211954 = abs_res_211953 / x_211939;\n        double x_211955 = tmp1_211954 * tmp1_211954;\n        double y_211956 = tmp1_211954 * x_211955;\n        double tmp2_211957 = 1.0 - y_211956;\n        double x_211958 = tmp2_211957 * tmp2_211957;\n        double tmp3_211959 = tmp2_211957 * x_211958;\n        double tmp4_211960 = defunc_0_f_res_211948 * tmp3_211959;\n        double defunc_0_f_res_211961;\n        \n        if (cond_211943) {\n            defunc_0_f_res_211961 = 0.0;\n        } else {\n            int64_t i_211962 = add64(gtid_211933, x_211938);\n            double defunc_0_add_arg_2119",
                   "63;\n            \n            defunc_0_add_arg_211963 = ((__global\n                                        double *) mem_229634)[gtid_211856 *\n                                                              (defunc_0_f_res_203721 *\n                                                               n_p_203574) +\n                                                              gtid_211857 *\n                                                              defunc_0_f_res_203721 +\n                                                              i_211962];\n            defunc_0_f_res_211961 = defunc_0_add_arg_211963;\n        }\n        \n        double x_211964 = a0_211940 * tmp4_211960;\n        double defunc_9_fit_fun_res_211965 = defunc_0_f_res_211961 * x_211964;\n        \n        ((__local double *) red_arr_mem_233084)[gtid_211932 * q_s_203575 +\n                                                gtid_211933] =\n            defunc_9_fit_fun_res_211965;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_233086 = s_n_m_203726 * q_s_203575;\n    double x_211935;\n    double x_211936;\n    double x_233088;\n    double x_233089;\n    bool ltid_in_bounds_233091 = slt64(sext_i32_i64(local_tid_233049),\n                                       s_n_m_203726 * q_s_203575);\n    int32_t skip_threads_233092;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_233091) {\n            x_211936 = ((volatile __local\n                         double *) red_arr_mem_233084)[sext_i32_i64(local_tid_233049)];\n            if ((local_tid_233049 - squot32(local_tid_233049, 32) * 32) == 0) {\n                x_211935 = x_211936;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_233092 = 1;\n        while (slt32(skip_threads_233092, 32)) {\n            bool thread_active_233093 = sle32(skip_threads_233092,\n                                              local_tid_233049 -\n                                              squot32(local_tid_233049",
                   ", 32) *\n                                              32) && ltid_in_bounds_233091;\n            \n            if (thread_active_233093) {\n                // read operands\n                {\n                    x_211935 = ((volatile __local\n                                 double *) red_arr_mem_233084)[sext_i32_i64(local_tid_233049) -\n                                                               sext_i32_i64(skip_threads_233092)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_233094 =\n                     slt64(srem64(sext_i32_i64(local_tid_233049), q_s_203575),\n                           sext_i32_i64(local_tid_233049) -\n                           sext_i32_i64(local_tid_233049 -\n                           skip_threads_233092));\n                \n                if (thread_active_233093 && inactive_233094) {\n                    x_211935 = x_211936;\n                }\n                if (thread_active_233093) {\n                    if (!inactive_233094) {\n                        double defunc_1_op_res_211937 = x_211935 + x_211936;\n                        \n                        x_211935 = defunc_1_op_res_211937;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_233051, skip_threads_233092)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_233093) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233084)[sext_i32_i64(local_tid_233049)] =\n                        x_211935;\n                    x_211936 = x_211935;\n                }\n            }\n            if (sle32(wave_sizze_233051, skip_threads_233092)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_233092 *= 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_233049",
                   " - squot32(local_tid_233049, 32) * 32) == 31 &&\n            ltid_in_bounds_233091) {\n            ((volatile __local\n              double *) red_arr_mem_233084)[sext_i32_i64(squot32(local_tid_233049,\n                                                                 32))] =\n                x_211935;\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_233095;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_233049, 32) == 0 && ltid_in_bounds_233091) {\n                x_233089 = ((volatile __local\n                             double *) red_arr_mem_233084)[sext_i32_i64(local_tid_233049)];\n                if ((local_tid_233049 - squot32(local_tid_233049, 32) * 32) ==\n                    0) {\n                    x_233088 = x_233089;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_233095 = 1;\n            while (slt32(skip_threads_233095, 32)) {\n                bool thread_active_233096 = sle32(skip_threads_233095,\n                                                  local_tid_233049 -\n                                                  squot32(local_tid_233049,\n                                                          32) * 32) &&\n                     (squot32(local_tid_233049, 32) == 0 &&\n                      ltid_in_bounds_233091);\n                \n                if (thread_active_233096) {\n                    // read operands\n                    {\n                        x_233088 = ((volatile __local\n                                     double *) red_arr_mem_233084)[sext_i32_i64(local_tid_233049) -\n                                                                   sext_i32_i64(skip_threads_233095)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_23309",
                   "7 =\n                         slt64(srem64(sext_i32_i64(local_tid_233049 * 32 + 32 -\n                                      1), q_s_203575),\n                               sext_i32_i64(local_tid_233049 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_233049 -\n                                             skip_threads_233095) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_233096 && inactive_233097) {\n                        x_233088 = x_233089;\n                    }\n                    if (thread_active_233096) {\n                        if (!inactive_233097) {\n                            double defunc_1_op_res_233090 = x_233088 + x_233089;\n                            \n                            x_233088 = defunc_1_op_res_233090;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_233051, skip_threads_233095)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_233096) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) red_arr_mem_233084)[sext_i32_i64(local_tid_233049)] =\n                            x_233088;\n                        x_233089 = x_233088;\n                    }\n                }\n                if (sle32(wave_sizze_233051, skip_threads_233095)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_233095 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_233098 = squot32(local_tid_233049, 32) == 0 ||\n         !ltid_in_bounds_233091;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_233098) {\n                x_211936 = x_211935;\n                x_211935 = ((__local\n                             double *) red_arr_mem_233084)[sext",
                   "_i32_i64(squot32(local_tid_233049,\n                                                                                32)) -\n                                                           (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_233099 = slt64(srem64(sext_i32_i64(local_tid_233049),\n                                                q_s_203575),\n                                         sext_i32_i64(local_tid_233049) -\n                                         sext_i32_i64(squot32(local_tid_233049,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_233098) {\n                if (inactive_233099) {\n                    x_211935 = x_211936;\n                }\n            }\n            if (!no_carry_in_233098) {\n                if (!inactive_233099) {\n                    double defunc_1_op_res_211937 = x_211935 + x_211936;\n                    \n                    x_211935 = defunc_1_op_res_211937;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_233098) {\n                ((__local\n                  double *) red_arr_mem_233084)[sext_i32_i64(local_tid_233049)] =\n                    x_211935;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_233049, 32) == 0 && ltid_in_bounds_233091) {\n            ((__local\n              double *) red_arr_mem_233084)[sext_i32_i64(local_tid_233049)] =\n                x_211936;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233100 = 0; i_233100 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233049),\n                                                    computed_group_sizze_211760);\n         i_233100++) {\n        double tmp_233101;\n        \n        tmp_233101 = ((__",
                   "local double *) red_arr_mem_233084)[q_s_203575 -\n                                                             (int64_t) 1 +\n                                                             (i_233100 *\n                                                              computed_group_sizze_211760 +\n                                                              sext_i32_i64(local_tid_233049)) *\n                                                             q_s_203575];\n        ((__local double *) color_232099)[i_233100 *\n                                          computed_group_sizze_211760 +\n                                          sext_i32_i64(local_tid_233049)] =\n            tmp_233101;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233102 = 0; i_233102 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233049),\n                                                    computed_group_sizze_211760);\n         i_233102++) {\n        double tmp_233103;\n        \n        tmp_233103 = ((__local double *) color_232099)[i_233102 *\n                                                       computed_group_sizze_211760 +\n                                                       sext_i32_i64(local_tid_233049)];\n        ((__global double *) mem_229783)[gtid_211856 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_211857 * s_n_m_203726 +\n                                         (i_233102 *\n                                          computed_group_sizze_211760 +\n                                          sext_i32_i64(local_tid_233049))] =\n            tmp_233103;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_6:\n    return;\n}\n__kernel void mainzisegmap_intragroup_213926(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *red_arr_mem_2",
                   "33406_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *red_arr_mem_233404_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *red_arr_mem_233374_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *red_arr_mem_233372_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *red_arr_mem_233370_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *color_232114_backing_aligned_5,\n                                             __local volatile\n                                             int64_t *color_232113_backing_aligned_6,\n                                             __local volatile\n                                             int64_t *color_232112_backing_aligned_7,\n                                             __local volatile\n                                             int64_t *color_232111_backing_aligned_8,\n                                             __local volatile\n                                             int64_t *color_232110_backing_aligned_9,\n                                             __local volatile\n                                             int64_t *color_232109_backing_aligned_10,\n                                             __local volatile\n                                             int64_t *color_232108_backing_aligned_11,\n                                             __local volatile\n                                             int64_t *color_232107_backing_aligned_12,\n                                             int64_t n_p_203574,\n                                             int64_t q_s_203575,\n                                          ",
                   "   int64_t jump_s_203581,\n                                             int64_t partition_sizze_203667,\n                                             int64_t defunc_0_f_res_203721,\n                                             int64_t pad_css_len_203722,\n                                             int64_t s_n_m_203726,\n                                             int64_t computed_group_sizze_213795,\n                                             __global\n                                             unsigned char *ext_mem_229372,\n                                             __global\n                                             unsigned char *ext_mem_229373,\n                                             __global\n                                             unsigned char *ext_mem_229470,\n                                             __global\n                                             unsigned char *ext_mem_229471,\n                                             __global unsigned char *mem_229634,\n                                             __global unsigned char *mem_229639,\n                                             __global unsigned char *mem_230059,\n                                             __global unsigned char *mem_230064)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_233406_backing_12 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233406_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_233404_backing_11 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233404_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_233374_backing_10 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233374_backing_aligned_2;\n",
                   "    __local volatile unsigned char *restrict red_arr_mem_233372_backing_9 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233372_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_233370_backing_8 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233370_backing_aligned_4;\n    __local volatile unsigned char *restrict color_232114_backing_7 =\n                                   (__local volatile\n                                    unsigned char *) color_232114_backing_aligned_5;\n    __local volatile unsigned char *restrict color_232113_backing_6 =\n                                   (__local volatile\n                                    unsigned char *) color_232113_backing_aligned_6;\n    __local volatile unsigned char *restrict color_232112_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) color_232112_backing_aligned_7;\n    __local volatile unsigned char *restrict color_232111_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) color_232111_backing_aligned_8;\n    __local volatile unsigned char *restrict color_232110_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) color_232110_backing_aligned_9;\n    __local volatile unsigned char *restrict color_232109_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) color_232109_backing_aligned_10;\n    __local volatile unsigned char *restrict color_232108_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_232108_backing_aligned_11;\n    __local volatile unsigned char *restrict color_232107_backing_0 =\n                                ",
                   "   (__local volatile\n                                    unsigned char *) color_232107_backing_aligned_12;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233352;\n    int32_t local_tid_233353;\n    int64_t group_sizze_233356;\n    int32_t wave_sizze_233355;\n    int32_t group_tid_233354;\n    \n    global_tid_233352 = get_global_id(0);\n    local_tid_233353 = get_local_id(0);\n    group_sizze_233356 = get_local_size(0);\n    wave_sizze_233355 = LOCKSTEP_WIDTH;\n    group_tid_233354 = get_group_id(0);\n    \n    int32_t phys_tid_213926 = group_tid_233354;\n    int64_t slice_233358 = s_n_m_203726;\n    int64_t ltid_pre_233357 = sext_i32_i64(local_tid_233353);\n    int64_t remnant_233359 = sext_i32_i64(local_tid_233353) - ltid_pre_233357;\n    int64_t slice_233362 = q_s_203575;\n    int64_t slice_233363 = s_n_m_203726 * slice_233362;\n    int64_t ltid_pre_233360 = squot64(sext_i32_i64(local_tid_233353),\n                                      slice_233362);\n    int64_t remnant_233364 = sext_i32_i64(local_tid_233353) - ltid_pre_233360 *\n            slice_233362;\n    int64_t ltid_pre_233361 = remnant_233364;\n    int64_t remnant_233365 = remnant_233364 - ltid_pre_233361;\n    int64_t slice_233366 = n_p_203574;\n    int64_t slice_233367 = partition_sizze_203667 * slice_233366;\n    int64_t gtid_213924 = squot64(sext_i32_i64(group_tid_233354), slice_233366);\n    int64_t remnant_233368 = sext_i32_i64(group_tid_233354) - gtid_213924 *\n            slice_233366;\n    int64_t gtid_213925 = remnant_233368;\n    int64_t remnant_233369 = remnant_233368 - gtid_213925;\n    __local unsigned char *color_232107;\n    \n    color_232107 = (__local unsigned char *) color_232107_backing_0;\n    \n    __local unsigned char *color_232108;\n    \n    color_232108 = (__local unsigned char *) color_232108_backing_1;\n    \n    __local unsigned char *color_232109;\n    \n    color_232109 = (__local unsigned char *) color_232109_backing_2;\n    \n    __local unsigned char *color_232110;\n    \n    color",
                   "_232110 = (__local unsigned char *) color_232110_backing_3;\n    \n    __local unsigned char *color_232111;\n    \n    color_232111 = (__local unsigned char *) color_232111_backing_4;\n    \n    __local unsigned char *color_232112;\n    \n    color_232112 = (__local unsigned char *) color_232112_backing_5;\n    \n    __local unsigned char *color_232113;\n    \n    color_232113 = (__local unsigned char *) color_232113_backing_6;\n    \n    __local unsigned char *color_232114;\n    \n    color_232114 = (__local unsigned char *) color_232114_backing_7;\n    \n    int64_t x_213933;\n    \n    x_213933 = ((__global int64_t *) ext_mem_229372)[gtid_213924 * n_p_203574 +\n                                                     gtid_213925];\n    \n    int64_t gtid_213940 = sext_i32_i64(sext_i64_i32(ltid_pre_233357));\n    int32_t phys_tid_213941 = local_tid_233353;\n    \n    if (slt64(gtid_213940, s_n_m_203726)) {\n        bool cond_213943 = gtid_213940 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_213944;\n        \n        if (cond_213943) {\n            defunc_0_m_fun_res_213944 = (int64_t) 0;\n        } else {\n            int64_t y_213945 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_213946 = gtid_213940 == y_213945;\n            int64_t defunc_0_m_fun_res_f_res_213947;\n            \n            if (cond_213946) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_213948 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_213947 =\n                    defunc_0_m_fun_res_f_res_t_res_213948;\n            } else {\n                int64_t x_213949 = sub64(gtid_213940, (int64_t) 1);\n                int64_t x_213950 = mul64(jump_s_203581, x_213949);\n                int64_t min_arg_213951 = add64((int64_t) 1, x_213950);\n                int64_t min_res_213952 = smin64(defunc_0_f_res_203721,\n                                                min_arg_213951);\n                \n                defunc_0_m_fun_res_f_res_213947 = mi",
                   "n_res_213952;\n            }\n            defunc_0_m_fun_res_213944 = defunc_0_m_fun_res_f_res_213947;\n        }\n        ((__local int64_t *) color_232109)[gtid_213940] =\n            defunc_0_m_fun_res_213944;\n        ((__local bool *) color_232114)[gtid_213940] = cond_213943;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_213956 = sext_i32_i64(sext_i64_i32(ltid_pre_233360));\n    int64_t gtid_213957 = sext_i32_i64(sext_i64_i32(ltid_pre_233361));\n    int32_t phys_tid_213958 = local_tid_233353;\n    __local unsigned char *red_arr_mem_233370;\n    \n    red_arr_mem_233370 = (__local unsigned char *) red_arr_mem_233370_backing_8;\n    \n    __local unsigned char *red_arr_mem_233372;\n    \n    red_arr_mem_233372 = (__local unsigned char *) red_arr_mem_233372_backing_9;\n    \n    __local unsigned char *red_arr_mem_233374;\n    \n    red_arr_mem_233374 = (__local\n                          unsigned char *) red_arr_mem_233374_backing_10;\n    if (slt64(gtid_213956, s_n_m_203726) && slt64(gtid_213957, q_s_203575)) {\n        int64_t x_213968;\n        \n        x_213968 = ((__global int64_t *) ext_mem_229471)[gtid_213924 *\n                                                         (s_n_m_203726 *\n                                                          n_p_203574) +\n                                                         gtid_213925 *\n                                                         s_n_m_203726 +\n                                                         gtid_213956];\n        \n        double x_213969;\n        \n        x_213969 = ((__global double *) ext_mem_229470)[gtid_213924 *\n                                                        (s_n_m_203726 *\n                                                         n_p_203574) +\n                                                        gtid_213925 *\n                                                        s_n_m_203726 +\n                                                        gtid_213956];\n        \n        int64_t defunc_0_m_fun_res",
                   "_213970;\n        \n        defunc_0_m_fun_res_213970 = ((__local\n                                      int64_t *) color_232109)[gtid_213956];\n        \n        bool cond_213972 = sle64(x_213933, gtid_213957);\n        int64_t defunc_0_f_res_213973;\n        \n        if (cond_213972) {\n            defunc_0_f_res_213973 = (int64_t) 0;\n        } else {\n            int64_t i_213974 = add64(gtid_213957, x_213968);\n            int64_t defunc_0_add_arg_213975;\n            \n            defunc_0_add_arg_213975 = ((__global\n                                        int64_t *) ext_mem_229373)[gtid_213924 *\n                                                                   (defunc_0_f_res_203721 *\n                                                                    n_p_203574) +\n                                                                   gtid_213925 *\n                                                                   defunc_0_f_res_203721 +\n                                                                   i_213974];\n            \n            int64_t defunc_1_add_res_213976 = add64((int64_t) 1,\n                                                    defunc_0_add_arg_213975);\n            \n            defunc_0_f_res_213973 = defunc_1_add_res_213976;\n        }\n        \n        double defunc_0_f_res_213977;\n        \n        if (cond_213972) {\n            defunc_0_f_res_213977 = 0.0;\n        } else {\n            int64_t i_213978 = add64(gtid_213957, x_213968);\n            double defunc_0_add_arg_213979;\n            \n            defunc_0_add_arg_213979 = ((__global\n                                        double *) mem_229639)[gtid_213924 *\n                                                              (defunc_0_f_res_203721 *\n                                                               n_p_203574) +\n                                                              gtid_213925 *\n                                                              defunc_0_f_res_203721 +\n                             ",
                   "                                 i_213978];\n            defunc_0_f_res_213977 = defunc_0_add_arg_213979;\n        }\n        \n        int64_t binop_p_213980 = sub64(defunc_0_f_res_213973,\n                                       defunc_0_m_fun_res_213970);\n        double defunc_0_f_res_213981 = sitofp_i64_f64(binop_p_213980);\n        double abs_res_213982 = fabs(defunc_0_f_res_213981);\n        double tmp1_213983 = abs_res_213982 / x_213969;\n        double x_213984 = tmp1_213983 * tmp1_213983;\n        double y_213985 = tmp1_213983 * x_213984;\n        double tmp2_213986 = 1.0 - y_213985;\n        double x_213987 = tmp2_213986 * tmp2_213986;\n        double tmp3_213988 = tmp2_213986 * x_213987;\n        double w_j_213989 = defunc_0_f_res_213977 * tmp3_213988;\n        double xw_j_213990 = defunc_0_f_res_213981 * w_j_213989;\n        double x2w_j_213991 = defunc_0_f_res_213981 * xw_j_213990;\n        \n        ((__local double *) red_arr_mem_233370)[gtid_213956 * q_s_203575 +\n                                                gtid_213957] = w_j_213989;\n        ((__local double *) red_arr_mem_233372)[gtid_213956 * q_s_203575 +\n                                                gtid_213957] = xw_j_213990;\n        ((__local double *) red_arr_mem_233374)[gtid_213956 * q_s_203575 +\n                                                gtid_213957] = x2w_j_213991;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_233376 = s_n_m_203726 * q_s_203575;\n    double x_213959;\n    double x_213960;\n    double x_213961;\n    double x_213962;\n    double x_213963;\n    double x_213964;\n    double x_233380;\n    double x_233381;\n    double x_233382;\n    double x_233383;\n    double x_233384;\n    double x_233385;\n    bool ltid_in_bounds_233389 = slt64(sext_i32_i64(local_tid_233353),\n                                       s_n_m_203726 * q_s_203575);\n    int32_t skip_threads_233390;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_233389) {\n            x_213962 = ((volatile __",
                   "local\n                         double *) red_arr_mem_233370)[sext_i32_i64(local_tid_233353)];\n            x_213963 = ((volatile __local\n                         double *) red_arr_mem_233372)[sext_i32_i64(local_tid_233353)];\n            x_213964 = ((volatile __local\n                         double *) red_arr_mem_233374)[sext_i32_i64(local_tid_233353)];\n            if ((local_tid_233353 - squot32(local_tid_233353, 32) * 32) == 0) {\n                x_213959 = x_213962;\n                x_213960 = x_213963;\n                x_213961 = x_213964;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_233390 = 1;\n        while (slt32(skip_threads_233390, 32)) {\n            bool thread_active_233391 = sle32(skip_threads_233390,\n                                              local_tid_233353 -\n                                              squot32(local_tid_233353, 32) *\n                                              32) && ltid_in_bounds_233389;\n            \n            if (thread_active_233391) {\n                // read operands\n                {\n                    x_213959 = ((volatile __local\n                                 double *) red_arr_mem_233370)[sext_i32_i64(local_tid_233353) -\n                                                               sext_i32_i64(skip_threads_233390)];\n                    x_213960 = ((volatile __local\n                                 double *) red_arr_mem_233372)[sext_i32_i64(local_tid_233353) -\n                                                               sext_i32_i64(skip_threads_233390)];\n                    x_213961 = ((volatile __local\n                                 double *) red_arr_mem_233374)[sext_i32_i64(local_tid_233353) -\n                                                               sext_i32_i64(skip_threads_233390)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_233392 =\n                     slt64(srem64(sext_i32",
                   "_i64(local_tid_233353), q_s_203575),\n                           sext_i32_i64(local_tid_233353) -\n                           sext_i32_i64(local_tid_233353 -\n                           skip_threads_233390));\n                \n                if (thread_active_233391 && inactive_233392) {\n                    x_213959 = x_213962;\n                    x_213960 = x_213963;\n                    x_213961 = x_213964;\n                }\n                if (thread_active_233391) {\n                    if (!inactive_233392) {\n                        double defunc_1_op_res_213965 = x_213959 + x_213962;\n                        double defunc_1_op_res_213966 = x_213960 + x_213963;\n                        double defunc_1_op_res_213967 = x_213961 + x_213964;\n                        \n                        x_213959 = defunc_1_op_res_213965;\n                        x_213960 = defunc_1_op_res_213966;\n                        x_213961 = defunc_1_op_res_213967;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_233355, skip_threads_233390)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_233391) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233370)[sext_i32_i64(local_tid_233353)] =\n                        x_213959;\n                    x_213962 = x_213959;\n                    ((volatile __local\n                      double *) red_arr_mem_233372)[sext_i32_i64(local_tid_233353)] =\n                        x_213960;\n                    x_213963 = x_213960;\n                    ((volatile __local\n                      double *) red_arr_mem_233374)[sext_i32_i64(local_tid_233353)] =\n                        x_213961;\n                    x_213964 = x_213961;\n                }\n            }\n            if (sle32(wave_sizze_233355, skip_threads_233390)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_2",
                   "33390 *= 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_233353 - squot32(local_tid_233353, 32) * 32) == 31 &&\n            ltid_in_bounds_233389) {\n            ((volatile __local\n              double *) red_arr_mem_233370)[sext_i32_i64(squot32(local_tid_233353,\n                                                                 32))] =\n                x_213959;\n            ((volatile __local\n              double *) red_arr_mem_233372)[sext_i32_i64(squot32(local_tid_233353,\n                                                                 32))] =\n                x_213960;\n            ((volatile __local\n              double *) red_arr_mem_233374)[sext_i32_i64(squot32(local_tid_233353,\n                                                                 32))] =\n                x_213961;\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_233393;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_233353, 32) == 0 && ltid_in_bounds_233389) {\n                x_233383 = ((volatile __local\n                             double *) red_arr_mem_233370)[sext_i32_i64(local_tid_233353)];\n                x_233384 = ((volatile __local\n                             double *) red_arr_mem_233372)[sext_i32_i64(local_tid_233353)];\n                x_233385 = ((volatile __local\n                             double *) red_arr_mem_233374)[sext_i32_i64(local_tid_233353)];\n                if ((local_tid_233353 - squot32(local_tid_233353, 32) * 32) ==\n                    0) {\n                    x_233380 = x_233383;\n                    x_233381 = x_233384;\n                    x_233382 = x_233385;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_233393 = 1;\n            ",
                   "while (slt32(skip_threads_233393, 32)) {\n                bool thread_active_233394 = sle32(skip_threads_233393,\n                                                  local_tid_233353 -\n                                                  squot32(local_tid_233353,\n                                                          32) * 32) &&\n                     (squot32(local_tid_233353, 32) == 0 &&\n                      ltid_in_bounds_233389);\n                \n                if (thread_active_233394) {\n                    // read operands\n                    {\n                        x_233380 = ((volatile __local\n                                     double *) red_arr_mem_233370)[sext_i32_i64(local_tid_233353) -\n                                                                   sext_i32_i64(skip_threads_233393)];\n                        x_233381 = ((volatile __local\n                                     double *) red_arr_mem_233372)[sext_i32_i64(local_tid_233353) -\n                                                                   sext_i32_i64(skip_threads_233393)];\n                        x_233382 = ((volatile __local\n                                     double *) red_arr_mem_233374)[sext_i32_i64(local_tid_233353) -\n                                                                   sext_i32_i64(skip_threads_233393)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_233395 =\n                         slt64(srem64(sext_i32_i64(local_tid_233353 * 32 + 32 -\n                                      1), q_s_203575),\n                               sext_i32_i64(local_tid_233353 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_233353 -\n                                             skip_threads_233393) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_233394 && inactive_233395) {\n                        x_233380 = x_233383;\n             ",
                   "           x_233381 = x_233384;\n                        x_233382 = x_233385;\n                    }\n                    if (thread_active_233394) {\n                        if (!inactive_233395) {\n                            double defunc_1_op_res_233386 = x_233380 + x_233383;\n                            double defunc_1_op_res_233387 = x_233381 + x_233384;\n                            double defunc_1_op_res_233388 = x_233382 + x_233385;\n                            \n                            x_233380 = defunc_1_op_res_233386;\n                            x_233381 = defunc_1_op_res_233387;\n                            x_233382 = defunc_1_op_res_233388;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_233355, skip_threads_233393)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_233394) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) red_arr_mem_233370)[sext_i32_i64(local_tid_233353)] =\n                            x_233380;\n                        x_233383 = x_233380;\n                        ((volatile __local\n                          double *) red_arr_mem_233372)[sext_i32_i64(local_tid_233353)] =\n                            x_233381;\n                        x_233384 = x_233381;\n                        ((volatile __local\n                          double *) red_arr_mem_233374)[sext_i32_i64(local_tid_233353)] =\n                            x_233382;\n                        x_233385 = x_233382;\n                    }\n                }\n                if (sle32(wave_sizze_233355, skip_threads_233393)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_233393 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_233396 = squot32(local_tid_233353, 32) == 0 ||\n         !ltid_in_bounds_233389;\n  ",
                   "  \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_233396) {\n                x_213962 = x_213959;\n                x_213963 = x_213960;\n                x_213964 = x_213961;\n                x_213959 = ((__local\n                             double *) red_arr_mem_233370)[sext_i32_i64(squot32(local_tid_233353,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_213960 = ((__local\n                             double *) red_arr_mem_233372)[sext_i32_i64(squot32(local_tid_233353,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_213961 = ((__local\n                             double *) red_arr_mem_233374)[sext_i32_i64(squot32(local_tid_233353,\n                                                                                32)) -\n                                                           (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_233397 = slt64(srem64(sext_i32_i64(local_tid_233353),\n                                                q_s_203575),\n                                         sext_i32_i64(local_tid_233353) -\n                                         sext_i32_i64(squot32(local_tid_233353,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_233396) {\n                if (inactive_233397) {\n                    x_213959 = x_213962;\n                    x_213960 = x_213963;\n                    x_213961 = x_213964;\n                }\n            }\n            if (!no_carry_in_233396) {\n                if (!inactive_233397) {\n                    double defunc_1_op_res_213965 = x_213959 + x_213962;\n                    double defunc_1_op",
                   "_res_213966 = x_213960 + x_213963;\n                    double defunc_1_op_res_213967 = x_213961 + x_213964;\n                    \n                    x_213959 = defunc_1_op_res_213965;\n                    x_213960 = defunc_1_op_res_213966;\n                    x_213961 = defunc_1_op_res_213967;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_233396) {\n                ((__local\n                  double *) red_arr_mem_233370)[sext_i32_i64(local_tid_233353)] =\n                    x_213959;\n                ((__local\n                  double *) red_arr_mem_233372)[sext_i32_i64(local_tid_233353)] =\n                    x_213960;\n                ((__local\n                  double *) red_arr_mem_233374)[sext_i32_i64(local_tid_233353)] =\n                    x_213961;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_233353, 32) == 0 && ltid_in_bounds_233389) {\n            ((__local\n              double *) red_arr_mem_233370)[sext_i32_i64(local_tid_233353)] =\n                x_213962;\n            ((__local\n              double *) red_arr_mem_233372)[sext_i32_i64(local_tid_233353)] =\n                x_213963;\n            ((__local\n              double *) red_arr_mem_233374)[sext_i32_i64(local_tid_233353)] =\n                x_213964;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233398 = 0; i_233398 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233353),\n                                                    computed_group_sizze_213795);\n         i_233398++) {\n        double tmp_233399;\n        \n        tmp_233399 = ((__local double *) red_arr_mem_233370)[q_s_203575 -\n                                                             (int64_t) 1 +\n                                                             (i_233398 *\n    ",
                   "                                                          computed_group_sizze_213795 +\n                                                              sext_i32_i64(local_tid_233353)) *\n                                                             q_s_203575];\n        ((__local double *) color_232113)[i_233398 *\n                                          computed_group_sizze_213795 +\n                                          sext_i32_i64(local_tid_233353)] =\n            tmp_233399;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233400 = 0; i_233400 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233353),\n                                                    computed_group_sizze_213795);\n         i_233400++) {\n        double tmp_233401;\n        \n        tmp_233401 = ((__local double *) red_arr_mem_233372)[q_s_203575 -\n                                                             (int64_t) 1 +\n                                                             (i_233400 *\n                                                              computed_group_sizze_213795 +\n                                                              sext_i32_i64(local_tid_233353)) *\n                                                             q_s_203575];\n        ((__local double *) color_232108)[i_233400 *\n                                          computed_group_sizze_213795 +\n                                          sext_i32_i64(local_tid_233353)] =\n            tmp_233401;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233402 = 0; i_233402 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233353),\n                                                    computed_group_sizze_213795);\n         i_233402++) {\n        double tmp_233403;\n        \n        tmp_233403 = ((__local double *) red_arr_mem_233374)[q_s_203575 -\n                                                             (int64_t)",
                   " 1 +\n                                                             (i_233402 *\n                                                              computed_group_sizze_213795 +\n                                                              sext_i32_i64(local_tid_233353)) *\n                                                             q_s_203575];\n        ((__local double *) color_232107)[i_233402 *\n                                          computed_group_sizze_213795 +\n                                          sext_i32_i64(local_tid_233353)] =\n            tmp_233403;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_213996 = sext_i32_i64(sext_i64_i32(ltid_pre_233357));\n    int32_t phys_tid_213997 = local_tid_233353;\n    \n    if (slt64(gtid_213996, s_n_m_203726)) {\n        bool index_primexp_228811 = gtid_213996 == (int64_t) 0;\n        double defunc_2_reduce_res_214000;\n        \n        defunc_2_reduce_res_214000 = ((__local\n                                       double *) color_232113)[gtid_213996];\n        \n        double defunc_2_reduce_res_214001;\n        \n        defunc_2_reduce_res_214001 = ((__local\n                                       double *) color_232108)[gtid_213996];\n        \n        double defunc_2_reduce_res_214002;\n        \n        defunc_2_reduce_res_214002 = ((__local\n                                       double *) color_232107)[gtid_213996];\n        \n        double x_214003 = defunc_2_reduce_res_214000 *\n               defunc_2_reduce_res_214002;\n        double y_214004 = defunc_2_reduce_res_214001 *\n               defunc_2_reduce_res_214001;\n        double y_214005 = x_214003 - y_214004;\n        double det1_214006 = 1.0 / y_214005;\n        double a11_214007 = defunc_2_reduce_res_214002 * det1_214006;\n        double x_214008 = 0.0 - defunc_2_reduce_res_214001;\n        double b11_214009 = det1_214006 * x_214008;\n        double c11_214010 = defunc_2_reduce_res_214000 * det1_214006;\n        int64_t defunc_0_m_fu",
                   "n_res_214011;\n        \n        if (index_primexp_228811) {\n            defunc_0_m_fun_res_214011 = (int64_t) 0;\n        } else {\n            int64_t y_214012 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_214013 = gtid_213996 == y_214012;\n            int64_t defunc_0_m_fun_res_f_res_214014;\n            \n            if (cond_214013) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_214015 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_214014 =\n                    defunc_0_m_fun_res_f_res_t_res_214015;\n            } else {\n                int64_t x_214016 = sub64(gtid_213996, (int64_t) 1);\n                int64_t x_214017 = mul64(jump_s_203581, x_214016);\n                int64_t min_arg_214018 = add64((int64_t) 1, x_214017);\n                int64_t min_res_214019 = smin64(defunc_0_f_res_203721,\n                                                min_arg_214018);\n                \n                defunc_0_m_fun_res_f_res_214014 = min_res_214019;\n            }\n            defunc_0_m_fun_res_214011 = defunc_0_m_fun_res_f_res_214014;\n        }\n        ((__local double *) color_232112)[gtid_213996] = a11_214007;\n        ((__local double *) color_232111)[gtid_213996] = b11_214009;\n        ((__local double *) color_232110)[gtid_213996] = c11_214010;\n        ((__local int64_t *) color_232109)[gtid_213996] =\n            defunc_0_m_fun_res_214011;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_214022 = sext_i32_i64(sext_i64_i32(ltid_pre_233360));\n    int64_t gtid_214023 = sext_i32_i64(sext_i64_i32(ltid_pre_233361));\n    int32_t phys_tid_214024 = local_tid_233353;\n    __local unsigned char *red_arr_mem_233404;\n    \n    red_arr_mem_233404 = (__local\n                          unsigned char *) red_arr_mem_233404_backing_11;\n    \n    __local unsigned char *red_arr_mem_233406;\n    \n    red_arr_mem_233406 = (__local\n                          unsigned char *) red_arr_mem_233406_back",
                   "ing_12;\n    if (slt64(gtid_214022, s_n_m_203726) && slt64(gtid_214023, q_s_203575)) {\n        int64_t x_214031;\n        \n        x_214031 = ((__global int64_t *) ext_mem_229471)[gtid_213924 *\n                                                         (s_n_m_203726 *\n                                                          n_p_203574) +\n                                                         gtid_213925 *\n                                                         s_n_m_203726 +\n                                                         gtid_214022];\n        \n        double x_214032;\n        \n        x_214032 = ((__global double *) ext_mem_229470)[gtid_213924 *\n                                                        (s_n_m_203726 *\n                                                         n_p_203574) +\n                                                        gtid_213925 *\n                                                        s_n_m_203726 +\n                                                        gtid_214022];\n        \n        double a11_214033;\n        \n        a11_214033 = ((__local double *) color_232112)[gtid_214022];\n        \n        double b11_214034;\n        \n        b11_214034 = ((__local double *) color_232111)[gtid_214022];\n        \n        double c11_214035;\n        \n        c11_214035 = ((__local double *) color_232110)[gtid_214022];\n        \n        int64_t defunc_0_m_fun_res_214036;\n        \n        defunc_0_m_fun_res_214036 = ((__local\n                                      int64_t *) color_232109)[gtid_214022];\n        \n        bool cond_214038 = sle64(x_213933, gtid_214023);\n        int64_t defunc_0_f_res_214039;\n        \n        if (cond_214038) {\n            defunc_0_f_res_214039 = (int64_t) 0;\n        } else {\n            int64_t i_214040 = add64(gtid_214023, x_214031);\n            int64_t defunc_0_add_arg_214041;\n            \n            defunc_0_add_arg_214041 = ((__global\n                                        int64_t *) ext_mem_229373)[gtid_213924 *\n",
                   "                                                                   (defunc_0_f_res_203721 *\n                                                                    n_p_203574) +\n                                                                   gtid_213925 *\n                                                                   defunc_0_f_res_203721 +\n                                                                   i_214040];\n            \n            int64_t defunc_1_add_res_214042 = add64((int64_t) 1,\n                                                    defunc_0_add_arg_214041);\n            \n            defunc_0_f_res_214039 = defunc_1_add_res_214042;\n        }\n        \n        double defunc_0_f_res_214043;\n        \n        if (cond_214038) {\n            defunc_0_f_res_214043 = 0.0;\n        } else {\n            int64_t i_214044 = add64(gtid_214023, x_214031);\n            double defunc_0_add_arg_214045;\n            \n            defunc_0_add_arg_214045 = ((__global\n                                        double *) mem_229639)[gtid_213924 *\n                                                              (defunc_0_f_res_203721 *\n                                                               n_p_203574) +\n                                                              gtid_213925 *\n                                                              defunc_0_f_res_203721 +\n                                                              i_214044];\n            defunc_0_f_res_214043 = defunc_0_add_arg_214045;\n        }\n        \n        int64_t binop_p_214046 = sub64(defunc_0_f_res_214039,\n                                       defunc_0_m_fun_res_214036);\n        double defunc_0_f_res_214047 = sitofp_i64_f64(binop_p_214046);\n        double abs_res_214048 = fabs(defunc_0_f_res_214047);\n        double tmp1_214049 = abs_res_214048 / x_214032;\n        double x_214050 = tmp1_214049 * tmp1_214049;\n        double y_214051 = tmp1_214049 * x_214050;\n        double tmp2_214052 = 1.0 - y_214051;\n        ",
                   "double x_214053 = tmp2_214052 * tmp2_214052;\n        double tmp3_214054 = tmp2_214052 * x_214053;\n        double tmp4_214055 = defunc_0_f_res_214043 * tmp3_214054;\n        double defunc_1_f_res_214056 = defunc_0_f_res_214047 * tmp4_214055;\n        double defunc_0_f_res_214057;\n        \n        if (cond_214038) {\n            defunc_0_f_res_214057 = 0.0;\n        } else {\n            int64_t i_214058 = add64(gtid_214023, x_214031);\n            double defunc_0_add_arg_214059;\n            \n            defunc_0_add_arg_214059 = ((__global\n                                        double *) mem_229634)[gtid_213924 *\n                                                              (defunc_0_f_res_203721 *\n                                                               n_p_203574) +\n                                                              gtid_213925 *\n                                                              defunc_0_f_res_203721 +\n                                                              i_214058];\n            defunc_0_f_res_214057 = defunc_0_add_arg_214059;\n        }\n        \n        double x_214060 = a11_214033 * tmp4_214055;\n        double y_214061 = b11_214034 * defunc_1_f_res_214056;\n        double x_214062 = x_214060 + y_214061;\n        double defunc_9_fit_fun_res_214063 = defunc_0_f_res_214057 * x_214062;\n        double x_214064 = b11_214034 * tmp4_214055;\n        double y_214065 = c11_214035 * defunc_1_f_res_214056;\n        double x_214066 = x_214064 + y_214065;\n        double defunc_9_slope_fun_res_214067 = defunc_0_f_res_214057 * x_214066;\n        \n        ((__local double *) red_arr_mem_233404)[gtid_214022 * q_s_203575 +\n                                                gtid_214023] =\n            defunc_9_fit_fun_res_214063;\n        ((__local double *) red_arr_mem_233406)[gtid_214022 * q_s_203575 +\n                                                gtid_214023] =\n            defunc_9_slope_fun_res_214067;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_",
                   "t dims_flat_233408 = s_n_m_203726 * q_s_203575;\n    double x_214025;\n    double x_214026;\n    double x_214027;\n    double x_214028;\n    double x_233411;\n    double x_233412;\n    double x_233413;\n    double x_233414;\n    bool ltid_in_bounds_233417 = slt64(sext_i32_i64(local_tid_233353),\n                                       s_n_m_203726 * q_s_203575);\n    int32_t skip_threads_233418;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_233417) {\n            x_214027 = ((volatile __local\n                         double *) red_arr_mem_233404)[sext_i32_i64(local_tid_233353)];\n            x_214028 = ((volatile __local\n                         double *) red_arr_mem_233406)[sext_i32_i64(local_tid_233353)];\n            if ((local_tid_233353 - squot32(local_tid_233353, 32) * 32) == 0) {\n                x_214025 = x_214027;\n                x_214026 = x_214028;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_233418 = 1;\n        while (slt32(skip_threads_233418, 32)) {\n            bool thread_active_233419 = sle32(skip_threads_233418,\n                                              local_tid_233353 -\n                                              squot32(local_tid_233353, 32) *\n                                              32) && ltid_in_bounds_233417;\n            \n            if (thread_active_233419) {\n                // read operands\n                {\n                    x_214025 = ((volatile __local\n                                 double *) red_arr_mem_233404)[sext_i32_i64(local_tid_233353) -\n                                                               sext_i32_i64(skip_threads_233418)];\n                    x_214026 = ((volatile __local\n                                 double *) red_arr_mem_233406)[sext_i32_i64(local_tid_233353) -\n                                                               sext_i32_i64(skip_threads_233418)];\n                }\n            }\n            // perform operation\n",
                   "            {\n                bool inactive_233420 =\n                     slt64(srem64(sext_i32_i64(local_tid_233353), q_s_203575),\n                           sext_i32_i64(local_tid_233353) -\n                           sext_i32_i64(local_tid_233353 -\n                           skip_threads_233418));\n                \n                if (thread_active_233419 && inactive_233420) {\n                    x_214025 = x_214027;\n                    x_214026 = x_214028;\n                }\n                if (thread_active_233419) {\n                    if (!inactive_233420) {\n                        double defunc_1_op_res_214029 = x_214025 + x_214027;\n                        double defunc_1_op_res_214030 = x_214026 + x_214028;\n                        \n                        x_214025 = defunc_1_op_res_214029;\n                        x_214026 = defunc_1_op_res_214030;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_233355, skip_threads_233418)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_233419) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233404)[sext_i32_i64(local_tid_233353)] =\n                        x_214025;\n                    x_214027 = x_214025;\n                    ((volatile __local\n                      double *) red_arr_mem_233406)[sext_i32_i64(local_tid_233353)] =\n                        x_214026;\n                    x_214028 = x_214026;\n                }\n            }\n            if (sle32(wave_sizze_233355, skip_threads_233418)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_233418 *= 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_233353 - squot32(local_tid_233353, 32) * 32) == 31 &&\n            ltid_in_bounds_233417) {\n            ((volatile __local\n     ",
                   "         double *) red_arr_mem_233404)[sext_i32_i64(squot32(local_tid_233353,\n                                                                 32))] =\n                x_214025;\n            ((volatile __local\n              double *) red_arr_mem_233406)[sext_i32_i64(squot32(local_tid_233353,\n                                                                 32))] =\n                x_214026;\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_233421;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_233353, 32) == 0 && ltid_in_bounds_233417) {\n                x_233413 = ((volatile __local\n                             double *) red_arr_mem_233404)[sext_i32_i64(local_tid_233353)];\n                x_233414 = ((volatile __local\n                             double *) red_arr_mem_233406)[sext_i32_i64(local_tid_233353)];\n                if ((local_tid_233353 - squot32(local_tid_233353, 32) * 32) ==\n                    0) {\n                    x_233411 = x_233413;\n                    x_233412 = x_233414;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_233421 = 1;\n            while (slt32(skip_threads_233421, 32)) {\n                bool thread_active_233422 = sle32(skip_threads_233421,\n                                                  local_tid_233353 -\n                                                  squot32(local_tid_233353,\n                                                          32) * 32) &&\n                     (squot32(local_tid_233353, 32) == 0 &&\n                      ltid_in_bounds_233417);\n                \n                if (thread_active_233422) {\n                    // read operands\n                    {\n                        x_233411 = ((volatile __local\n                                     double *) red_arr_mem_233404)",
                   "[sext_i32_i64(local_tid_233353) -\n                                                                   sext_i32_i64(skip_threads_233421)];\n                        x_233412 = ((volatile __local\n                                     double *) red_arr_mem_233406)[sext_i32_i64(local_tid_233353) -\n                                                                   sext_i32_i64(skip_threads_233421)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_233423 =\n                         slt64(srem64(sext_i32_i64(local_tid_233353 * 32 + 32 -\n                                      1), q_s_203575),\n                               sext_i32_i64(local_tid_233353 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_233353 -\n                                             skip_threads_233421) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_233422 && inactive_233423) {\n                        x_233411 = x_233413;\n                        x_233412 = x_233414;\n                    }\n                    if (thread_active_233422) {\n                        if (!inactive_233423) {\n                            double defunc_1_op_res_233415 = x_233411 + x_233413;\n                            double defunc_1_op_res_233416 = x_233412 + x_233414;\n                            \n                            x_233411 = defunc_1_op_res_233415;\n                            x_233412 = defunc_1_op_res_233416;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_233355, skip_threads_233421)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_233422) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) red_arr_mem_233404)[sext_i32_i64(local_tid_233353)] =\n                          ",
                   "  x_233411;\n                        x_233413 = x_233411;\n                        ((volatile __local\n                          double *) red_arr_mem_233406)[sext_i32_i64(local_tid_233353)] =\n                            x_233412;\n                        x_233414 = x_233412;\n                    }\n                }\n                if (sle32(wave_sizze_233355, skip_threads_233421)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_233421 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_233424 = squot32(local_tid_233353, 32) == 0 ||\n         !ltid_in_bounds_233417;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_233424) {\n                x_214027 = x_214025;\n                x_214028 = x_214026;\n                x_214025 = ((__local\n                             double *) red_arr_mem_233404)[sext_i32_i64(squot32(local_tid_233353,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_214026 = ((__local\n                             double *) red_arr_mem_233406)[sext_i32_i64(squot32(local_tid_233353,\n                                                                                32)) -\n                                                           (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_233425 = slt64(srem64(sext_i32_i64(local_tid_233353),\n                                                q_s_203575),\n                                         sext_i32_i64(local_tid_233353) -\n                                         sext_i32_i64(squot32(local_tid_233353,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_233424) {\n                if (inactive_233425) {\n             ",
                   "       x_214025 = x_214027;\n                    x_214026 = x_214028;\n                }\n            }\n            if (!no_carry_in_233424) {\n                if (!inactive_233425) {\n                    double defunc_1_op_res_214029 = x_214025 + x_214027;\n                    double defunc_1_op_res_214030 = x_214026 + x_214028;\n                    \n                    x_214025 = defunc_1_op_res_214029;\n                    x_214026 = defunc_1_op_res_214030;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_233424) {\n                ((__local\n                  double *) red_arr_mem_233404)[sext_i32_i64(local_tid_233353)] =\n                    x_214025;\n                ((__local\n                  double *) red_arr_mem_233406)[sext_i32_i64(local_tid_233353)] =\n                    x_214026;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_233353, 32) == 0 && ltid_in_bounds_233417) {\n            ((__local\n              double *) red_arr_mem_233404)[sext_i32_i64(local_tid_233353)] =\n                x_214027;\n            ((__local\n              double *) red_arr_mem_233406)[sext_i32_i64(local_tid_233353)] =\n                x_214028;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233426 = 0; i_233426 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233353),\n                                                    computed_group_sizze_213795);\n         i_233426++) {\n        double tmp_233427;\n        \n        tmp_233427 = ((__local double *) red_arr_mem_233404)[q_s_203575 -\n                                                             (int64_t) 1 +\n                                                             (i_233426 *\n                                                              computed_group_sizze_213795 +\n             ",
                   "                                                 sext_i32_i64(local_tid_233353)) *\n                                                             q_s_203575];\n        ((__local double *) color_232108)[i_233426 *\n                                          computed_group_sizze_213795 +\n                                          sext_i32_i64(local_tid_233353)] =\n            tmp_233427;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233428 = 0; i_233428 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233353),\n                                                    computed_group_sizze_213795);\n         i_233428++) {\n        double tmp_233429;\n        \n        tmp_233429 = ((__local double *) red_arr_mem_233406)[q_s_203575 -\n                                                             (int64_t) 1 +\n                                                             (i_233428 *\n                                                              computed_group_sizze_213795 +\n                                                              sext_i32_i64(local_tid_233353)) *\n                                                             q_s_203575];\n        ((__local double *) color_232107)[i_233428 *\n                                          computed_group_sizze_213795 +\n                                          sext_i32_i64(local_tid_233353)] =\n            tmp_233429;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233430 = 0; i_233430 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233353),\n                                                    computed_group_sizze_213795);\n         i_233430++) {\n        double tmp_233431;\n        \n        tmp_233431 = ((__local double *) color_232108)[i_233430 *\n                                                       computed_group_sizze_213795 +\n                                                       sext_",
                   "i32_i64(local_tid_233353)];\n        ((__global double *) mem_230059)[gtid_213924 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_213925 * s_n_m_203726 +\n                                         (i_233430 *\n                                          computed_group_sizze_213795 +\n                                          sext_i32_i64(local_tid_233353))] =\n            tmp_233431;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233432 = 0; i_233432 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233353),\n                                                    computed_group_sizze_213795);\n         i_233432++) {\n        double tmp_233433;\n        \n        tmp_233433 = ((__local double *) color_232107)[i_233432 *\n                                                       computed_group_sizze_213795 +\n                                                       sext_i32_i64(local_tid_233353)];\n        ((__global double *) mem_230064)[gtid_213924 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_213925 * s_n_m_203726 +\n                                         (i_233432 *\n                                          computed_group_sizze_213795 +\n                                          sext_i32_i64(local_tid_233353))] =\n            tmp_233433;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_6:\n    return;\n}\n__kernel void mainzisegmap_intragroup_216501(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *red_arr_mem_233801_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *red_arr_mem_233799_backing_aligned_1,\n                                             __local volatile\n            ",
                   "                                 int64_t *red_arr_mem_233757_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *red_arr_mem_233755_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *red_arr_mem_233753_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *red_arr_mem_233751_backing_aligned_5,\n                                             __local volatile\n                                             int64_t *red_arr_mem_233749_backing_aligned_6,\n                                             __local volatile\n                                             int64_t *color_232130_backing_aligned_7,\n                                             __local volatile\n                                             int64_t *color_232129_backing_aligned_8,\n                                             __local volatile\n                                             int64_t *color_232128_backing_aligned_9,\n                                             __local volatile\n                                             int64_t *color_232127_backing_aligned_10,\n                                             __local volatile\n                                             int64_t *color_232126_backing_aligned_11,\n                                             __local volatile\n                                             int64_t *color_232125_backing_aligned_12,\n                                             __local volatile\n                                             int64_t *color_232124_backing_aligned_13,\n                                             __local volatile\n                                             int64_t *color_232123_backing_aligned_14,\n                                             __local volatile\n                                             int64_t ",
                   "*color_232122_backing_aligned_15,\n                                             __local volatile\n                                             int64_t *color_232121_backing_aligned_16,\n                                             __local volatile\n                                             int64_t *color_232120_backing_aligned_17,\n                                             __local volatile\n                                             int64_t *color_232119_backing_aligned_18,\n                                             int64_t n_p_203574,\n                                             int64_t q_s_203575,\n                                             int64_t jump_s_203581,\n                                             int64_t partition_sizze_203667,\n                                             int64_t defunc_0_f_res_203721,\n                                             int64_t pad_css_len_203722,\n                                             int64_t s_n_m_203726,\n                                             int64_t computed_group_sizze_216338,\n                                             __global\n                                             unsigned char *ext_mem_229372,\n                                             __global\n                                             unsigned char *ext_mem_229373,\n                                             __global\n                                             unsigned char *ext_mem_229470,\n                                             __global\n                                             unsigned char *ext_mem_229471,\n                                             __global unsigned char *mem_229634,\n                                             __global unsigned char *mem_229639,\n                                             __global unsigned char *mem_230398,\n                                             __global unsigned char *mem_230403)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __loca",
                   "l volatile unsigned char *restrict red_arr_mem_233801_backing_18 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233801_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_233799_backing_17 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233799_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_233757_backing_16 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233757_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_233755_backing_15 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233755_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_233753_backing_14 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233753_backing_aligned_4;\n    __local volatile unsigned char *restrict red_arr_mem_233751_backing_13 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233751_backing_aligned_5;\n    __local volatile unsigned char *restrict red_arr_mem_233749_backing_12 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233749_backing_aligned_6;\n    __local volatile unsigned char *restrict color_232130_backing_11 =\n                                   (__local volatile\n                                    unsigned char *) color_232130_backing_aligned_7;\n    __local volatile unsigned char *restrict color_232129_backing_10 =\n                                   (__local volatile\n                                    unsigned char *) color_232129_backing_aligned_8;\n    __local volatile unsigned char *restrict ",
                   "color_232128_backing_9 =\n                                   (__local volatile\n                                    unsigned char *) color_232128_backing_aligned_9;\n    __local volatile unsigned char *restrict color_232127_backing_8 =\n                                   (__local volatile\n                                    unsigned char *) color_232127_backing_aligned_10;\n    __local volatile unsigned char *restrict color_232126_backing_7 =\n                                   (__local volatile\n                                    unsigned char *) color_232126_backing_aligned_11;\n    __local volatile unsigned char *restrict color_232125_backing_6 =\n                                   (__local volatile\n                                    unsigned char *) color_232125_backing_aligned_12;\n    __local volatile unsigned char *restrict color_232124_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) color_232124_backing_aligned_13;\n    __local volatile unsigned char *restrict color_232123_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) color_232123_backing_aligned_14;\n    __local volatile unsigned char *restrict color_232122_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) color_232122_backing_aligned_15;\n    __local volatile unsigned char *restrict color_232121_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) color_232121_backing_aligned_16;\n    __local volatile unsigned char *restrict color_232120_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_232120_backing_aligned_17;\n    __local volatile unsigned char *restrict color_232119_backing_0 =\n                                   (__local volatile\n                                    unsign",
                   "ed char *) color_232119_backing_aligned_18;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233731;\n    int32_t local_tid_233732;\n    int64_t group_sizze_233735;\n    int32_t wave_sizze_233734;\n    int32_t group_tid_233733;\n    \n    global_tid_233731 = get_global_id(0);\n    local_tid_233732 = get_local_id(0);\n    group_sizze_233735 = get_local_size(0);\n    wave_sizze_233734 = LOCKSTEP_WIDTH;\n    group_tid_233733 = get_group_id(0);\n    \n    int32_t phys_tid_216501 = group_tid_233733;\n    int64_t slice_233737 = s_n_m_203726;\n    int64_t ltid_pre_233736 = sext_i32_i64(local_tid_233732);\n    int64_t remnant_233738 = sext_i32_i64(local_tid_233732) - ltid_pre_233736;\n    int64_t slice_233741 = q_s_203575;\n    int64_t slice_233742 = s_n_m_203726 * slice_233741;\n    int64_t ltid_pre_233739 = squot64(sext_i32_i64(local_tid_233732),\n                                      slice_233741);\n    int64_t remnant_233743 = sext_i32_i64(local_tid_233732) - ltid_pre_233739 *\n            slice_233741;\n    int64_t ltid_pre_233740 = remnant_233743;\n    int64_t remnant_233744 = remnant_233743 - ltid_pre_233740;\n    int64_t slice_233745 = n_p_203574;\n    int64_t slice_233746 = partition_sizze_203667 * slice_233745;\n    int64_t gtid_216499 = squot64(sext_i32_i64(group_tid_233733), slice_233745);\n    int64_t remnant_233747 = sext_i32_i64(group_tid_233733) - gtid_216499 *\n            slice_233745;\n    int64_t gtid_216500 = remnant_233747;\n    int64_t remnant_233748 = remnant_233747 - gtid_216500;\n    __local unsigned char *color_232119;\n    \n    color_232119 = (__local unsigned char *) color_232119_backing_0;\n    \n    __local unsigned char *color_232120;\n    \n    color_232120 = (__local unsigned char *) color_232120_backing_1;\n    \n    __local unsigned char *color_232121;\n    \n    color_232121 = (__local unsigned char *) color_232121_backing_2;\n    \n    __local unsigned char *color_232122;\n    \n    color_232122 = (__local unsigned char *) color_232122_backing_3;\n   ",
                   " \n    __local unsigned char *color_232123;\n    \n    color_232123 = (__local unsigned char *) color_232123_backing_4;\n    \n    __local unsigned char *color_232124;\n    \n    color_232124 = (__local unsigned char *) color_232124_backing_5;\n    \n    __local unsigned char *color_232125;\n    \n    color_232125 = (__local unsigned char *) color_232125_backing_6;\n    \n    __local unsigned char *color_232126;\n    \n    color_232126 = (__local unsigned char *) color_232126_backing_7;\n    \n    __local unsigned char *color_232127;\n    \n    color_232127 = (__local unsigned char *) color_232127_backing_8;\n    \n    __local unsigned char *color_232128;\n    \n    color_232128 = (__local unsigned char *) color_232128_backing_9;\n    \n    __local unsigned char *color_232129;\n    \n    color_232129 = (__local unsigned char *) color_232129_backing_10;\n    \n    __local unsigned char *color_232130;\n    \n    color_232130 = (__local unsigned char *) color_232130_backing_11;\n    \n    int64_t x_216508;\n    \n    x_216508 = ((__global int64_t *) ext_mem_229372)[gtid_216499 * n_p_203574 +\n                                                     gtid_216500];\n    \n    int64_t gtid_216515 = sext_i32_i64(sext_i64_i32(ltid_pre_233736));\n    int32_t phys_tid_216516 = local_tid_233732;\n    \n    if (slt64(gtid_216515, s_n_m_203726)) {\n        bool cond_216518 = gtid_216515 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_216519;\n        \n        if (cond_216518) {\n            defunc_0_m_fun_res_216519 = (int64_t) 0;\n        } else {\n            int64_t y_216520 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_216521 = gtid_216515 == y_216520;\n            int64_t defunc_0_m_fun_res_f_res_216522;\n            \n            if (cond_216521) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_216523 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_216522 =\n                    defunc_0_m_fun_res_f_res_t_res_216523;\n            }",
                   " else {\n                int64_t x_216524 = sub64(gtid_216515, (int64_t) 1);\n                int64_t x_216525 = mul64(jump_s_203581, x_216524);\n                int64_t min_arg_216526 = add64((int64_t) 1, x_216525);\n                int64_t min_res_216527 = smin64(defunc_0_f_res_203721,\n                                                min_arg_216526);\n                \n                defunc_0_m_fun_res_f_res_216522 = min_res_216527;\n            }\n            defunc_0_m_fun_res_216519 = defunc_0_m_fun_res_f_res_216522;\n        }\n        ((__local int64_t *) color_232121)[gtid_216515] =\n            defunc_0_m_fun_res_216519;\n        ((__local bool *) color_232130)[gtid_216515] = cond_216518;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_216533 = sext_i32_i64(sext_i64_i32(ltid_pre_233739));\n    int64_t gtid_216534 = sext_i32_i64(sext_i64_i32(ltid_pre_233740));\n    int32_t phys_tid_216535 = local_tid_233732;\n    __local unsigned char *red_arr_mem_233749;\n    \n    red_arr_mem_233749 = (__local\n                          unsigned char *) red_arr_mem_233749_backing_12;\n    \n    __local unsigned char *red_arr_mem_233751;\n    \n    red_arr_mem_233751 = (__local\n                          unsigned char *) red_arr_mem_233751_backing_13;\n    \n    __local unsigned char *red_arr_mem_233753;\n    \n    red_arr_mem_233753 = (__local\n                          unsigned char *) red_arr_mem_233753_backing_14;\n    \n    __local unsigned char *red_arr_mem_233755;\n    \n    red_arr_mem_233755 = (__local\n                          unsigned char *) red_arr_mem_233755_backing_15;\n    \n    __local unsigned char *red_arr_mem_233757;\n    \n    red_arr_mem_233757 = (__local\n                          unsigned char *) red_arr_mem_233757_backing_16;\n    if (slt64(gtid_216533, s_n_m_203726) && slt64(gtid_216534, q_s_203575)) {\n        int64_t x_216551;\n        \n        x_216551 = ((__global int64_t *) ext_mem_229471)[gtid_216499 *\n                                                         (s_n_m_20",
                   "3726 *\n                                                          n_p_203574) +\n                                                         gtid_216500 *\n                                                         s_n_m_203726 +\n                                                         gtid_216533];\n        \n        double x_216552;\n        \n        x_216552 = ((__global double *) ext_mem_229470)[gtid_216499 *\n                                                        (s_n_m_203726 *\n                                                         n_p_203574) +\n                                                        gtid_216500 *\n                                                        s_n_m_203726 +\n                                                        gtid_216533];\n        \n        int64_t defunc_0_m_fun_res_216553;\n        \n        defunc_0_m_fun_res_216553 = ((__local\n                                      int64_t *) color_232121)[gtid_216533];\n        \n        bool cond_216555 = sle64(x_216508, gtid_216534);\n        int64_t defunc_0_f_res_216556;\n        \n        if (cond_216555) {\n            defunc_0_f_res_216556 = (int64_t) 0;\n        } else {\n            int64_t i_216557 = add64(gtid_216534, x_216551);\n            int64_t defunc_0_add_arg_216558;\n            \n            defunc_0_add_arg_216558 = ((__global\n                                        int64_t *) ext_mem_229373)[gtid_216499 *\n                                                                   (defunc_0_f_res_203721 *\n                                                                    n_p_203574) +\n                                                                   gtid_216500 *\n                                                                   defunc_0_f_res_203721 +\n                                                                   i_216557];\n            \n            int64_t defunc_1_add_res_216559 = add64((int64_t) 1,\n                                                    defunc_0_add_arg_216558);\n            \n       ",
                   "     defunc_0_f_res_216556 = defunc_1_add_res_216559;\n        }\n        \n        double defunc_0_f_res_216560;\n        \n        if (cond_216555) {\n            defunc_0_f_res_216560 = 0.0;\n        } else {\n            int64_t i_216561 = add64(gtid_216534, x_216551);\n            double defunc_0_add_arg_216562;\n            \n            defunc_0_add_arg_216562 = ((__global\n                                        double *) mem_229639)[gtid_216499 *\n                                                              (defunc_0_f_res_203721 *\n                                                               n_p_203574) +\n                                                              gtid_216500 *\n                                                              defunc_0_f_res_203721 +\n                                                              i_216561];\n            defunc_0_f_res_216560 = defunc_0_add_arg_216562;\n        }\n        \n        int64_t binop_p_216563 = sub64(defunc_0_f_res_216556,\n                                       defunc_0_m_fun_res_216553);\n        double defunc_0_f_res_216564 = sitofp_i64_f64(binop_p_216563);\n        double abs_res_216565 = fabs(defunc_0_f_res_216564);\n        double tmp1_216566 = abs_res_216565 / x_216552;\n        double x_216567 = tmp1_216566 * tmp1_216566;\n        double y_216568 = tmp1_216566 * x_216567;\n        double tmp2_216569 = 1.0 - y_216568;\n        double x_216570 = tmp2_216569 * tmp2_216569;\n        double tmp3_216571 = tmp2_216569 * x_216570;\n        double w_j_216572 = defunc_0_f_res_216560 * tmp3_216571;\n        double xw_j_216573 = defunc_0_f_res_216564 * w_j_216572;\n        double x2w_j_216574 = defunc_0_f_res_216564 * xw_j_216573;\n        double x3w_j_216575 = defunc_0_f_res_216564 * x2w_j_216574;\n        double x4w_j_216576 = defunc_0_f_res_216564 * x3w_j_216575;\n        \n        ((__local double *) red_arr_mem_233749)[gtid_216533 * q_s_203575 +\n                                                gtid_216534] = w_j_216572;\n        ((",
                   "__local double *) red_arr_mem_233751)[gtid_216533 * q_s_203575 +\n                                                gtid_216534] = xw_j_216573;\n        ((__local double *) red_arr_mem_233753)[gtid_216533 * q_s_203575 +\n                                                gtid_216534] = x2w_j_216574;\n        ((__local double *) red_arr_mem_233755)[gtid_216533 * q_s_203575 +\n                                                gtid_216534] = x3w_j_216575;\n        ((__local double *) red_arr_mem_233757)[gtid_216533 * q_s_203575 +\n                                                gtid_216534] = x4w_j_216576;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_233759 = s_n_m_203726 * q_s_203575;\n    double x_216536;\n    double x_216537;\n    double x_216538;\n    double x_216539;\n    double x_216540;\n    double x_216541;\n    double x_216542;\n    double x_216543;\n    double x_216544;\n    double x_216545;\n    double x_233765;\n    double x_233766;\n    double x_233767;\n    double x_233768;\n    double x_233769;\n    double x_233770;\n    double x_233771;\n    double x_233772;\n    double x_233773;\n    double x_233774;\n    bool ltid_in_bounds_233780 = slt64(sext_i32_i64(local_tid_233732),\n                                       s_n_m_203726 * q_s_203575);\n    int32_t skip_threads_233781;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_233780) {\n            x_216541 = ((volatile __local\n                         double *) red_arr_mem_233749)[sext_i32_i64(local_tid_233732)];\n            x_216542 = ((volatile __local\n                         double *) red_arr_mem_233751)[sext_i32_i64(local_tid_233732)];\n            x_216543 = ((volatile __local\n                         double *) red_arr_mem_233753)[sext_i32_i64(local_tid_233732)];\n            x_216544 = ((volatile __local\n                         double *) red_arr_mem_233755)[sext_i32_i64(local_tid_233732)];\n            x_216545 = ((volatile __local\n                         double *) red_arr_mem_233757)[sext_i32",
                   "_i64(local_tid_233732)];\n            if ((local_tid_233732 - squot32(local_tid_233732, 32) * 32) == 0) {\n                x_216536 = x_216541;\n                x_216537 = x_216542;\n                x_216538 = x_216543;\n                x_216539 = x_216544;\n                x_216540 = x_216545;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_233781 = 1;\n        while (slt32(skip_threads_233781, 32)) {\n            bool thread_active_233782 = sle32(skip_threads_233781,\n                                              local_tid_233732 -\n                                              squot32(local_tid_233732, 32) *\n                                              32) && ltid_in_bounds_233780;\n            \n            if (thread_active_233782) {\n                // read operands\n                {\n                    x_216536 = ((volatile __local\n                                 double *) red_arr_mem_233749)[sext_i32_i64(local_tid_233732) -\n                                                               sext_i32_i64(skip_threads_233781)];\n                    x_216537 = ((volatile __local\n                                 double *) red_arr_mem_233751)[sext_i32_i64(local_tid_233732) -\n                                                               sext_i32_i64(skip_threads_233781)];\n                    x_216538 = ((volatile __local\n                                 double *) red_arr_mem_233753)[sext_i32_i64(local_tid_233732) -\n                                                               sext_i32_i64(skip_threads_233781)];\n                    x_216539 = ((volatile __local\n                                 double *) red_arr_mem_233755)[sext_i32_i64(local_tid_233732) -\n                                                               sext_i32_i64(skip_threads_233781)];\n                    x_216540 = ((volatile __local\n                                 double *) red_arr_mem_233757)[sext_i32_i64(local_tid_233732) -\n                        ",
                   "                                       sext_i32_i64(skip_threads_233781)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_233783 =\n                     slt64(srem64(sext_i32_i64(local_tid_233732), q_s_203575),\n                           sext_i32_i64(local_tid_233732) -\n                           sext_i32_i64(local_tid_233732 -\n                           skip_threads_233781));\n                \n                if (thread_active_233782 && inactive_233783) {\n                    x_216536 = x_216541;\n                    x_216537 = x_216542;\n                    x_216538 = x_216543;\n                    x_216539 = x_216544;\n                    x_216540 = x_216545;\n                }\n                if (thread_active_233782) {\n                    if (!inactive_233783) {\n                        double defunc_1_op_res_216546 = x_216536 + x_216541;\n                        double defunc_1_op_res_216547 = x_216537 + x_216542;\n                        double defunc_1_op_res_216548 = x_216538 + x_216543;\n                        double defunc_1_op_res_216549 = x_216539 + x_216544;\n                        double defunc_1_op_res_216550 = x_216540 + x_216545;\n                        \n                        x_216536 = defunc_1_op_res_216546;\n                        x_216537 = defunc_1_op_res_216547;\n                        x_216538 = defunc_1_op_res_216548;\n                        x_216539 = defunc_1_op_res_216549;\n                        x_216540 = defunc_1_op_res_216550;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_233734, skip_threads_233781)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_233782) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233749)[sext_i32_i64(local_tid_233732)] =\n                        x_216536;\n                    x_216541 = x_21",
                   "6536;\n                    ((volatile __local\n                      double *) red_arr_mem_233751)[sext_i32_i64(local_tid_233732)] =\n                        x_216537;\n                    x_216542 = x_216537;\n                    ((volatile __local\n                      double *) red_arr_mem_233753)[sext_i32_i64(local_tid_233732)] =\n                        x_216538;\n                    x_216543 = x_216538;\n                    ((volatile __local\n                      double *) red_arr_mem_233755)[sext_i32_i64(local_tid_233732)] =\n                        x_216539;\n                    x_216544 = x_216539;\n                    ((volatile __local\n                      double *) red_arr_mem_233757)[sext_i32_i64(local_tid_233732)] =\n                        x_216540;\n                    x_216545 = x_216540;\n                }\n            }\n            if (sle32(wave_sizze_233734, skip_threads_233781)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_233781 *= 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_233732 - squot32(local_tid_233732, 32) * 32) == 31 &&\n            ltid_in_bounds_233780) {\n            ((volatile __local\n              double *) red_arr_mem_233749)[sext_i32_i64(squot32(local_tid_233732,\n                                                                 32))] =\n                x_216536;\n            ((volatile __local\n              double *) red_arr_mem_233751)[sext_i32_i64(squot32(local_tid_233732,\n                                                                 32))] =\n                x_216537;\n            ((volatile __local\n              double *) red_arr_mem_233753)[sext_i32_i64(squot32(local_tid_233732,\n                                                                 32))] =\n                x_216538;\n            ((volatile __local\n              double *) red_arr_mem_233755)[sext_i32_i64(squot32(local_tid_233732,\n            ",
                   "                                                     32))] =\n                x_216539;\n            ((volatile __local\n              double *) red_arr_mem_233757)[sext_i32_i64(squot32(local_tid_233732,\n                                                                 32))] =\n                x_216540;\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_233784;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_233732, 32) == 0 && ltid_in_bounds_233780) {\n                x_233770 = ((volatile __local\n                             double *) red_arr_mem_233749)[sext_i32_i64(local_tid_233732)];\n                x_233771 = ((volatile __local\n                             double *) red_arr_mem_233751)[sext_i32_i64(local_tid_233732)];\n                x_233772 = ((volatile __local\n                             double *) red_arr_mem_233753)[sext_i32_i64(local_tid_233732)];\n                x_233773 = ((volatile __local\n                             double *) red_arr_mem_233755)[sext_i32_i64(local_tid_233732)];\n                x_233774 = ((volatile __local\n                             double *) red_arr_mem_233757)[sext_i32_i64(local_tid_233732)];\n                if ((local_tid_233732 - squot32(local_tid_233732, 32) * 32) ==\n                    0) {\n                    x_233765 = x_233770;\n                    x_233766 = x_233771;\n                    x_233767 = x_233772;\n                    x_233768 = x_233773;\n                    x_233769 = x_233774;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_233784 = 1;\n            while (slt32(skip_threads_233784, 32)) {\n                bool thread_active_233785 = sle32(skip_threads_233784,\n                                                  local_tid_233732 -\n                                              ",
                   "    squot32(local_tid_233732,\n                                                          32) * 32) &&\n                     (squot32(local_tid_233732, 32) == 0 &&\n                      ltid_in_bounds_233780);\n                \n                if (thread_active_233785) {\n                    // read operands\n                    {\n                        x_233765 = ((volatile __local\n                                     double *) red_arr_mem_233749)[sext_i32_i64(local_tid_233732) -\n                                                                   sext_i32_i64(skip_threads_233784)];\n                        x_233766 = ((volatile __local\n                                     double *) red_arr_mem_233751)[sext_i32_i64(local_tid_233732) -\n                                                                   sext_i32_i64(skip_threads_233784)];\n                        x_233767 = ((volatile __local\n                                     double *) red_arr_mem_233753)[sext_i32_i64(local_tid_233732) -\n                                                                   sext_i32_i64(skip_threads_233784)];\n                        x_233768 = ((volatile __local\n                                     double *) red_arr_mem_233755)[sext_i32_i64(local_tid_233732) -\n                                                                   sext_i32_i64(skip_threads_233784)];\n                        x_233769 = ((volatile __local\n                                     double *) red_arr_mem_233757)[sext_i32_i64(local_tid_233732) -\n                                                                   sext_i32_i64(skip_threads_233784)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_233786 =\n                         slt64(srem64(sext_i32_i64(local_tid_233732 * 32 + 32 -\n                                      1), q_s_203575),\n                               sext_i32_i64(local_tid_233732 * 32 + 32 - 1) -\n                               sext_i",
                   "32_i64((local_tid_233732 -\n                                             skip_threads_233784) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_233785 && inactive_233786) {\n                        x_233765 = x_233770;\n                        x_233766 = x_233771;\n                        x_233767 = x_233772;\n                        x_233768 = x_233773;\n                        x_233769 = x_233774;\n                    }\n                    if (thread_active_233785) {\n                        if (!inactive_233786) {\n                            double defunc_1_op_res_233775 = x_233765 + x_233770;\n                            double defunc_1_op_res_233776 = x_233766 + x_233771;\n                            double defunc_1_op_res_233777 = x_233767 + x_233772;\n                            double defunc_1_op_res_233778 = x_233768 + x_233773;\n                            double defunc_1_op_res_233779 = x_233769 + x_233774;\n                            \n                            x_233765 = defunc_1_op_res_233775;\n                            x_233766 = defunc_1_op_res_233776;\n                            x_233767 = defunc_1_op_res_233777;\n                            x_233768 = defunc_1_op_res_233778;\n                            x_233769 = defunc_1_op_res_233779;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_233734, skip_threads_233784)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_233785) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) red_arr_mem_233749)[sext_i32_i64(local_tid_233732)] =\n                            x_233765;\n                        x_233770 = x_233765;\n                        ((volatile __local\n                          double *) red_arr_mem_233751)[sext_i32_i64(local_tid_233732)] =\n                         ",
                   "   x_233766;\n                        x_233771 = x_233766;\n                        ((volatile __local\n                          double *) red_arr_mem_233753)[sext_i32_i64(local_tid_233732)] =\n                            x_233767;\n                        x_233772 = x_233767;\n                        ((volatile __local\n                          double *) red_arr_mem_233755)[sext_i32_i64(local_tid_233732)] =\n                            x_233768;\n                        x_233773 = x_233768;\n                        ((volatile __local\n                          double *) red_arr_mem_233757)[sext_i32_i64(local_tid_233732)] =\n                            x_233769;\n                        x_233774 = x_233769;\n                    }\n                }\n                if (sle32(wave_sizze_233734, skip_threads_233784)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_233784 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_233787 = squot32(local_tid_233732, 32) == 0 ||\n         !ltid_in_bounds_233780;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_233787) {\n                x_216541 = x_216536;\n                x_216542 = x_216537;\n                x_216543 = x_216538;\n                x_216544 = x_216539;\n                x_216545 = x_216540;\n                x_216536 = ((__local\n                             double *) red_arr_mem_233749)[sext_i32_i64(squot32(local_tid_233732,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_216537 = ((__local\n                             double *) red_arr_mem_233751)[sext_i32_i64(squot32(local_tid_233732,\n                                                                                32)) -\n                                                           (int64_t) ",
                   "1];\n                x_216538 = ((__local\n                             double *) red_arr_mem_233753)[sext_i32_i64(squot32(local_tid_233732,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_216539 = ((__local\n                             double *) red_arr_mem_233755)[sext_i32_i64(squot32(local_tid_233732,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_216540 = ((__local\n                             double *) red_arr_mem_233757)[sext_i32_i64(squot32(local_tid_233732,\n                                                                                32)) -\n                                                           (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_233788 = slt64(srem64(sext_i32_i64(local_tid_233732),\n                                                q_s_203575),\n                                         sext_i32_i64(local_tid_233732) -\n                                         sext_i32_i64(squot32(local_tid_233732,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_233787) {\n                if (inactive_233788) {\n                    x_216536 = x_216541;\n                    x_216537 = x_216542;\n                    x_216538 = x_216543;\n                    x_216539 = x_216544;\n                    x_216540 = x_216545;\n                }\n            }\n            if (!no_carry_in_233787) {\n                if (!inactive_233788) {\n                    double defunc_1_op_res_216546 = x_216536 + x_216541;\n                    double defunc_1_op_res_216547 = x_216537 + x_216542;\n                    double defunc_1_op_res_216548 = x_216538 + x_216543;\n                    double defunc_1_op_res_216549",
                   " = x_216539 + x_216544;\n                    double defunc_1_op_res_216550 = x_216540 + x_216545;\n                    \n                    x_216536 = defunc_1_op_res_216546;\n                    x_216537 = defunc_1_op_res_216547;\n                    x_216538 = defunc_1_op_res_216548;\n                    x_216539 = defunc_1_op_res_216549;\n                    x_216540 = defunc_1_op_res_216550;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_233787) {\n                ((__local\n                  double *) red_arr_mem_233749)[sext_i32_i64(local_tid_233732)] =\n                    x_216536;\n                ((__local\n                  double *) red_arr_mem_233751)[sext_i32_i64(local_tid_233732)] =\n                    x_216537;\n                ((__local\n                  double *) red_arr_mem_233753)[sext_i32_i64(local_tid_233732)] =\n                    x_216538;\n                ((__local\n                  double *) red_arr_mem_233755)[sext_i32_i64(local_tid_233732)] =\n                    x_216539;\n                ((__local\n                  double *) red_arr_mem_233757)[sext_i32_i64(local_tid_233732)] =\n                    x_216540;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_233732, 32) == 0 && ltid_in_bounds_233780) {\n            ((__local\n              double *) red_arr_mem_233749)[sext_i32_i64(local_tid_233732)] =\n                x_216541;\n            ((__local\n              double *) red_arr_mem_233751)[sext_i32_i64(local_tid_233732)] =\n                x_216542;\n            ((__local\n              double *) red_arr_mem_233753)[sext_i32_i64(local_tid_233732)] =\n                x_216543;\n            ((__local\n              double *) red_arr_mem_233755)[sext_i32_i64(local_tid_233732)] =\n                x_216544;\n            ((__local\n              double *) red_arr_mem_233757)[sext_i32_i64(local_tid_233732)] =\n ",
                   "               x_216545;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233789 = 0; i_233789 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233732),\n                                                    computed_group_sizze_216338);\n         i_233789++) {\n        double tmp_233790;\n        \n        tmp_233790 = ((__local double *) red_arr_mem_233749)[q_s_203575 -\n                                                             (int64_t) 1 +\n                                                             (i_233789 *\n                                                              computed_group_sizze_216338 +\n                                                              sext_i32_i64(local_tid_233732)) *\n                                                             q_s_203575];\n        ((__local double *) color_232129)[i_233789 *\n                                          computed_group_sizze_216338 +\n                                          sext_i32_i64(local_tid_233732)] =\n            tmp_233790;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233791 = 0; i_233791 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233732),\n                                                    computed_group_sizze_216338);\n         i_233791++) {\n        double tmp_233792;\n        \n        tmp_233792 = ((__local double *) red_arr_mem_233751)[q_s_203575 -\n                                                             (int64_t) 1 +\n                                                             (i_233791 *\n                                                              computed_group_sizze_216338 +\n                                                              sext_i32_i64(local_tid_233732)) *\n                                                             q_s_203575];\n        ((__local double *) color_232128)[i_233791 *\n                     ",
                   "                     computed_group_sizze_216338 +\n                                          sext_i32_i64(local_tid_233732)] =\n            tmp_233792;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233793 = 0; i_233793 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233732),\n                                                    computed_group_sizze_216338);\n         i_233793++) {\n        double tmp_233794;\n        \n        tmp_233794 = ((__local double *) red_arr_mem_233753)[q_s_203575 -\n                                                             (int64_t) 1 +\n                                                             (i_233793 *\n                                                              computed_group_sizze_216338 +\n                                                              sext_i32_i64(local_tid_233732)) *\n                                                             q_s_203575];\n        ((__local double *) color_232127)[i_233793 *\n                                          computed_group_sizze_216338 +\n                                          sext_i32_i64(local_tid_233732)] =\n            tmp_233794;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233795 = 0; i_233795 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233732),\n                                                    computed_group_sizze_216338);\n         i_233795++) {\n        double tmp_233796;\n        \n        tmp_233796 = ((__local double *) red_arr_mem_233755)[q_s_203575 -\n                                                             (int64_t) 1 +\n                                                             (i_233795 *\n                                                              computed_group_sizze_216338 +\n                                                              sext_i32_i64(local_tid_233732)) *\n                                                             q_s_2",
                   "03575];\n        ((__local double *) color_232120)[i_233795 *\n                                          computed_group_sizze_216338 +\n                                          sext_i32_i64(local_tid_233732)] =\n            tmp_233796;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233797 = 0; i_233797 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233732),\n                                                    computed_group_sizze_216338);\n         i_233797++) {\n        double tmp_233798;\n        \n        tmp_233798 = ((__local double *) red_arr_mem_233757)[q_s_203575 -\n                                                             (int64_t) 1 +\n                                                             (i_233797 *\n                                                              computed_group_sizze_216338 +\n                                                              sext_i32_i64(local_tid_233732)) *\n                                                             q_s_203575];\n        ((__local double *) color_232119)[i_233797 *\n                                          computed_group_sizze_216338 +\n                                          sext_i32_i64(local_tid_233732)] =\n            tmp_233798;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_216583 = sext_i32_i64(sext_i64_i32(ltid_pre_233736));\n    int32_t phys_tid_216584 = local_tid_233732;\n    \n    if (slt64(gtid_216583, s_n_m_203726)) {\n        bool index_primexp_228817 = gtid_216583 == (int64_t) 0;\n        double defunc_2_reduce_res_216587;\n        \n        defunc_2_reduce_res_216587 = ((__local\n                                       double *) color_232129)[gtid_216583];\n        \n        double defunc_2_reduce_res_216588;\n        \n        defunc_2_reduce_res_216588 = ((__local\n                                       double *) color_232128)[gtid_216583];\n        \n        double defunc_2_reduce_res_216589;\n  ",
                   "      \n        defunc_2_reduce_res_216589 = ((__local\n                                       double *) color_232127)[gtid_216583];\n        \n        double defunc_2_reduce_res_216590;\n        \n        defunc_2_reduce_res_216590 = ((__local\n                                       double *) color_232120)[gtid_216583];\n        \n        double defunc_2_reduce_res_216591;\n        \n        defunc_2_reduce_res_216591 = ((__local\n                                       double *) color_232119)[gtid_216583];\n        \n        double x_216592 = defunc_2_reduce_res_216589 *\n               defunc_2_reduce_res_216591;\n        double y_216593 = defunc_2_reduce_res_216590 *\n               defunc_2_reduce_res_216590;\n        double a12_216594 = x_216592 - y_216593;\n        double x_216595 = defunc_2_reduce_res_216589 *\n               defunc_2_reduce_res_216590;\n        double y_216596 = defunc_2_reduce_res_216588 *\n               defunc_2_reduce_res_216591;\n        double b12_216597 = x_216595 - y_216596;\n        double x_216598 = defunc_2_reduce_res_216588 *\n               defunc_2_reduce_res_216590;\n        double y_216599 = defunc_2_reduce_res_216589 *\n               defunc_2_reduce_res_216589;\n        double c12_216600 = x_216598 - y_216599;\n        double x_216601 = defunc_2_reduce_res_216587 *\n               defunc_2_reduce_res_216591;\n        double b2_216602 = x_216601 - y_216599;\n        double x_216603 = defunc_2_reduce_res_216588 *\n               defunc_2_reduce_res_216589;\n        double y_216604 = defunc_2_reduce_res_216587 *\n               defunc_2_reduce_res_216590;\n        double c2_216605 = x_216603 - y_216604;\n        double x_216606 = defunc_2_reduce_res_216587 * a12_216594;\n        double y_216607 = defunc_2_reduce_res_216588 * b12_216597;\n        double x_216608 = x_216606 + y_216607;\n        double y_216609 = defunc_2_reduce_res_216589 * c12_216600;\n        double y_216610 = x_216608 + y_216609;\n        double det_216611 = 1.0 / y_216610;\n        double a12_216612 ",
                   "= a12_216594 * det_216611;\n        double b12_216613 = b12_216597 * det_216611;\n        double c12_216614 = c12_216600 * det_216611;\n        double b2_216615 = b2_216602 * det_216611;\n        double c2_216616 = c2_216605 * det_216611;\n        int64_t defunc_0_m_fun_res_216617;\n        \n        if (index_primexp_228817) {\n            defunc_0_m_fun_res_216617 = (int64_t) 0;\n        } else {\n            int64_t y_216618 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_216619 = gtid_216583 == y_216618;\n            int64_t defunc_0_m_fun_res_f_res_216620;\n            \n            if (cond_216619) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_216621 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_216620 =\n                    defunc_0_m_fun_res_f_res_t_res_216621;\n            } else {\n                int64_t x_216622 = sub64(gtid_216583, (int64_t) 1);\n                int64_t x_216623 = mul64(jump_s_203581, x_216622);\n                int64_t min_arg_216624 = add64((int64_t) 1, x_216623);\n                int64_t min_res_216625 = smin64(defunc_0_f_res_203721,\n                                                min_arg_216624);\n                \n                defunc_0_m_fun_res_f_res_216620 = min_res_216625;\n            }\n            defunc_0_m_fun_res_216617 = defunc_0_m_fun_res_f_res_216620;\n        }\n        ((__local double *) color_232126)[gtid_216583] = a12_216612;\n        ((__local double *) color_232125)[gtid_216583] = b12_216613;\n        ((__local double *) color_232124)[gtid_216583] = c12_216614;\n        ((__local double *) color_232123)[gtid_216583] = b2_216615;\n        ((__local double *) color_232122)[gtid_216583] = c2_216616;\n        ((__local int64_t *) color_232121)[gtid_216583] =\n            defunc_0_m_fun_res_216617;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_216628 = sext_i32_i64(sext_i64_i32(ltid_pre_233739));\n    int64_t gtid_216629 = sext_i32_i",
                   "64(sext_i64_i32(ltid_pre_233740));\n    int32_t phys_tid_216630 = local_tid_233732;\n    __local unsigned char *red_arr_mem_233799;\n    \n    red_arr_mem_233799 = (__local\n                          unsigned char *) red_arr_mem_233799_backing_17;\n    \n    __local unsigned char *red_arr_mem_233801;\n    \n    red_arr_mem_233801 = (__local\n                          unsigned char *) red_arr_mem_233801_backing_18;\n    if (slt64(gtid_216628, s_n_m_203726) && slt64(gtid_216629, q_s_203575)) {\n        int64_t x_216637;\n        \n        x_216637 = ((__global int64_t *) ext_mem_229471)[gtid_216499 *\n                                                         (s_n_m_203726 *\n                                                          n_p_203574) +\n                                                         gtid_216500 *\n                                                         s_n_m_203726 +\n                                                         gtid_216628];\n        \n        double x_216638;\n        \n        x_216638 = ((__global double *) ext_mem_229470)[gtid_216499 *\n                                                        (s_n_m_203726 *\n                                                         n_p_203574) +\n                                                        gtid_216500 *\n                                                        s_n_m_203726 +\n                                                        gtid_216628];\n        \n        double a12_216639;\n        \n        a12_216639 = ((__local double *) color_232126)[gtid_216628];\n        \n        double b12_216640;\n        \n        b12_216640 = ((__local double *) color_232125)[gtid_216628];\n        \n        double c12_216641;\n        \n        c12_216641 = ((__local double *) color_232124)[gtid_216628];\n        \n        double b2_216642;\n        \n        b2_216642 = ((__local double *) color_232123)[gtid_216628];\n        \n        double c2_216643;\n        \n        c2_216643 = ((__local double *) color_232122)[gtid_216628];\n        \n       ",
                   " int64_t defunc_0_m_fun_res_216644;\n        \n        defunc_0_m_fun_res_216644 = ((__local\n                                      int64_t *) color_232121)[gtid_216628];\n        \n        bool cond_216646 = sle64(x_216508, gtid_216629);\n        int64_t defunc_0_f_res_216647;\n        \n        if (cond_216646) {\n            defunc_0_f_res_216647 = (int64_t) 0;\n        } else {\n            int64_t i_216648 = add64(gtid_216629, x_216637);\n            int64_t defunc_0_add_arg_216649;\n            \n            defunc_0_add_arg_216649 = ((__global\n                                        int64_t *) ext_mem_229373)[gtid_216499 *\n                                                                   (defunc_0_f_res_203721 *\n                                                                    n_p_203574) +\n                                                                   gtid_216500 *\n                                                                   defunc_0_f_res_203721 +\n                                                                   i_216648];\n            \n            int64_t defunc_1_add_res_216650 = add64((int64_t) 1,\n                                                    defunc_0_add_arg_216649);\n            \n            defunc_0_f_res_216647 = defunc_1_add_res_216650;\n        }\n        \n        double defunc_0_f_res_216651;\n        \n        if (cond_216646) {\n            defunc_0_f_res_216651 = 0.0;\n        } else {\n            int64_t i_216652 = add64(gtid_216629, x_216637);\n            double defunc_0_add_arg_216653;\n            \n            defunc_0_add_arg_216653 = ((__global\n                                        double *) mem_229639)[gtid_216499 *\n                                                              (defunc_0_f_res_203721 *\n                                                               n_p_203574) +\n                                                              gtid_216500 *\n                                                              defunc_0_f_res_203721 +\n  ",
                   "                                                            i_216652];\n            defunc_0_f_res_216651 = defunc_0_add_arg_216653;\n        }\n        \n        int64_t binop_p_216654 = sub64(defunc_0_f_res_216647,\n                                       defunc_0_m_fun_res_216644);\n        double defunc_0_f_res_216655 = sitofp_i64_f64(binop_p_216654);\n        double abs_res_216656 = fabs(defunc_0_f_res_216655);\n        double tmp1_216657 = abs_res_216656 / x_216638;\n        double x_216658 = tmp1_216657 * tmp1_216657;\n        double y_216659 = tmp1_216657 * x_216658;\n        double tmp2_216660 = 1.0 - y_216659;\n        double x_216661 = tmp2_216660 * tmp2_216660;\n        double tmp3_216662 = tmp2_216660 * x_216661;\n        double tmp4_216663 = defunc_0_f_res_216651 * tmp3_216662;\n        double defunc_1_f_res_216664 = defunc_0_f_res_216655 * tmp4_216663;\n        double defunc_1_f_res_216665 = defunc_0_f_res_216655 *\n               defunc_1_f_res_216664;\n        double defunc_0_f_res_216666;\n        \n        if (cond_216646) {\n            defunc_0_f_res_216666 = 0.0;\n        } else {\n            int64_t i_216667 = add64(gtid_216629, x_216637);\n            double defunc_0_add_arg_216668;\n            \n            defunc_0_add_arg_216668 = ((__global\n                                        double *) mem_229634)[gtid_216499 *\n                                                              (defunc_0_f_res_203721 *\n                                                               n_p_203574) +\n                                                              gtid_216500 *\n                                                              defunc_0_f_res_203721 +\n                                                              i_216667];\n            defunc_0_f_res_216666 = defunc_0_add_arg_216668;\n        }\n        \n        double x_216669 = a12_216639 * tmp4_216663;\n        double y_216670 = b12_216640 * defunc_1_f_res_216664;\n        double x_216671 = x_216669 + y_216670;\n        double y_216",
                   "672 = c12_216641 * defunc_1_f_res_216665;\n        double x_216673 = x_216671 + y_216672;\n        double defunc_9_fit_fun_res_216674 = defunc_0_f_res_216666 * x_216673;\n        double x_216675 = b12_216640 * tmp4_216663;\n        double y_216676 = b2_216642 * defunc_1_f_res_216664;\n        double x_216677 = x_216675 + y_216676;\n        double y_216678 = c2_216643 * defunc_1_f_res_216665;\n        double x_216679 = x_216677 + y_216678;\n        double defunc_9_slope_fun_res_216680 = defunc_0_f_res_216666 * x_216679;\n        \n        ((__local double *) red_arr_mem_233799)[gtid_216628 * q_s_203575 +\n                                                gtid_216629] =\n            defunc_9_fit_fun_res_216674;\n        ((__local double *) red_arr_mem_233801)[gtid_216628 * q_s_203575 +\n                                                gtid_216629] =\n            defunc_9_slope_fun_res_216680;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_233803 = s_n_m_203726 * q_s_203575;\n    double x_216631;\n    double x_216632;\n    double x_216633;\n    double x_216634;\n    double x_233806;\n    double x_233807;\n    double x_233808;\n    double x_233809;\n    bool ltid_in_bounds_233812 = slt64(sext_i32_i64(local_tid_233732),\n                                       s_n_m_203726 * q_s_203575);\n    int32_t skip_threads_233813;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_233812) {\n            x_216633 = ((volatile __local\n                         double *) red_arr_mem_233799)[sext_i32_i64(local_tid_233732)];\n            x_216634 = ((volatile __local\n                         double *) red_arr_mem_233801)[sext_i32_i64(local_tid_233732)];\n            if ((local_tid_233732 - squot32(local_tid_233732, 32) * 32) == 0) {\n                x_216631 = x_216633;\n                x_216632 = x_216634;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_233813 = 1;\n        while (slt32(skip_threads_233813, 32)) {\n    ",
                   "        bool thread_active_233814 = sle32(skip_threads_233813,\n                                              local_tid_233732 -\n                                              squot32(local_tid_233732, 32) *\n                                              32) && ltid_in_bounds_233812;\n            \n            if (thread_active_233814) {\n                // read operands\n                {\n                    x_216631 = ((volatile __local\n                                 double *) red_arr_mem_233799)[sext_i32_i64(local_tid_233732) -\n                                                               sext_i32_i64(skip_threads_233813)];\n                    x_216632 = ((volatile __local\n                                 double *) red_arr_mem_233801)[sext_i32_i64(local_tid_233732) -\n                                                               sext_i32_i64(skip_threads_233813)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_233815 =\n                     slt64(srem64(sext_i32_i64(local_tid_233732), q_s_203575),\n                           sext_i32_i64(local_tid_233732) -\n                           sext_i32_i64(local_tid_233732 -\n                           skip_threads_233813));\n                \n                if (thread_active_233814 && inactive_233815) {\n                    x_216631 = x_216633;\n                    x_216632 = x_216634;\n                }\n                if (thread_active_233814) {\n                    if (!inactive_233815) {\n                        double defunc_1_op_res_216635 = x_216631 + x_216633;\n                        double defunc_1_op_res_216636 = x_216632 + x_216634;\n                        \n                        x_216631 = defunc_1_op_res_216635;\n                        x_216632 = defunc_1_op_res_216636;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_233734, skip_threads_233813)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if",
                   " (thread_active_233814) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233799)[sext_i32_i64(local_tid_233732)] =\n                        x_216631;\n                    x_216633 = x_216631;\n                    ((volatile __local\n                      double *) red_arr_mem_233801)[sext_i32_i64(local_tid_233732)] =\n                        x_216632;\n                    x_216634 = x_216632;\n                }\n            }\n            if (sle32(wave_sizze_233734, skip_threads_233813)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_233813 *= 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_233732 - squot32(local_tid_233732, 32) * 32) == 31 &&\n            ltid_in_bounds_233812) {\n            ((volatile __local\n              double *) red_arr_mem_233799)[sext_i32_i64(squot32(local_tid_233732,\n                                                                 32))] =\n                x_216631;\n            ((volatile __local\n              double *) red_arr_mem_233801)[sext_i32_i64(squot32(local_tid_233732,\n                                                                 32))] =\n                x_216632;\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_233816;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_233732, 32) == 0 && ltid_in_bounds_233812) {\n                x_233808 = ((volatile __local\n                             double *) red_arr_mem_233799)[sext_i32_i64(local_tid_233732)];\n                x_233809 = ((volatile __local\n                             double *) red_arr_mem_233801)[sext_i32_i64(local_tid_233732)];\n                if ((local_tid_233732 - squot32(local_tid_233732, 32) * 32) ",
                   "==\n                    0) {\n                    x_233806 = x_233808;\n                    x_233807 = x_233809;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_233816 = 1;\n            while (slt32(skip_threads_233816, 32)) {\n                bool thread_active_233817 = sle32(skip_threads_233816,\n                                                  local_tid_233732 -\n                                                  squot32(local_tid_233732,\n                                                          32) * 32) &&\n                     (squot32(local_tid_233732, 32) == 0 &&\n                      ltid_in_bounds_233812);\n                \n                if (thread_active_233817) {\n                    // read operands\n                    {\n                        x_233806 = ((volatile __local\n                                     double *) red_arr_mem_233799)[sext_i32_i64(local_tid_233732) -\n                                                                   sext_i32_i64(skip_threads_233816)];\n                        x_233807 = ((volatile __local\n                                     double *) red_arr_mem_233801)[sext_i32_i64(local_tid_233732) -\n                                                                   sext_i32_i64(skip_threads_233816)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_233818 =\n                         slt64(srem64(sext_i32_i64(local_tid_233732 * 32 + 32 -\n                                      1), q_s_203575),\n                               sext_i32_i64(local_tid_233732 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_233732 -\n                                             skip_threads_233816) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_233817 && inactive_233818) {\n                        x_233806 = x_233808;\n   ",
                   "                     x_233807 = x_233809;\n                    }\n                    if (thread_active_233817) {\n                        if (!inactive_233818) {\n                            double defunc_1_op_res_233810 = x_233806 + x_233808;\n                            double defunc_1_op_res_233811 = x_233807 + x_233809;\n                            \n                            x_233806 = defunc_1_op_res_233810;\n                            x_233807 = defunc_1_op_res_233811;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_233734, skip_threads_233816)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_233817) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) red_arr_mem_233799)[sext_i32_i64(local_tid_233732)] =\n                            x_233806;\n                        x_233808 = x_233806;\n                        ((volatile __local\n                          double *) red_arr_mem_233801)[sext_i32_i64(local_tid_233732)] =\n                            x_233807;\n                        x_233809 = x_233807;\n                    }\n                }\n                if (sle32(wave_sizze_233734, skip_threads_233816)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_233816 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_233819 = squot32(local_tid_233732, 32) == 0 ||\n         !ltid_in_bounds_233812;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_233819) {\n                x_216633 = x_216631;\n                x_216634 = x_216632;\n                x_216631 = ((__local\n                             double *) red_arr_mem_233799)[sext_i32_i64(squot32(local_tid_233732,\n                                                      ",
                   "                          32)) -\n                                                           (int64_t) 1];\n                x_216632 = ((__local\n                             double *) red_arr_mem_233801)[sext_i32_i64(squot32(local_tid_233732,\n                                                                                32)) -\n                                                           (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_233820 = slt64(srem64(sext_i32_i64(local_tid_233732),\n                                                q_s_203575),\n                                         sext_i32_i64(local_tid_233732) -\n                                         sext_i32_i64(squot32(local_tid_233732,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_233819) {\n                if (inactive_233820) {\n                    x_216631 = x_216633;\n                    x_216632 = x_216634;\n                }\n            }\n            if (!no_carry_in_233819) {\n                if (!inactive_233820) {\n                    double defunc_1_op_res_216635 = x_216631 + x_216633;\n                    double defunc_1_op_res_216636 = x_216632 + x_216634;\n                    \n                    x_216631 = defunc_1_op_res_216635;\n                    x_216632 = defunc_1_op_res_216636;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_233819) {\n                ((__local\n                  double *) red_arr_mem_233799)[sext_i32_i64(local_tid_233732)] =\n                    x_216631;\n                ((__local\n                  double *) red_arr_mem_233801)[sext_i32_i64(local_tid_233732)] =\n                    x_216632;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_233732, 32) == 0 && ltid_in_bounds_233812) {\n            ((",
                   "__local\n              double *) red_arr_mem_233799)[sext_i32_i64(local_tid_233732)] =\n                x_216633;\n            ((__local\n              double *) red_arr_mem_233801)[sext_i32_i64(local_tid_233732)] =\n                x_216634;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233821 = 0; i_233821 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233732),\n                                                    computed_group_sizze_216338);\n         i_233821++) {\n        double tmp_233822;\n        \n        tmp_233822 = ((__local double *) red_arr_mem_233799)[q_s_203575 -\n                                                             (int64_t) 1 +\n                                                             (i_233821 *\n                                                              computed_group_sizze_216338 +\n                                                              sext_i32_i64(local_tid_233732)) *\n                                                             q_s_203575];\n        ((__local double *) color_232120)[i_233821 *\n                                          computed_group_sizze_216338 +\n                                          sext_i32_i64(local_tid_233732)] =\n            tmp_233822;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233823 = 0; i_233823 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233732),\n                                                    computed_group_sizze_216338);\n         i_233823++) {\n        double tmp_233824;\n        \n        tmp_233824 = ((__local double *) red_arr_mem_233801)[q_s_203575 -\n                                                             (int64_t) 1 +\n                                                             (i_233823 *\n                                                              computed_group_sizze_216338 +\n                               ",
                   "                               sext_i32_i64(local_tid_233732)) *\n                                                             q_s_203575];\n        ((__local double *) color_232119)[i_233823 *\n                                          computed_group_sizze_216338 +\n                                          sext_i32_i64(local_tid_233732)] =\n            tmp_233824;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233825 = 0; i_233825 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233732),\n                                                    computed_group_sizze_216338);\n         i_233825++) {\n        double tmp_233826;\n        \n        tmp_233826 = ((__local double *) color_232120)[i_233825 *\n                                                       computed_group_sizze_216338 +\n                                                       sext_i32_i64(local_tid_233732)];\n        ((__global double *) mem_230398)[gtid_216499 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_216500 * s_n_m_203726 +\n                                         (i_233825 *\n                                          computed_group_sizze_216338 +\n                                          sext_i32_i64(local_tid_233732))] =\n            tmp_233826;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233827 = 0; i_233827 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233732),\n                                                    computed_group_sizze_216338);\n         i_233827++) {\n        double tmp_233828;\n        \n        tmp_233828 = ((__local double *) color_232119)[i_233827 *\n                                                       computed_group_sizze_216338 +\n                                                       sext_i32_i64(local_tid_233732)];\n        ((__global doub",
                   "le *) mem_230403)[gtid_216499 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_216500 * s_n_m_203726 +\n                                         (i_233827 *\n                                          computed_group_sizze_216338 +\n                                          sext_i32_i64(local_tid_233732))] =\n            tmp_233828;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_6:\n    return;\n}\n__kernel void mainzisegmap_intragroup_217273(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *red_arr_mem_234116_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *red_arr_mem_234112_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *color_232131_backing_aligned_2,\n                                             int64_t n_p_203574,\n                                             int64_t q_s_203575,\n                                             int64_t jump_s_203581,\n                                             int64_t partition_sizze_203667,\n                                             int64_t defunc_0_f_res_203721,\n                                             int64_t pad_css_len_203722,\n                                             int64_t s_n_m_203726, __global\n                                             unsigned char *ext_mem_229372,\n                                             __global\n                                             unsigned char *ext_mem_229373,\n                                             __global\n                                             unsigned char *ext_mem_229470,\n                                             __global\n                                             unsigned char *ext_mem_229471,\n                   ",
                   "                          __global unsigned char *mem_229634,\n                                             __global unsigned char *mem_229639,\n                                             __global unsigned char *mem_230544)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_234116_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234116_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_234112_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234112_backing_aligned_1;\n    __local volatile unsigned char *restrict color_232131_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232131_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234098;\n    int32_t local_tid_234099;\n    int64_t group_sizze_234102;\n    int32_t wave_sizze_234101;\n    int32_t group_tid_234100;\n    \n    global_tid_234098 = get_global_id(0);\n    local_tid_234099 = get_local_id(0);\n    group_sizze_234102 = get_local_size(0);\n    wave_sizze_234101 = LOCKSTEP_WIDTH;\n    group_tid_234100 = get_group_id(0);\n    \n    int32_t phys_tid_217273 = group_tid_234100;\n    int64_t slice_234104 = q_s_203575;\n    int64_t ltid_pre_234103 = sext_i32_i64(local_tid_234099);\n    int64_t remnant_234105 = sext_i32_i64(local_tid_234099) - ltid_pre_234103;\n    int64_t slice_234106 = s_n_m_203726;\n    int64_t slice_234107 = n_p_203574 * slice_234106;\n    int64_t slice_234108 = partition_sizze_203667 * slice_234107;\n    int64_t gtid_217270 = squot64(sext_i32_i64(group_tid_234100), slice_234107);\n    int64_t remnant_234109 = sext_i32_i64(group_tid_234100) - gtid_217270 *\n            slice_234107;\n    int64_t gtid_217271 = squot64(remn",
                   "ant_234109, slice_234106);\n    int64_t remnant_234110 = remnant_234109 - gtid_217271 * slice_234106;\n    int64_t gtid_217272 = remnant_234110;\n    int64_t remnant_234111 = remnant_234110 - gtid_217272;\n    __local unsigned char *color_232131;\n    \n    color_232131 = (__local unsigned char *) color_232131_backing_0;\n    \n    int64_t x_217280;\n    \n    x_217280 = ((__global int64_t *) ext_mem_229372)[gtid_217270 * n_p_203574 +\n                                                     gtid_217271];\n    \n    int64_t x_217282;\n    \n    x_217282 = ((__global int64_t *) ext_mem_229471)[gtid_217270 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_217271 *\n                                                     s_n_m_203726 +\n                                                     gtid_217272];\n    \n    double x_217283;\n    \n    x_217283 = ((__global double *) ext_mem_229470)[gtid_217270 *\n                                                    (s_n_m_203726 *\n                                                     n_p_203574) + gtid_217271 *\n                                                    s_n_m_203726 + gtid_217272];\n    \n    bool cond_217284 = gtid_217272 == (int64_t) 0;\n    int64_t defunc_0_m_fun_res_217285;\n    \n    if (cond_217284) {\n        defunc_0_m_fun_res_217285 = (int64_t) 0;\n    } else {\n        int64_t y_217286 = sub64(s_n_m_203726, (int64_t) 1);\n        bool cond_217287 = gtid_217272 == y_217286;\n        int64_t defunc_0_m_fun_res_f_res_217288;\n        \n        if (cond_217287) {\n            int64_t defunc_0_m_fun_res_f_res_t_res_217289 =\n                    sub64(pad_css_len_203722, (int64_t) 1);\n            \n            defunc_0_m_fun_res_f_res_217288 =\n                defunc_0_m_fun_res_f_res_t_res_217289;\n        } else {\n            int64_t x_217290 = sub64(gtid_217272, (int64_t) 1);\n            int64_t x_217291 = mul64(jump",
                   "_s_203581, x_217290);\n            int64_t min_arg_217292 = add64((int64_t) 1, x_217291);\n            int64_t min_res_217293 = smin64(defunc_0_f_res_203721,\n                                            min_arg_217292);\n            \n            defunc_0_m_fun_res_f_res_217288 = min_res_217293;\n        }\n        defunc_0_m_fun_res_217285 = defunc_0_m_fun_res_f_res_217288;\n    }\n    \n    double defunc_2_reduce_res_217294;\n    int64_t gtid_217296 = sext_i32_i64(sext_i64_i32(ltid_pre_234103));\n    int32_t phys_tid_217297 = local_tid_234099;\n    __local unsigned char *red_arr_mem_234112;\n    \n    red_arr_mem_234112 = (__local unsigned char *) red_arr_mem_234112_backing_1;\n    \n    bool cond_217302 = sle64(x_217280, gtid_217296);\n    int64_t defunc_0_f_res_217303;\n    \n    if (cond_217302) {\n        defunc_0_f_res_217303 = (int64_t) 0;\n    } else {\n        int64_t i_217304 = add64(x_217282, gtid_217296);\n        int64_t defunc_0_add_arg_217305;\n        \n        defunc_0_add_arg_217305 = ((__global\n                                    int64_t *) ext_mem_229373)[gtid_217270 *\n                                                               (defunc_0_f_res_203721 *\n                                                                n_p_203574) +\n                                                               gtid_217271 *\n                                                               defunc_0_f_res_203721 +\n                                                               i_217304];\n        \n        int64_t defunc_1_add_res_217306 = add64((int64_t) 1,\n                                                defunc_0_add_arg_217305);\n        \n        defunc_0_f_res_217303 = defunc_1_add_res_217306;\n    }\n    \n    double defunc_0_f_res_217307;\n    \n    if (cond_217302) {\n        defunc_0_f_res_217307 = 0.0;\n    } else {\n        int64_t i_217308 = add64(x_217282, gtid_217296);\n        double defunc_0_add_arg_217309;\n        \n        defunc_0_add_arg_217309 = ((__global double *) mem_229639)[gtid_2172",
                   "70 *\n                                                                   (defunc_0_f_res_203721 *\n                                                                    n_p_203574) +\n                                                                   gtid_217271 *\n                                                                   defunc_0_f_res_203721 +\n                                                                   i_217308];\n        defunc_0_f_res_217307 = defunc_0_add_arg_217309;\n    }\n    \n    int64_t binop_p_217310 = sub64(defunc_0_f_res_217303,\n                                   defunc_0_m_fun_res_217285);\n    double defunc_0_f_res_217311 = sitofp_i64_f64(binop_p_217310);\n    double abs_res_217312 = fabs(defunc_0_f_res_217311);\n    double tmp1_217313 = abs_res_217312 / x_217283;\n    double x_217314 = tmp1_217313 * tmp1_217313;\n    double y_217315 = tmp1_217313 * x_217314;\n    double tmp2_217316 = 1.0 - y_217315;\n    double x_217317 = tmp2_217316 * tmp2_217316;\n    double tmp3_217318 = tmp2_217316 * x_217317;\n    double tmp4_217319 = defunc_0_f_res_217307 * tmp3_217318;\n    \n    ((__local double *) red_arr_mem_234112)[gtid_217296] = tmp4_217319;\n    ((__local double *) color_232131)[gtid_217296] = tmp4_217319;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_234114;\n    int32_t skip_waves_234115 = 1;\n    double x_217298;\n    double x_217299;\n    \n    offset_234114 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_234099, sext_i64_i32(q_s_203575))) {\n            x_217298 = ((__local\n                         double *) red_arr_mem_234112)[sext_i32_i64(local_tid_234099 +\n                                                       offset_234114)];\n        }\n    }\n    offset_234114 = 1;\n    while (slt32(offset_234114, wave_sizze_234101)) {\n        if (slt32(local_tid_234099 + offset_234114, sext_i64_i32(q_s_203575)) &&\n            ((local_tid_234099 - squot32(local_tid_234099, wave_sizze_234101) *\n              wave_sizze_",
                   "234101) & (2 * offset_234114 - 1)) == 0) {\n            // read array element\n            {\n                x_217299 = ((volatile __local\n                             double *) red_arr_mem_234112)[sext_i32_i64(local_tid_234099 +\n                                                           offset_234114)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217300 = x_217298 + x_217299;\n                \n                x_217298 = defunc_1_op_res_217300;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_234112)[sext_i32_i64(local_tid_234099)] =\n                    x_217298;\n            }\n        }\n        offset_234114 *= 2;\n    }\n    while (slt32(skip_waves_234115, squot32(sext_i64_i32(q_s_203575) +\n                                            wave_sizze_234101 - 1,\n                                            wave_sizze_234101))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_234114 = skip_waves_234115 * wave_sizze_234101;\n        if (slt32(local_tid_234099 + offset_234114, sext_i64_i32(q_s_203575)) &&\n            ((local_tid_234099 - squot32(local_tid_234099, wave_sizze_234101) *\n              wave_sizze_234101) == 0 && (squot32(local_tid_234099,\n                                                  wave_sizze_234101) & (2 *\n                                                                        skip_waves_234115 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_217299 = ((__local\n                             double *) red_arr_mem_234112)[sext_i32_i64(local_tid_234099 +\n                                                           offset_234114)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217300 = x_217298 + x_217299;\n                \n        ",
                   "        x_217298 = defunc_1_op_res_217300;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_234112)[sext_i32_i64(local_tid_234099)] =\n                    x_217298;\n            }\n        }\n        skip_waves_234115 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_217294 = ((__local\n                                   double *) red_arr_mem_234112)[(int64_t) 0];\n    \n    double a0_217320 = 1.0 / defunc_2_reduce_res_217294;\n    double defunc_2_reduce_res_217321;\n    int64_t gtid_217322 = sext_i32_i64(sext_i64_i32(ltid_pre_234103));\n    int32_t phys_tid_217323 = local_tid_234099;\n    __local unsigned char *red_arr_mem_234116;\n    \n    red_arr_mem_234116 = (__local unsigned char *) red_arr_mem_234116_backing_2;\n    \n    double x_217328;\n    \n    x_217328 = ((__local double *) color_232131)[gtid_217322];\n    \n    bool cond_217329 = sle64(x_217280, gtid_217322);\n    double defunc_0_f_res_217330;\n    \n    if (cond_217329) {\n        defunc_0_f_res_217330 = 0.0;\n    } else {\n        int64_t i_217331 = add64(x_217282, gtid_217322);\n        double defunc_0_add_arg_217332;\n        \n        defunc_0_add_arg_217332 = ((__global double *) mem_229634)[gtid_217270 *\n                                                                   (defunc_0_f_res_203721 *\n                                                                    n_p_203574) +\n                                                                   gtid_217271 *\n                                                                   defunc_0_f_res_203721 +\n                                                                   i_217331];\n        defunc_0_f_res_217330 = defunc_0_add_arg_217332;\n    }\n    \n    double x_217333 = a0_217320 * x_217328;\n    double defunc_9_fit_fun_res_217334 = defunc_0_f_res_217330 * x_217333;\n    \n    ((__local double *) red_arr_mem_234116)[gtid_217322] =\n        defunc_9_fit_fun_res_217334;\n    barrier(CLK_",
                   "LOCAL_MEM_FENCE);\n    \n    int32_t offset_234118;\n    int32_t skip_waves_234119 = 1;\n    double x_217324;\n    double x_217325;\n    \n    offset_234118 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_234099, sext_i64_i32(q_s_203575))) {\n            x_217324 = ((__local\n                         double *) red_arr_mem_234116)[sext_i32_i64(local_tid_234099 +\n                                                       offset_234118)];\n        }\n    }\n    offset_234118 = 1;\n    while (slt32(offset_234118, wave_sizze_234101)) {\n        if (slt32(local_tid_234099 + offset_234118, sext_i64_i32(q_s_203575)) &&\n            ((local_tid_234099 - squot32(local_tid_234099, wave_sizze_234101) *\n              wave_sizze_234101) & (2 * offset_234118 - 1)) == 0) {\n            // read array element\n            {\n                x_217325 = ((volatile __local\n                             double *) red_arr_mem_234116)[sext_i32_i64(local_tid_234099 +\n                                                           offset_234118)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217326 = x_217324 + x_217325;\n                \n                x_217324 = defunc_1_op_res_217326;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_234116)[sext_i32_i64(local_tid_234099)] =\n                    x_217324;\n            }\n        }\n        offset_234118 *= 2;\n    }\n    while (slt32(skip_waves_234119, squot32(sext_i64_i32(q_s_203575) +\n                                            wave_sizze_234101 - 1,\n                                            wave_sizze_234101))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_234118 = skip_waves_234119 * wave_sizze_234101;\n        if (slt32(local_tid_234099 + offset_234118, sext_i64_i32(q_s_203575)) &&\n            ((local_tid_234099 - squot32(local_tid_234099, wave_sizze_234101) ",
                   "*\n              wave_sizze_234101) == 0 && (squot32(local_tid_234099,\n                                                  wave_sizze_234101) & (2 *\n                                                                        skip_waves_234119 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_217325 = ((__local\n                             double *) red_arr_mem_234116)[sext_i32_i64(local_tid_234099 +\n                                                           offset_234118)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217326 = x_217324 + x_217325;\n                \n                x_217324 = defunc_1_op_res_217326;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_234116)[sext_i32_i64(local_tid_234099)] =\n                    x_217324;\n            }\n        }\n        skip_waves_234119 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_217321 = ((__local\n                                   double *) red_arr_mem_234116)[(int64_t) 0];\n    if (local_tid_234099 == 0) {\n        ((__global double *) mem_230544)[gtid_217270 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_217271 * s_n_m_203726 +\n                                         gtid_217272] =\n            defunc_2_reduce_res_217321;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_217594(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *red_arr_mem_234144_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *red_arr_mem_234142_backing_aligned_1,\n                      ",
                   "                       __local volatile\n                                             int64_t *red_arr_mem_234138_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *red_arr_mem_234136_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *red_arr_mem_234134_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *color_232133_backing_aligned_5,\n                                             __local volatile\n                                             int64_t *color_232132_backing_aligned_6,\n                                             int64_t n_p_203574,\n                                             int64_t q_s_203575,\n                                             int64_t jump_s_203581,\n                                             int64_t partition_sizze_203667,\n                                             int64_t defunc_0_f_res_203721,\n                                             int64_t pad_css_len_203722,\n                                             int64_t s_n_m_203726, __global\n                                             unsigned char *ext_mem_229372,\n                                             __global\n                                             unsigned char *ext_mem_229373,\n                                             __global\n                                             unsigned char *ext_mem_229470,\n                                             __global\n                                             unsigned char *ext_mem_229471,\n                                             __global unsigned char *mem_229634,\n                                             __global unsigned char *mem_229639,\n                                             __global unsigned char *mem_230558,\n                                             __global u",
                   "nsigned char *mem_230563)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_234144_backing_6 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234144_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_234142_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234142_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_234138_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234138_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_234136_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234136_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_234134_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234134_backing_aligned_4;\n    __local volatile unsigned char *restrict color_232133_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_232133_backing_aligned_5;\n    __local volatile unsigned char *restrict color_232132_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232132_backing_aligned_6;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234120;\n    int32_t local_tid_234121;\n    int64_t group_sizze_234124;\n    int32_t wave_sizze_234123;\n    int32_t group_tid_234122;\n    \n    global_tid_234120 = get_global_id(0);\n    local_tid_234121 = get_local_id(0);\n    group_sizze_234124 = get_local_size(0);\n    wave_sizze_234123 = L",
                   "OCKSTEP_WIDTH;\n    group_tid_234122 = get_group_id(0);\n    \n    int32_t phys_tid_217594 = group_tid_234122;\n    int64_t slice_234126 = q_s_203575;\n    int64_t ltid_pre_234125 = sext_i32_i64(local_tid_234121);\n    int64_t remnant_234127 = sext_i32_i64(local_tid_234121) - ltid_pre_234125;\n    int64_t slice_234128 = s_n_m_203726;\n    int64_t slice_234129 = n_p_203574 * slice_234128;\n    int64_t slice_234130 = partition_sizze_203667 * slice_234129;\n    int64_t gtid_217591 = squot64(sext_i32_i64(group_tid_234122), slice_234129);\n    int64_t remnant_234131 = sext_i32_i64(group_tid_234122) - gtid_217591 *\n            slice_234129;\n    int64_t gtid_217592 = squot64(remnant_234131, slice_234128);\n    int64_t remnant_234132 = remnant_234131 - gtid_217592 * slice_234128;\n    int64_t gtid_217593 = remnant_234132;\n    int64_t remnant_234133 = remnant_234132 - gtid_217593;\n    __local unsigned char *color_232132;\n    \n    color_232132 = (__local unsigned char *) color_232132_backing_0;\n    \n    __local unsigned char *color_232133;\n    \n    color_232133 = (__local unsigned char *) color_232133_backing_1;\n    \n    int64_t x_217601;\n    \n    x_217601 = ((__global int64_t *) ext_mem_229372)[gtid_217591 * n_p_203574 +\n                                                     gtid_217592];\n    \n    int64_t x_217603;\n    \n    x_217603 = ((__global int64_t *) ext_mem_229471)[gtid_217591 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_217592 *\n                                                     s_n_m_203726 +\n                                                     gtid_217593];\n    \n    double x_217604;\n    \n    x_217604 = ((__global double *) ext_mem_229470)[gtid_217591 *\n                                                    (s_n_m_203726 *\n                                                     n_p_203574) + gtid_217592 *\n                              ",
                   "                      s_n_m_203726 + gtid_217593];\n    \n    bool cond_217605 = gtid_217593 == (int64_t) 0;\n    int64_t defunc_0_m_fun_res_217606;\n    \n    if (cond_217605) {\n        defunc_0_m_fun_res_217606 = (int64_t) 0;\n    } else {\n        int64_t y_217607 = sub64(s_n_m_203726, (int64_t) 1);\n        bool cond_217608 = gtid_217593 == y_217607;\n        int64_t defunc_0_m_fun_res_f_res_217609;\n        \n        if (cond_217608) {\n            int64_t defunc_0_m_fun_res_f_res_t_res_217610 =\n                    sub64(pad_css_len_203722, (int64_t) 1);\n            \n            defunc_0_m_fun_res_f_res_217609 =\n                defunc_0_m_fun_res_f_res_t_res_217610;\n        } else {\n            int64_t x_217611 = sub64(gtid_217593, (int64_t) 1);\n            int64_t x_217612 = mul64(jump_s_203581, x_217611);\n            int64_t min_arg_217613 = add64((int64_t) 1, x_217612);\n            int64_t min_res_217614 = smin64(defunc_0_f_res_203721,\n                                            min_arg_217613);\n            \n            defunc_0_m_fun_res_f_res_217609 = min_res_217614;\n        }\n        defunc_0_m_fun_res_217606 = defunc_0_m_fun_res_f_res_217609;\n    }\n    \n    double defunc_2_reduce_res_217615;\n    double defunc_2_reduce_res_217616;\n    double defunc_2_reduce_res_217617;\n    int64_t gtid_217620 = sext_i32_i64(sext_i64_i32(ltid_pre_234125));\n    int32_t phys_tid_217621 = local_tid_234121;\n    __local unsigned char *red_arr_mem_234134;\n    \n    red_arr_mem_234134 = (__local unsigned char *) red_arr_mem_234134_backing_2;\n    \n    __local unsigned char *red_arr_mem_234136;\n    \n    red_arr_mem_234136 = (__local unsigned char *) red_arr_mem_234136_backing_3;\n    \n    __local unsigned char *red_arr_mem_234138;\n    \n    red_arr_mem_234138 = (__local unsigned char *) red_arr_mem_234138_backing_4;\n    \n    bool cond_217632 = sle64(x_217601, gtid_217620);\n    int64_t defunc_0_f_res_217633;\n    \n    if (cond_217632) {\n        defunc_0_f_res_217633 = (int64_t) 0;\n    } else {\n    ",
                   "    int64_t i_217634 = add64(x_217603, gtid_217620);\n        int64_t defunc_0_add_arg_217635;\n        \n        defunc_0_add_arg_217635 = ((__global\n                                    int64_t *) ext_mem_229373)[gtid_217591 *\n                                                               (defunc_0_f_res_203721 *\n                                                                n_p_203574) +\n                                                               gtid_217592 *\n                                                               defunc_0_f_res_203721 +\n                                                               i_217634];\n        \n        int64_t defunc_1_add_res_217636 = add64((int64_t) 1,\n                                                defunc_0_add_arg_217635);\n        \n        defunc_0_f_res_217633 = defunc_1_add_res_217636;\n    }\n    \n    double defunc_0_f_res_217637;\n    \n    if (cond_217632) {\n        defunc_0_f_res_217637 = 0.0;\n    } else {\n        int64_t i_217638 = add64(x_217603, gtid_217620);\n        double defunc_0_add_arg_217639;\n        \n        defunc_0_add_arg_217639 = ((__global double *) mem_229639)[gtid_217591 *\n                                                                   (defunc_0_f_res_203721 *\n                                                                    n_p_203574) +\n                                                                   gtid_217592 *\n                                                                   defunc_0_f_res_203721 +\n                                                                   i_217638];\n        defunc_0_f_res_217637 = defunc_0_add_arg_217639;\n    }\n    \n    int64_t binop_p_217640 = sub64(defunc_0_f_res_217633,\n                                   defunc_0_m_fun_res_217606);\n    double defunc_0_f_res_217641 = sitofp_i64_f64(binop_p_217640);\n    double abs_res_217642 = fabs(defunc_0_f_res_217641);\n    double tmp1_217643 = abs_res_217642 / x_217604;\n    double x_217644 = tmp1_217643 * tmp1_217643;\n    double y_",
                   "217645 = tmp1_217643 * x_217644;\n    double tmp2_217646 = 1.0 - y_217645;\n    double x_217647 = tmp2_217646 * tmp2_217646;\n    double tmp3_217648 = tmp2_217646 * x_217647;\n    double tmp4_217649 = defunc_0_f_res_217637 * tmp3_217648;\n    double defunc_1_f_res_217650 = defunc_0_f_res_217641 * tmp4_217649;\n    double defunc_1_f_res_217651 = defunc_0_f_res_217641 *\n           defunc_1_f_res_217650;\n    \n    ((__local double *) red_arr_mem_234134)[gtid_217620] = tmp4_217649;\n    ((__local double *) red_arr_mem_234136)[gtid_217620] =\n        defunc_1_f_res_217650;\n    ((__local double *) red_arr_mem_234138)[gtid_217620] =\n        defunc_1_f_res_217651;\n    ((__local double *) color_232133)[gtid_217620] = defunc_1_f_res_217650;\n    ((__local double *) color_232132)[gtid_217620] = tmp4_217649;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_234140;\n    int32_t skip_waves_234141 = 1;\n    double x_217622;\n    double x_217623;\n    double x_217624;\n    double x_217625;\n    double x_217626;\n    double x_217627;\n    \n    offset_234140 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_234121, sext_i64_i32(q_s_203575))) {\n            x_217622 = ((__local\n                         double *) red_arr_mem_234134)[sext_i32_i64(local_tid_234121 +\n                                                       offset_234140)];\n            x_217623 = ((__local\n                         double *) red_arr_mem_234136)[sext_i32_i64(local_tid_234121 +\n                                                       offset_234140)];\n            x_217624 = ((__local\n                         double *) red_arr_mem_234138)[sext_i32_i64(local_tid_234121 +\n                                                       offset_234140)];\n        }\n    }\n    offset_234140 = 1;\n    while (slt32(offset_234140, wave_sizze_234123)) {\n        if (slt32(local_tid_234121 + offset_234140, sext_i64_i32(q_s_203575)) &&\n            ((local_tid_234121 - squot32(local_tid_234121, wave_sizze_23",
                   "4123) *\n              wave_sizze_234123) & (2 * offset_234140 - 1)) == 0) {\n            // read array element\n            {\n                x_217625 = ((volatile __local\n                             double *) red_arr_mem_234134)[sext_i32_i64(local_tid_234121 +\n                                                           offset_234140)];\n                x_217626 = ((volatile __local\n                             double *) red_arr_mem_234136)[sext_i32_i64(local_tid_234121 +\n                                                           offset_234140)];\n                x_217627 = ((volatile __local\n                             double *) red_arr_mem_234138)[sext_i32_i64(local_tid_234121 +\n                                                           offset_234140)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217628 = x_217622 + x_217625;\n                double defunc_1_op_res_217629 = x_217623 + x_217626;\n                double defunc_1_op_res_217630 = x_217624 + x_217627;\n                \n                x_217622 = defunc_1_op_res_217628;\n                x_217623 = defunc_1_op_res_217629;\n                x_217624 = defunc_1_op_res_217630;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_234134)[sext_i32_i64(local_tid_234121)] =\n                    x_217622;\n                ((volatile __local\n                  double *) red_arr_mem_234136)[sext_i32_i64(local_tid_234121)] =\n                    x_217623;\n                ((volatile __local\n                  double *) red_arr_mem_234138)[sext_i32_i64(local_tid_234121)] =\n                    x_217624;\n            }\n        }\n        offset_234140 *= 2;\n    }\n    while (slt32(skip_waves_234141, squot32(sext_i64_i32(q_s_203575) +\n                                            wave_sizze_234123 - 1,\n                                            wave_sizze_234123))) {\n        barrier(CL",
                   "K_LOCAL_MEM_FENCE);\n        offset_234140 = skip_waves_234141 * wave_sizze_234123;\n        if (slt32(local_tid_234121 + offset_234140, sext_i64_i32(q_s_203575)) &&\n            ((local_tid_234121 - squot32(local_tid_234121, wave_sizze_234123) *\n              wave_sizze_234123) == 0 && (squot32(local_tid_234121,\n                                                  wave_sizze_234123) & (2 *\n                                                                        skip_waves_234141 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_217625 = ((__local\n                             double *) red_arr_mem_234134)[sext_i32_i64(local_tid_234121 +\n                                                           offset_234140)];\n                x_217626 = ((__local\n                             double *) red_arr_mem_234136)[sext_i32_i64(local_tid_234121 +\n                                                           offset_234140)];\n                x_217627 = ((__local\n                             double *) red_arr_mem_234138)[sext_i32_i64(local_tid_234121 +\n                                                           offset_234140)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217628 = x_217622 + x_217625;\n                double defunc_1_op_res_217629 = x_217623 + x_217626;\n                double defunc_1_op_res_217630 = x_217624 + x_217627;\n                \n                x_217622 = defunc_1_op_res_217628;\n                x_217623 = defunc_1_op_res_217629;\n                x_217624 = defunc_1_op_res_217630;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_234134)[sext_i32_i64(local_tid_234121)] =\n                    x_217622;\n                ((__local\n                  double *) red_arr_mem_234136)[sext_i32_i64(local_tid_234121)] =\n ",
                   "                   x_217623;\n                ((__local\n                  double *) red_arr_mem_234138)[sext_i32_i64(local_tid_234121)] =\n                    x_217624;\n            }\n        }\n        skip_waves_234141 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_217615 = ((__local\n                                   double *) red_arr_mem_234134)[(int64_t) 0];\n    defunc_2_reduce_res_217616 = ((__local\n                                   double *) red_arr_mem_234136)[(int64_t) 0];\n    defunc_2_reduce_res_217617 = ((__local\n                                   double *) red_arr_mem_234138)[(int64_t) 0];\n    \n    double x_217652 = defunc_2_reduce_res_217615 * defunc_2_reduce_res_217617;\n    double y_217653 = defunc_2_reduce_res_217616 * defunc_2_reduce_res_217616;\n    double y_217654 = x_217652 - y_217653;\n    double det1_217655 = 1.0 / y_217654;\n    double a11_217656 = defunc_2_reduce_res_217617 * det1_217655;\n    double x_217657 = 0.0 - defunc_2_reduce_res_217616;\n    double b11_217658 = det1_217655 * x_217657;\n    double c11_217659 = defunc_2_reduce_res_217615 * det1_217655;\n    double defunc_2_reduce_res_217660;\n    double defunc_2_reduce_res_217661;\n    int64_t gtid_217662 = sext_i32_i64(sext_i64_i32(ltid_pre_234125));\n    int32_t phys_tid_217663 = local_tid_234121;\n    __local unsigned char *red_arr_mem_234142;\n    \n    red_arr_mem_234142 = (__local unsigned char *) red_arr_mem_234142_backing_5;\n    \n    __local unsigned char *red_arr_mem_234144;\n    \n    red_arr_mem_234144 = (__local unsigned char *) red_arr_mem_234144_backing_6;\n    \n    double x_217671;\n    \n    x_217671 = ((__local double *) color_232132)[gtid_217662];\n    \n    double x_217672;\n    \n    x_217672 = ((__local double *) color_232133)[gtid_217662];\n    \n    bool cond_217673 = sle64(x_217601, gtid_217662);\n    double defunc_0_f_res_217674;\n    \n    if (cond_217673) {\n        defunc_0_f_res_217674 = 0.0;\n    } else {\n        int64_t i_217675 = add64(x_217603, gtid_217662);\n     ",
                   "   double defunc_0_add_arg_217676;\n        \n        defunc_0_add_arg_217676 = ((__global double *) mem_229634)[gtid_217591 *\n                                                                   (defunc_0_f_res_203721 *\n                                                                    n_p_203574) +\n                                                                   gtid_217592 *\n                                                                   defunc_0_f_res_203721 +\n                                                                   i_217675];\n        defunc_0_f_res_217674 = defunc_0_add_arg_217676;\n    }\n    \n    double x_217677 = a11_217656 * x_217671;\n    double y_217678 = b11_217658 * x_217672;\n    double x_217679 = x_217677 + y_217678;\n    double defunc_9_fit_fun_res_217680 = defunc_0_f_res_217674 * x_217679;\n    double x_217681 = b11_217658 * x_217671;\n    double y_217682 = c11_217659 * x_217672;\n    double x_217683 = x_217681 + y_217682;\n    double defunc_9_slope_fun_res_217684 = defunc_0_f_res_217674 * x_217683;\n    \n    ((__local double *) red_arr_mem_234142)[gtid_217662] =\n        defunc_9_fit_fun_res_217680;\n    ((__local double *) red_arr_mem_234144)[gtid_217662] =\n        defunc_9_slope_fun_res_217684;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_234146;\n    int32_t skip_waves_234147 = 1;\n    double x_217664;\n    double x_217665;\n    double x_217666;\n    double x_217667;\n    \n    offset_234146 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_234121, sext_i64_i32(q_s_203575))) {\n            x_217664 = ((__local\n                         double *) red_arr_mem_234142)[sext_i32_i64(local_tid_234121 +\n                                                       offset_234146)];\n            x_217665 = ((__local\n                         double *) red_arr_mem_234144)[sext_i32_i64(local_tid_234121 +\n                                                       offset_234146)];\n        }\n    }\n    offset_234146 = 1;\n    w",
                   "hile (slt32(offset_234146, wave_sizze_234123)) {\n        if (slt32(local_tid_234121 + offset_234146, sext_i64_i32(q_s_203575)) &&\n            ((local_tid_234121 - squot32(local_tid_234121, wave_sizze_234123) *\n              wave_sizze_234123) & (2 * offset_234146 - 1)) == 0) {\n            // read array element\n            {\n                x_217666 = ((volatile __local\n                             double *) red_arr_mem_234142)[sext_i32_i64(local_tid_234121 +\n                                                           offset_234146)];\n                x_217667 = ((volatile __local\n                             double *) red_arr_mem_234144)[sext_i32_i64(local_tid_234121 +\n                                                           offset_234146)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217668 = x_217664 + x_217666;\n                double defunc_1_op_res_217669 = x_217665 + x_217667;\n                \n                x_217664 = defunc_1_op_res_217668;\n                x_217665 = defunc_1_op_res_217669;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_234142)[sext_i32_i64(local_tid_234121)] =\n                    x_217664;\n                ((volatile __local\n                  double *) red_arr_mem_234144)[sext_i32_i64(local_tid_234121)] =\n                    x_217665;\n            }\n        }\n        offset_234146 *= 2;\n    }\n    while (slt32(skip_waves_234147, squot32(sext_i64_i32(q_s_203575) +\n                                            wave_sizze_234123 - 1,\n                                            wave_sizze_234123))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_234146 = skip_waves_234147 * wave_sizze_234123;\n        if (slt32(local_tid_234121 + offset_234146, sext_i64_i32(q_s_203575)) &&\n            ((local_tid_234121 - squot32(local_tid_234121, wave_sizze_234123) *\n              wave_sizze_234123) =",
                   "= 0 && (squot32(local_tid_234121,\n                                                  wave_sizze_234123) & (2 *\n                                                                        skip_waves_234147 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_217666 = ((__local\n                             double *) red_arr_mem_234142)[sext_i32_i64(local_tid_234121 +\n                                                           offset_234146)];\n                x_217667 = ((__local\n                             double *) red_arr_mem_234144)[sext_i32_i64(local_tid_234121 +\n                                                           offset_234146)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217668 = x_217664 + x_217666;\n                double defunc_1_op_res_217669 = x_217665 + x_217667;\n                \n                x_217664 = defunc_1_op_res_217668;\n                x_217665 = defunc_1_op_res_217669;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_234142)[sext_i32_i64(local_tid_234121)] =\n                    x_217664;\n                ((__local\n                  double *) red_arr_mem_234144)[sext_i32_i64(local_tid_234121)] =\n                    x_217665;\n            }\n        }\n        skip_waves_234147 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_217660 = ((__local\n                                   double *) red_arr_mem_234142)[(int64_t) 0];\n    defunc_2_reduce_res_217661 = ((__local\n                                   double *) red_arr_mem_234144)[(int64_t) 0];\n    if (local_tid_234121 == 0) {\n        ((__global double *) mem_230558)[gtid_217591 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_217592 * s_n_",
                   "m_203726 +\n                                         gtid_217593] =\n            defunc_2_reduce_res_217660;\n    }\n    if (local_tid_234121 == 0) {\n        ((__global double *) mem_230563)[gtid_217591 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_217592 * s_n_m_203726 +\n                                         gtid_217593] =\n            defunc_2_reduce_res_217661;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_218045(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *red_arr_mem_234176_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *red_arr_mem_234174_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *red_arr_mem_234170_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *red_arr_mem_234168_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *red_arr_mem_234166_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *red_arr_mem_234164_backing_aligned_5,\n                                             __local volatile\n                                             int64_t *red_arr_mem_234162_backing_aligned_6,\n                                             __local volatile\n                                             int64_t *color_232137_backing_aligned_7,\n                                             __local volatile\n                                             int64_t *color_232136_backing_aligned_8,\n                                             __local volatile\n",
                   "                                             int64_t *color_232135_backing_aligned_9,\n                                             __local volatile\n                                             int64_t *color_232134_backing_aligned_10,\n                                             int64_t n_p_203574,\n                                             int64_t q_s_203575,\n                                             int64_t jump_s_203581,\n                                             int64_t partition_sizze_203667,\n                                             int64_t defunc_0_f_res_203721,\n                                             int64_t pad_css_len_203722,\n                                             int64_t s_n_m_203726, __global\n                                             unsigned char *ext_mem_229372,\n                                             __global\n                                             unsigned char *ext_mem_229373,\n                                             __global\n                                             unsigned char *ext_mem_229470,\n                                             __global\n                                             unsigned char *ext_mem_229471,\n                                             __global unsigned char *mem_229634,\n                                             __global unsigned char *mem_229639,\n                                             __global unsigned char *mem_230584,\n                                             __global unsigned char *mem_230589)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_234176_backing_10 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234176_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_234174_backing_9 =\n                                   (__local volatile\n                                 ",
                   "   unsigned char *) red_arr_mem_234174_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_234170_backing_8 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234170_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_234168_backing_7 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234168_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_234166_backing_6 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234166_backing_aligned_4;\n    __local volatile unsigned char *restrict red_arr_mem_234164_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234164_backing_aligned_5;\n    __local volatile unsigned char *restrict red_arr_mem_234162_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234162_backing_aligned_6;\n    __local volatile unsigned char *restrict color_232137_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) color_232137_backing_aligned_7;\n    __local volatile unsigned char *restrict color_232136_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) color_232136_backing_aligned_8;\n    __local volatile unsigned char *restrict color_232135_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_232135_backing_aligned_9;\n    __local volatile unsigned char *restrict color_232134_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232134_backing_aligned_10;\n    \n    ",
                   "if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234148;\n    int32_t local_tid_234149;\n    int64_t group_sizze_234152;\n    int32_t wave_sizze_234151;\n    int32_t group_tid_234150;\n    \n    global_tid_234148 = get_global_id(0);\n    local_tid_234149 = get_local_id(0);\n    group_sizze_234152 = get_local_size(0);\n    wave_sizze_234151 = LOCKSTEP_WIDTH;\n    group_tid_234150 = get_group_id(0);\n    \n    int32_t phys_tid_218045 = group_tid_234150;\n    int64_t slice_234154 = q_s_203575;\n    int64_t ltid_pre_234153 = sext_i32_i64(local_tid_234149);\n    int64_t remnant_234155 = sext_i32_i64(local_tid_234149) - ltid_pre_234153;\n    int64_t slice_234156 = s_n_m_203726;\n    int64_t slice_234157 = n_p_203574 * slice_234156;\n    int64_t slice_234158 = partition_sizze_203667 * slice_234157;\n    int64_t gtid_218042 = squot64(sext_i32_i64(group_tid_234150), slice_234157);\n    int64_t remnant_234159 = sext_i32_i64(group_tid_234150) - gtid_218042 *\n            slice_234157;\n    int64_t gtid_218043 = squot64(remnant_234159, slice_234156);\n    int64_t remnant_234160 = remnant_234159 - gtid_218043 * slice_234156;\n    int64_t gtid_218044 = remnant_234160;\n    int64_t remnant_234161 = remnant_234160 - gtid_218044;\n    __local unsigned char *color_232134;\n    \n    color_232134 = (__local unsigned char *) color_232134_backing_0;\n    \n    __local unsigned char *color_232135;\n    \n    color_232135 = (__local unsigned char *) color_232135_backing_1;\n    \n    __local unsigned char *color_232136;\n    \n    color_232136 = (__local unsigned char *) color_232136_backing_2;\n    \n    __local unsigned char *color_232137;\n    \n    color_232137 = (__local unsigned char *) color_232137_backing_3;\n    \n    int64_t x_218052;\n    \n    x_218052 = ((__global int64_t *) ext_mem_229372)[gtid_218042 * n_p_203574 +\n                                                     gtid_218043];\n    \n    int64_t x_218054;\n    \n    x_218054 = ((__global int64_t *) ext_mem_229471)[gtid_218042 *\n                  ",
                   "                                   (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_218043 *\n                                                     s_n_m_203726 +\n                                                     gtid_218044];\n    \n    double x_218055;\n    \n    x_218055 = ((__global double *) ext_mem_229470)[gtid_218042 *\n                                                    (s_n_m_203726 *\n                                                     n_p_203574) + gtid_218043 *\n                                                    s_n_m_203726 + gtid_218044];\n    \n    bool cond_218056 = gtid_218044 == (int64_t) 0;\n    int64_t defunc_0_m_fun_res_218057;\n    \n    if (cond_218056) {\n        defunc_0_m_fun_res_218057 = (int64_t) 0;\n    } else {\n        int64_t y_218058 = sub64(s_n_m_203726, (int64_t) 1);\n        bool cond_218059 = gtid_218044 == y_218058;\n        int64_t defunc_0_m_fun_res_f_res_218060;\n        \n        if (cond_218059) {\n            int64_t defunc_0_m_fun_res_f_res_t_res_218061 =\n                    sub64(pad_css_len_203722, (int64_t) 1);\n            \n            defunc_0_m_fun_res_f_res_218060 =\n                defunc_0_m_fun_res_f_res_t_res_218061;\n        } else {\n            int64_t x_218062 = sub64(gtid_218044, (int64_t) 1);\n            int64_t x_218063 = mul64(jump_s_203581, x_218062);\n            int64_t min_arg_218064 = add64((int64_t) 1, x_218063);\n            int64_t min_res_218065 = smin64(defunc_0_f_res_203721,\n                                            min_arg_218064);\n            \n            defunc_0_m_fun_res_f_res_218060 = min_res_218065;\n        }\n        defunc_0_m_fun_res_218057 = defunc_0_m_fun_res_f_res_218060;\n    }\n    \n    int64_t gtid_218068 = sext_i32_i64(sext_i64_i32(ltid_pre_234153));\n    int32_t phys_tid_218069 = local_tid_234149;\n    bool cond_218071 = sle64(x_218052, gtid_218068);\n    int64_t defunc_0_f_res_218072;\n    \n    if (cond_218071",
                   ") {\n        defunc_0_f_res_218072 = (int64_t) 0;\n    } else {\n        int64_t i_218073 = add64(x_218054, gtid_218068);\n        int64_t defunc_0_add_arg_218074;\n        \n        defunc_0_add_arg_218074 = ((__global\n                                    int64_t *) ext_mem_229373)[gtid_218042 *\n                                                               (defunc_0_f_res_203721 *\n                                                                n_p_203574) +\n                                                               gtid_218043 *\n                                                               defunc_0_f_res_203721 +\n                                                               i_218073];\n        \n        int64_t defunc_1_add_res_218075 = add64((int64_t) 1,\n                                                defunc_0_add_arg_218074);\n        \n        defunc_0_f_res_218072 = defunc_1_add_res_218075;\n    }\n    \n    double defunc_0_f_res_218076;\n    \n    if (cond_218071) {\n        defunc_0_f_res_218076 = 0.0;\n    } else {\n        int64_t i_218077 = add64(x_218054, gtid_218068);\n        double defunc_0_add_arg_218078;\n        \n        defunc_0_add_arg_218078 = ((__global double *) mem_229639)[gtid_218042 *\n                                                                   (defunc_0_f_res_203721 *\n                                                                    n_p_203574) +\n                                                                   gtid_218043 *\n                                                                   defunc_0_f_res_203721 +\n                                                                   i_218077];\n        defunc_0_f_res_218076 = defunc_0_add_arg_218078;\n    }\n    \n    int64_t binop_p_218079 = sub64(defunc_0_f_res_218072,\n                                   defunc_0_m_fun_res_218057);\n    double defunc_0_f_res_218080 = sitofp_i64_f64(binop_p_218079);\n    double abs_res_218081 = fabs(defunc_0_f_res_218080);\n    double tmp1_218082 = abs_res_218081 / x_2180",
                   "55;\n    double x_218083 = tmp1_218082 * tmp1_218082;\n    double y_218084 = tmp1_218082 * x_218083;\n    double tmp2_218085 = 1.0 - y_218084;\n    double x_218086 = tmp2_218085 * tmp2_218085;\n    double tmp3_218087 = tmp2_218085 * x_218086;\n    double tmp4_218088 = defunc_0_f_res_218076 * tmp3_218087;\n    \n    ((__local double *) color_232137)[gtid_218068] = defunc_0_f_res_218080;\n    ((__local double *) color_232136)[gtid_218068] = tmp4_218088;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    double defunc_2_reduce_res_218089;\n    double defunc_2_reduce_res_218090;\n    double defunc_2_reduce_res_218091;\n    double defunc_2_reduce_res_218092;\n    double defunc_2_reduce_res_218093;\n    int64_t gtid_218096 = sext_i32_i64(sext_i64_i32(ltid_pre_234153));\n    int32_t phys_tid_218097 = local_tid_234149;\n    __local unsigned char *red_arr_mem_234162;\n    \n    red_arr_mem_234162 = (__local unsigned char *) red_arr_mem_234162_backing_4;\n    \n    __local unsigned char *red_arr_mem_234164;\n    \n    red_arr_mem_234164 = (__local unsigned char *) red_arr_mem_234164_backing_5;\n    \n    __local unsigned char *red_arr_mem_234166;\n    \n    red_arr_mem_234166 = (__local unsigned char *) red_arr_mem_234166_backing_6;\n    \n    __local unsigned char *red_arr_mem_234168;\n    \n    red_arr_mem_234168 = (__local unsigned char *) red_arr_mem_234168_backing_7;\n    \n    __local unsigned char *red_arr_mem_234170;\n    \n    red_arr_mem_234170 = (__local unsigned char *) red_arr_mem_234170_backing_8;\n    \n    double x_218113;\n    \n    x_218113 = ((__local double *) color_232137)[gtid_218096];\n    \n    double x_218114;\n    \n    x_218114 = ((__local double *) color_232136)[gtid_218096];\n    \n    double defunc_1_f_res_218115 = x_218113 * x_218114;\n    double defunc_1_f_res_218116 = x_218113 * defunc_1_f_res_218115;\n    double defunc_1_f_res_218117 = x_218113 * defunc_1_f_res_218116;\n    double defunc_1_f_res_218118 = x_218113 * defunc_1_f_res_218117;\n    \n    ((__local double *) red_arr_mem_234162)[gtid_21809",
                   "6] = x_218114;\n    ((__local double *) red_arr_mem_234164)[gtid_218096] =\n        defunc_1_f_res_218115;\n    ((__local double *) red_arr_mem_234166)[gtid_218096] =\n        defunc_1_f_res_218116;\n    ((__local double *) red_arr_mem_234168)[gtid_218096] =\n        defunc_1_f_res_218117;\n    ((__local double *) red_arr_mem_234170)[gtid_218096] =\n        defunc_1_f_res_218118;\n    ((__local double *) color_232135)[gtid_218096] = defunc_1_f_res_218116;\n    ((__local double *) color_232134)[gtid_218096] = defunc_1_f_res_218115;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_234172;\n    int32_t skip_waves_234173 = 1;\n    double x_218098;\n    double x_218099;\n    double x_218100;\n    double x_218101;\n    double x_218102;\n    double x_218103;\n    double x_218104;\n    double x_218105;\n    double x_218106;\n    double x_218107;\n    \n    offset_234172 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_234149, sext_i64_i32(q_s_203575))) {\n            x_218098 = ((__local\n                         double *) red_arr_mem_234162)[sext_i32_i64(local_tid_234149 +\n                                                       offset_234172)];\n            x_218099 = ((__local\n                         double *) red_arr_mem_234164)[sext_i32_i64(local_tid_234149 +\n                                                       offset_234172)];\n            x_218100 = ((__local\n                         double *) red_arr_mem_234166)[sext_i32_i64(local_tid_234149 +\n                                                       offset_234172)];\n            x_218101 = ((__local\n                         double *) red_arr_mem_234168)[sext_i32_i64(local_tid_234149 +\n                                                       offset_234172)];\n            x_218102 = ((__local\n                         double *) red_arr_mem_234170)[sext_i32_i64(local_tid_234149 +\n                                                       offset_234172)];\n        }\n    }\n    offset_234172 = 1;\n    while ",
                   "(slt32(offset_234172, wave_sizze_234151)) {\n        if (slt32(local_tid_234149 + offset_234172, sext_i64_i32(q_s_203575)) &&\n            ((local_tid_234149 - squot32(local_tid_234149, wave_sizze_234151) *\n              wave_sizze_234151) & (2 * offset_234172 - 1)) == 0) {\n            // read array element\n            {\n                x_218103 = ((volatile __local\n                             double *) red_arr_mem_234162)[sext_i32_i64(local_tid_234149 +\n                                                           offset_234172)];\n                x_218104 = ((volatile __local\n                             double *) red_arr_mem_234164)[sext_i32_i64(local_tid_234149 +\n                                                           offset_234172)];\n                x_218105 = ((volatile __local\n                             double *) red_arr_mem_234166)[sext_i32_i64(local_tid_234149 +\n                                                           offset_234172)];\n                x_218106 = ((volatile __local\n                             double *) red_arr_mem_234168)[sext_i32_i64(local_tid_234149 +\n                                                           offset_234172)];\n                x_218107 = ((volatile __local\n                             double *) red_arr_mem_234170)[sext_i32_i64(local_tid_234149 +\n                                                           offset_234172)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_218108 = x_218098 + x_218103;\n                double defunc_1_op_res_218109 = x_218099 + x_218104;\n                double defunc_1_op_res_218110 = x_218100 + x_218105;\n                double defunc_1_op_res_218111 = x_218101 + x_218106;\n                double defunc_1_op_res_218112 = x_218102 + x_218107;\n                \n                x_218098 = defunc_1_op_res_218108;\n                x_218099 = defunc_1_op_res_218109;\n                x_218100 = defunc_1_op_res_218110;\n                x_218101 = def",
                   "unc_1_op_res_218111;\n                x_218102 = defunc_1_op_res_218112;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_234162)[sext_i32_i64(local_tid_234149)] =\n                    x_218098;\n                ((volatile __local\n                  double *) red_arr_mem_234164)[sext_i32_i64(local_tid_234149)] =\n                    x_218099;\n                ((volatile __local\n                  double *) red_arr_mem_234166)[sext_i32_i64(local_tid_234149)] =\n                    x_218100;\n                ((volatile __local\n                  double *) red_arr_mem_234168)[sext_i32_i64(local_tid_234149)] =\n                    x_218101;\n                ((volatile __local\n                  double *) red_arr_mem_234170)[sext_i32_i64(local_tid_234149)] =\n                    x_218102;\n            }\n        }\n        offset_234172 *= 2;\n    }\n    while (slt32(skip_waves_234173, squot32(sext_i64_i32(q_s_203575) +\n                                            wave_sizze_234151 - 1,\n                                            wave_sizze_234151))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_234172 = skip_waves_234173 * wave_sizze_234151;\n        if (slt32(local_tid_234149 + offset_234172, sext_i64_i32(q_s_203575)) &&\n            ((local_tid_234149 - squot32(local_tid_234149, wave_sizze_234151) *\n              wave_sizze_234151) == 0 && (squot32(local_tid_234149,\n                                                  wave_sizze_234151) & (2 *\n                                                                        skip_waves_234173 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_218103 = ((__local\n                             double *) red_arr_mem_234162)[sext_i32_i64(local_tid_234149 +\n                                                           offset_234172)];\n             ",
                   "   x_218104 = ((__local\n                             double *) red_arr_mem_234164)[sext_i32_i64(local_tid_234149 +\n                                                           offset_234172)];\n                x_218105 = ((__local\n                             double *) red_arr_mem_234166)[sext_i32_i64(local_tid_234149 +\n                                                           offset_234172)];\n                x_218106 = ((__local\n                             double *) red_arr_mem_234168)[sext_i32_i64(local_tid_234149 +\n                                                           offset_234172)];\n                x_218107 = ((__local\n                             double *) red_arr_mem_234170)[sext_i32_i64(local_tid_234149 +\n                                                           offset_234172)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_218108 = x_218098 + x_218103;\n                double defunc_1_op_res_218109 = x_218099 + x_218104;\n                double defunc_1_op_res_218110 = x_218100 + x_218105;\n                double defunc_1_op_res_218111 = x_218101 + x_218106;\n                double defunc_1_op_res_218112 = x_218102 + x_218107;\n                \n                x_218098 = defunc_1_op_res_218108;\n                x_218099 = defunc_1_op_res_218109;\n                x_218100 = defunc_1_op_res_218110;\n                x_218101 = defunc_1_op_res_218111;\n                x_218102 = defunc_1_op_res_218112;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_234162)[sext_i32_i64(local_tid_234149)] =\n                    x_218098;\n                ((__local\n                  double *) red_arr_mem_234164)[sext_i32_i64(local_tid_234149)] =\n                    x_218099;\n                ((__local\n                  double *) red_arr_mem_234166)[sext_i32_i64(local_tid_234149)] =\n                    x_218100;\n                ((__local\n  ",
                   "                double *) red_arr_mem_234168)[sext_i32_i64(local_tid_234149)] =\n                    x_218101;\n                ((__local\n                  double *) red_arr_mem_234170)[sext_i32_i64(local_tid_234149)] =\n                    x_218102;\n            }\n        }\n        skip_waves_234173 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_218089 = ((__local\n                                   double *) red_arr_mem_234162)[(int64_t) 0];\n    defunc_2_reduce_res_218090 = ((__local\n                                   double *) red_arr_mem_234164)[(int64_t) 0];\n    defunc_2_reduce_res_218091 = ((__local\n                                   double *) red_arr_mem_234166)[(int64_t) 0];\n    defunc_2_reduce_res_218092 = ((__local\n                                   double *) red_arr_mem_234168)[(int64_t) 0];\n    defunc_2_reduce_res_218093 = ((__local\n                                   double *) red_arr_mem_234170)[(int64_t) 0];\n    \n    double x_218119 = defunc_2_reduce_res_218091 * defunc_2_reduce_res_218093;\n    double y_218120 = defunc_2_reduce_res_218092 * defunc_2_reduce_res_218092;\n    double a12_218121 = x_218119 - y_218120;\n    double x_218122 = defunc_2_reduce_res_218091 * defunc_2_reduce_res_218092;\n    double y_218123 = defunc_2_reduce_res_218090 * defunc_2_reduce_res_218093;\n    double b12_218124 = x_218122 - y_218123;\n    double x_218125 = defunc_2_reduce_res_218090 * defunc_2_reduce_res_218092;\n    double y_218126 = defunc_2_reduce_res_218091 * defunc_2_reduce_res_218091;\n    double c12_218127 = x_218125 - y_218126;\n    double x_218128 = defunc_2_reduce_res_218089 * defunc_2_reduce_res_218093;\n    double b2_218129 = x_218128 - y_218126;\n    double x_218130 = defunc_2_reduce_res_218090 * defunc_2_reduce_res_218091;\n    double y_218131 = defunc_2_reduce_res_218089 * defunc_2_reduce_res_218092;\n    double c2_218132 = x_218130 - y_218131;\n    double x_218133 = defunc_2_reduce_res_218089 * a12_218121;\n    double y_218134 = defunc_2_reduce_res_21",
                   "8090 * b12_218124;\n    double x_218135 = x_218133 + y_218134;\n    double y_218136 = defunc_2_reduce_res_218091 * c12_218127;\n    double y_218137 = x_218135 + y_218136;\n    double det_218138 = 1.0 / y_218137;\n    double a12_218139 = a12_218121 * det_218138;\n    double b12_218140 = b12_218124 * det_218138;\n    double c12_218141 = c12_218127 * det_218138;\n    double b2_218142 = b2_218129 * det_218138;\n    double c2_218143 = c2_218132 * det_218138;\n    double defunc_2_reduce_res_218144;\n    double defunc_2_reduce_res_218145;\n    int64_t gtid_218146 = sext_i32_i64(sext_i64_i32(ltid_pre_234153));\n    int32_t phys_tid_218147 = local_tid_234149;\n    __local unsigned char *red_arr_mem_234174;\n    \n    red_arr_mem_234174 = (__local unsigned char *) red_arr_mem_234174_backing_9;\n    \n    __local unsigned char *red_arr_mem_234176;\n    \n    red_arr_mem_234176 = (__local\n                          unsigned char *) red_arr_mem_234176_backing_10;\n    \n    double x_218155;\n    \n    x_218155 = ((__local double *) color_232136)[gtid_218146];\n    \n    double x_218156;\n    \n    x_218156 = ((__local double *) color_232134)[gtid_218146];\n    \n    double x_218157;\n    \n    x_218157 = ((__local double *) color_232135)[gtid_218146];\n    \n    bool cond_218158 = sle64(x_218052, gtid_218146);\n    double defunc_0_f_res_218159;\n    \n    if (cond_218158) {\n        defunc_0_f_res_218159 = 0.0;\n    } else {\n        int64_t i_218160 = add64(x_218054, gtid_218146);\n        double defunc_0_add_arg_218161;\n        \n        defunc_0_add_arg_218161 = ((__global double *) mem_229634)[gtid_218042 *\n                                                                   (defunc_0_f_res_203721 *\n                                                                    n_p_203574) +\n                                                                   gtid_218043 *\n                                                                   defunc_0_f_res_203721 +\n                                                                   i_21",
                   "8160];\n        defunc_0_f_res_218159 = defunc_0_add_arg_218161;\n    }\n    \n    double x_218162 = a12_218139 * x_218155;\n    double y_218163 = b12_218140 * x_218156;\n    double x_218164 = x_218162 + y_218163;\n    double y_218165 = c12_218141 * x_218157;\n    double x_218166 = x_218164 + y_218165;\n    double defunc_9_fit_fun_res_218167 = defunc_0_f_res_218159 * x_218166;\n    double x_218168 = b12_218140 * x_218155;\n    double y_218169 = b2_218142 * x_218156;\n    double x_218170 = x_218168 + y_218169;\n    double y_218171 = c2_218143 * x_218157;\n    double x_218172 = x_218170 + y_218171;\n    double defunc_9_slope_fun_res_218173 = defunc_0_f_res_218159 * x_218172;\n    \n    ((__local double *) red_arr_mem_234174)[gtid_218146] =\n        defunc_9_fit_fun_res_218167;\n    ((__local double *) red_arr_mem_234176)[gtid_218146] =\n        defunc_9_slope_fun_res_218173;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_234178;\n    int32_t skip_waves_234179 = 1;\n    double x_218148;\n    double x_218149;\n    double x_218150;\n    double x_218151;\n    \n    offset_234178 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_234149, sext_i64_i32(q_s_203575))) {\n            x_218148 = ((__local\n                         double *) red_arr_mem_234174)[sext_i32_i64(local_tid_234149 +\n                                                       offset_234178)];\n            x_218149 = ((__local\n                         double *) red_arr_mem_234176)[sext_i32_i64(local_tid_234149 +\n                                                       offset_234178)];\n        }\n    }\n    offset_234178 = 1;\n    while (slt32(offset_234178, wave_sizze_234151)) {\n        if (slt32(local_tid_234149 + offset_234178, sext_i64_i32(q_s_203575)) &&\n            ((local_tid_234149 - squot32(local_tid_234149, wave_sizze_234151) *\n              wave_sizze_234151) & (2 * offset_234178 - 1)) == 0) {\n            // read array element\n            {\n                x_218150 = ((volatile __lo",
                   "cal\n                             double *) red_arr_mem_234174)[sext_i32_i64(local_tid_234149 +\n                                                           offset_234178)];\n                x_218151 = ((volatile __local\n                             double *) red_arr_mem_234176)[sext_i32_i64(local_tid_234149 +\n                                                           offset_234178)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_218152 = x_218148 + x_218150;\n                double defunc_1_op_res_218153 = x_218149 + x_218151;\n                \n                x_218148 = defunc_1_op_res_218152;\n                x_218149 = defunc_1_op_res_218153;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_234174)[sext_i32_i64(local_tid_234149)] =\n                    x_218148;\n                ((volatile __local\n                  double *) red_arr_mem_234176)[sext_i32_i64(local_tid_234149)] =\n                    x_218149;\n            }\n        }\n        offset_234178 *= 2;\n    }\n    while (slt32(skip_waves_234179, squot32(sext_i64_i32(q_s_203575) +\n                                            wave_sizze_234151 - 1,\n                                            wave_sizze_234151))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_234178 = skip_waves_234179 * wave_sizze_234151;\n        if (slt32(local_tid_234149 + offset_234178, sext_i64_i32(q_s_203575)) &&\n            ((local_tid_234149 - squot32(local_tid_234149, wave_sizze_234151) *\n              wave_sizze_234151) == 0 && (squot32(local_tid_234149,\n                                                  wave_sizze_234151) & (2 *\n                                                                        skip_waves_234179 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_21",
                   "8150 = ((__local\n                             double *) red_arr_mem_234174)[sext_i32_i64(local_tid_234149 +\n                                                           offset_234178)];\n                x_218151 = ((__local\n                             double *) red_arr_mem_234176)[sext_i32_i64(local_tid_234149 +\n                                                           offset_234178)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_218152 = x_218148 + x_218150;\n                double defunc_1_op_res_218153 = x_218149 + x_218151;\n                \n                x_218148 = defunc_1_op_res_218152;\n                x_218149 = defunc_1_op_res_218153;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_234174)[sext_i32_i64(local_tid_234149)] =\n                    x_218148;\n                ((__local\n                  double *) red_arr_mem_234176)[sext_i32_i64(local_tid_234149)] =\n                    x_218149;\n            }\n        }\n        skip_waves_234179 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_218144 = ((__local\n                                   double *) red_arr_mem_234174)[(int64_t) 0];\n    defunc_2_reduce_res_218145 = ((__local\n                                   double *) red_arr_mem_234176)[(int64_t) 0];\n    if (local_tid_234149 == 0) {\n        ((__global double *) mem_230584)[gtid_218042 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_218043 * s_n_m_203726 +\n                                         gtid_218044] =\n            defunc_2_reduce_res_218144;\n    }\n    if (local_tid_234149 == 0) {\n        ((__global double *) mem_230589)[gtid_218042 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_218043 * s_n_m_203726 +\n           ",
                   "                              gtid_218044] =\n            defunc_2_reduce_res_218145;\n    }\n    \n  error_5:\n    return;\n}\n__kernel void mainzisegmap_intragroup_221759(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *red_arr_mem_235378_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *red_arr_mem_235374_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *color_232143_backing_aligned_2,\n                                             int64_t n_203572,\n                                             int64_t q_l_203577,\n                                             int64_t jump_t_203582,\n                                             int64_t partition_sizze_203667,\n                                             int64_t l_n_m_203733,\n                                             int64_t i_203760,\n                                             int64_t ctx_param_ext_229596,\n                                             int64_t ctx_param_ext_229597,\n                                             int64_t ctx_param_ext_229599,\n                                             __global\n                                             unsigned char *ext_mem_229519,\n                                             __global\n                                             unsigned char *ext_mem_229520,\n                                             __global\n                                             unsigned char *mem_param_229601,\n                                             __global unsigned char *mem_230659,\n                                             __global unsigned char *mem_230969)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_235378_backing_2 ",
                   "=\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235378_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_235374_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235374_backing_aligned_1;\n    __local volatile unsigned char *restrict color_232143_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232143_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235362;\n    int32_t local_tid_235363;\n    int64_t group_sizze_235366;\n    int32_t wave_sizze_235365;\n    int32_t group_tid_235364;\n    \n    global_tid_235362 = get_global_id(0);\n    local_tid_235363 = get_local_id(0);\n    group_sizze_235366 = get_local_size(0);\n    wave_sizze_235365 = LOCKSTEP_WIDTH;\n    group_tid_235364 = get_group_id(0);\n    \n    int32_t phys_tid_221759 = group_tid_235364;\n    int64_t slice_235368 = q_l_203577;\n    int64_t ltid_pre_235367 = sext_i32_i64(local_tid_235363);\n    int64_t remnant_235369 = sext_i32_i64(local_tid_235363) - ltid_pre_235367;\n    int64_t slice_235370 = l_n_m_203733;\n    int64_t slice_235371 = partition_sizze_203667 * slice_235370;\n    int64_t gtid_221757 = squot64(sext_i32_i64(group_tid_235364), slice_235370);\n    int64_t remnant_235372 = sext_i32_i64(group_tid_235364) - gtid_221757 *\n            slice_235370;\n    int64_t gtid_221758 = remnant_235372;\n    int64_t remnant_235373 = remnant_235372 - gtid_221758;\n    __local unsigned char *color_232143;\n    \n    color_232143 = (__local unsigned char *) color_232143_backing_0;\n    \n    int64_t x_221765;\n    \n    x_221765 = ((__global int64_t *) ext_mem_229520)[gtid_221757 *\n                                                     l_n_m_203733 +\n                                                     gtid_221758];\n    \n    double x_221766;\n    \n ",
                   "   x_221766 = ((__global double *) ext_mem_229519)[gtid_221757 * l_n_m_203733 +\n                                                    gtid_221758];\n    \n    int64_t min_arg_221767 = mul64(jump_t_203582, gtid_221758);\n    int64_t min_res_221768 = smin64(i_203760, min_arg_221767);\n    int64_t defunc_0_g_res_221769 = add64((int64_t) 1, min_res_221768);\n    double defunc_2_reduce_res_221770;\n    int64_t gtid_221772 = sext_i32_i64(sext_i64_i32(ltid_pre_235367));\n    int32_t phys_tid_221773 = local_tid_235363;\n    __local unsigned char *red_arr_mem_235374;\n    \n    red_arr_mem_235374 = (__local unsigned char *) red_arr_mem_235374_backing_1;\n    \n    bool cond_221778 = sle64(n_203572, gtid_221772);\n    int64_t defunc_0_f_res_221779;\n    \n    if (cond_221778) {\n        defunc_0_f_res_221779 = (int64_t) 0;\n    } else {\n        int64_t i_221780 = add64(x_221765, gtid_221772);\n        int64_t defunc_1_add_res_221781 = add64((int64_t) 1, i_221780);\n        \n        defunc_0_f_res_221779 = defunc_1_add_res_221781;\n    }\n    \n    double defunc_0_f_res_221782;\n    \n    if (cond_221778) {\n        defunc_0_f_res_221782 = 0.0;\n    } else {\n        int64_t i_221783 = add64(x_221765, gtid_221772);\n        double defunc_0_add_arg_221784;\n        \n        defunc_0_add_arg_221784 = ((__global\n                                    double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                (gtid_221757 *\n                                                                 ctx_param_ext_229597 +\n                                                                 i_221783 *\n                                                                 ctx_param_ext_229599)];\n        defunc_0_f_res_221782 = defunc_0_add_arg_221784;\n    }\n    \n    int64_t binop_p_221785 = sub64(defunc_0_f_res_221779,\n                                   defunc_0_g_res_221769);\n    double defunc_0_f_res_221786 = sitofp_i64_f64(binop_p_221785);\n    double abs_res_221787 = fabs(defunc_",
                   "0_f_res_221786);\n    double tmp1_221788 = abs_res_221787 / x_221766;\n    double x_221789 = tmp1_221788 * tmp1_221788;\n    double y_221790 = tmp1_221788 * x_221789;\n    double tmp2_221791 = 1.0 - y_221790;\n    double x_221792 = tmp2_221791 * tmp2_221791;\n    double tmp3_221793 = tmp2_221791 * x_221792;\n    double tmp4_221794 = defunc_0_f_res_221782 * tmp3_221793;\n    \n    ((__local double *) red_arr_mem_235374)[gtid_221772] = tmp4_221794;\n    ((__local double *) color_232143)[gtid_221772] = tmp4_221794;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_235376;\n    int32_t skip_waves_235377 = 1;\n    double x_221774;\n    double x_221775;\n    \n    offset_235376 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_235363, sext_i64_i32(q_l_203577))) {\n            x_221774 = ((__local\n                         double *) red_arr_mem_235374)[sext_i32_i64(local_tid_235363 +\n                                                       offset_235376)];\n        }\n    }\n    offset_235376 = 1;\n    while (slt32(offset_235376, wave_sizze_235365)) {\n        if (slt32(local_tid_235363 + offset_235376, sext_i64_i32(q_l_203577)) &&\n            ((local_tid_235363 - squot32(local_tid_235363, wave_sizze_235365) *\n              wave_sizze_235365) & (2 * offset_235376 - 1)) == 0) {\n            // read array element\n            {\n                x_221775 = ((volatile __local\n                             double *) red_arr_mem_235374)[sext_i32_i64(local_tid_235363 +\n                                                           offset_235376)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221776 = x_221774 + x_221775;\n                \n                x_221774 = defunc_1_op_res_221776;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_235374)[sext_i32_i64(local_tid_235363)] =\n                    x_221774;",
                   "\n            }\n        }\n        offset_235376 *= 2;\n    }\n    while (slt32(skip_waves_235377, squot32(sext_i64_i32(q_l_203577) +\n                                            wave_sizze_235365 - 1,\n                                            wave_sizze_235365))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_235376 = skip_waves_235377 * wave_sizze_235365;\n        if (slt32(local_tid_235363 + offset_235376, sext_i64_i32(q_l_203577)) &&\n            ((local_tid_235363 - squot32(local_tid_235363, wave_sizze_235365) *\n              wave_sizze_235365) == 0 && (squot32(local_tid_235363,\n                                                  wave_sizze_235365) & (2 *\n                                                                        skip_waves_235377 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_221775 = ((__local\n                             double *) red_arr_mem_235374)[sext_i32_i64(local_tid_235363 +\n                                                           offset_235376)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221776 = x_221774 + x_221775;\n                \n                x_221774 = defunc_1_op_res_221776;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_235374)[sext_i32_i64(local_tid_235363)] =\n                    x_221774;\n            }\n        }\n        skip_waves_235377 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_221770 = ((__local\n                                   double *) red_arr_mem_235374)[(int64_t) 0];\n    \n    double a0_221795 = 1.0 / defunc_2_reduce_res_221770;\n    double defunc_2_reduce_res_221796;\n    int64_t gtid_221797 = sext_i32_i64(sext_i64_i32(ltid_pre_235367));\n    int32_t phys_tid_221798 = local_tid_235363;\n    __local unsigned char *red_arr_me",
                   "m_235378;\n    \n    red_arr_mem_235378 = (__local unsigned char *) red_arr_mem_235378_backing_2;\n    \n    double x_221803;\n    \n    x_221803 = ((__local double *) color_232143)[gtid_221797];\n    \n    bool cond_221804 = sle64(n_203572, gtid_221797);\n    double defunc_0_f_res_221805;\n    \n    if (cond_221804) {\n        defunc_0_f_res_221805 = 0.0;\n    } else {\n        int64_t i_221806 = add64(x_221765, gtid_221797);\n        double defunc_0_add_arg_221807;\n        \n        defunc_0_add_arg_221807 = ((__global double *) mem_230659)[gtid_221757 *\n                                                                   n_203572 +\n                                                                   i_221806];\n        defunc_0_f_res_221805 = defunc_0_add_arg_221807;\n    }\n    \n    double x_221808 = a0_221795 * x_221803;\n    double defunc_9_fit_fun_res_221809 = defunc_0_f_res_221805 * x_221808;\n    \n    ((__local double *) red_arr_mem_235378)[gtid_221797] =\n        defunc_9_fit_fun_res_221809;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_235380;\n    int32_t skip_waves_235381 = 1;\n    double x_221799;\n    double x_221800;\n    \n    offset_235380 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_235363, sext_i64_i32(q_l_203577))) {\n            x_221799 = ((__local\n                         double *) red_arr_mem_235378)[sext_i32_i64(local_tid_235363 +\n                                                       offset_235380)];\n        }\n    }\n    offset_235380 = 1;\n    while (slt32(offset_235380, wave_sizze_235365)) {\n        if (slt32(local_tid_235363 + offset_235380, sext_i64_i32(q_l_203577)) &&\n            ((local_tid_235363 - squot32(local_tid_235363, wave_sizze_235365) *\n              wave_sizze_235365) & (2 * offset_235380 - 1)) == 0) {\n            // read array element\n            {\n                x_221800 = ((volatile __local\n                             double *) red_arr_mem_235378)[sext_i32_i64(local_tid_235363 +\n              ",
                   "                                             offset_235380)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221801 = x_221799 + x_221800;\n                \n                x_221799 = defunc_1_op_res_221801;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_235378)[sext_i32_i64(local_tid_235363)] =\n                    x_221799;\n            }\n        }\n        offset_235380 *= 2;\n    }\n    while (slt32(skip_waves_235381, squot32(sext_i64_i32(q_l_203577) +\n                                            wave_sizze_235365 - 1,\n                                            wave_sizze_235365))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_235380 = skip_waves_235381 * wave_sizze_235365;\n        if (slt32(local_tid_235363 + offset_235380, sext_i64_i32(q_l_203577)) &&\n            ((local_tid_235363 - squot32(local_tid_235363, wave_sizze_235365) *\n              wave_sizze_235365) == 0 && (squot32(local_tid_235363,\n                                                  wave_sizze_235365) & (2 *\n                                                                        skip_waves_235381 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_221800 = ((__local\n                             double *) red_arr_mem_235378)[sext_i32_i64(local_tid_235363 +\n                                                           offset_235380)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221801 = x_221799 + x_221800;\n                \n                x_221799 = defunc_1_op_res_221801;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_235378)[sext_i32_i64(local_tid_235363)] =\n                    x_",
                   "221799;\n            }\n        }\n        skip_waves_235381 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_221796 = ((__local\n                                   double *) red_arr_mem_235378)[(int64_t) 0];\n    if (local_tid_235363 == 0) {\n        ((__global double *) mem_230969)[gtid_221757 * l_n_m_203733 +\n                                         gtid_221758] =\n            defunc_2_reduce_res_221796;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_221926(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *red_arr_mem_235404_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *red_arr_mem_235402_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *red_arr_mem_235398_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *red_arr_mem_235396_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *red_arr_mem_235394_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *color_232145_backing_aligned_5,\n                                             __local volatile\n                                             int64_t *color_232144_backing_aligned_6,\n                                             int64_t n_203572,\n                                             int64_t q_l_203577,\n                                             int64_t jump_t_203582,\n                                             int64_t partition_sizze_203667,\n                                             int64_t l_n_m_203733,\n                                             int64_t i_203",
                   "760,\n                                             int64_t ctx_param_ext_229596,\n                                             int64_t ctx_param_ext_229597,\n                                             int64_t ctx_param_ext_229599,\n                                             __global\n                                             unsigned char *ext_mem_229519,\n                                             __global\n                                             unsigned char *ext_mem_229520,\n                                             __global\n                                             unsigned char *mem_param_229601,\n                                             __global unsigned char *mem_230659,\n                                             __global unsigned char *mem_230982,\n                                             __global unsigned char *mem_230986)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_235404_backing_6 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235404_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_235402_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235402_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_235398_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235398_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_235396_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235396_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_235394_backing_2 =\n                                   (__local volatile\n                                  ",
                   "  unsigned char *) red_arr_mem_235394_backing_aligned_4;\n    __local volatile unsigned char *restrict color_232145_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_232145_backing_aligned_5;\n    __local volatile unsigned char *restrict color_232144_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232144_backing_aligned_6;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235382;\n    int32_t local_tid_235383;\n    int64_t group_sizze_235386;\n    int32_t wave_sizze_235385;\n    int32_t group_tid_235384;\n    \n    global_tid_235382 = get_global_id(0);\n    local_tid_235383 = get_local_id(0);\n    group_sizze_235386 = get_local_size(0);\n    wave_sizze_235385 = LOCKSTEP_WIDTH;\n    group_tid_235384 = get_group_id(0);\n    \n    int32_t phys_tid_221926 = group_tid_235384;\n    int64_t slice_235388 = q_l_203577;\n    int64_t ltid_pre_235387 = sext_i32_i64(local_tid_235383);\n    int64_t remnant_235389 = sext_i32_i64(local_tid_235383) - ltid_pre_235387;\n    int64_t slice_235390 = l_n_m_203733;\n    int64_t slice_235391 = partition_sizze_203667 * slice_235390;\n    int64_t gtid_221924 = squot64(sext_i32_i64(group_tid_235384), slice_235390);\n    int64_t remnant_235392 = sext_i32_i64(group_tid_235384) - gtid_221924 *\n            slice_235390;\n    int64_t gtid_221925 = remnant_235392;\n    int64_t remnant_235393 = remnant_235392 - gtid_221925;\n    __local unsigned char *color_232144;\n    \n    color_232144 = (__local unsigned char *) color_232144_backing_0;\n    \n    __local unsigned char *color_232145;\n    \n    color_232145 = (__local unsigned char *) color_232145_backing_1;\n    \n    int64_t x_221932;\n    \n    x_221932 = ((__global int64_t *) ext_mem_229520)[gtid_221924 *\n                                                     l_n_m_203733 +\n                                                     gtid_221925];\n    \n    doub",
                   "le x_221933;\n    \n    x_221933 = ((__global double *) ext_mem_229519)[gtid_221924 * l_n_m_203733 +\n                                                    gtid_221925];\n    \n    int64_t min_arg_221934 = mul64(jump_t_203582, gtid_221925);\n    int64_t min_res_221935 = smin64(i_203760, min_arg_221934);\n    int64_t defunc_0_g_res_221936 = add64((int64_t) 1, min_res_221935);\n    double defunc_2_reduce_res_221937;\n    double defunc_2_reduce_res_221938;\n    double defunc_2_reduce_res_221939;\n    int64_t gtid_221942 = sext_i32_i64(sext_i64_i32(ltid_pre_235387));\n    int32_t phys_tid_221943 = local_tid_235383;\n    __local unsigned char *red_arr_mem_235394;\n    \n    red_arr_mem_235394 = (__local unsigned char *) red_arr_mem_235394_backing_2;\n    \n    __local unsigned char *red_arr_mem_235396;\n    \n    red_arr_mem_235396 = (__local unsigned char *) red_arr_mem_235396_backing_3;\n    \n    __local unsigned char *red_arr_mem_235398;\n    \n    red_arr_mem_235398 = (__local unsigned char *) red_arr_mem_235398_backing_4;\n    \n    bool cond_221954 = sle64(n_203572, gtid_221942);\n    int64_t defunc_0_f_res_221955;\n    \n    if (cond_221954) {\n        defunc_0_f_res_221955 = (int64_t) 0;\n    } else {\n        int64_t i_221956 = add64(x_221932, gtid_221942);\n        int64_t defunc_1_add_res_221957 = add64((int64_t) 1, i_221956);\n        \n        defunc_0_f_res_221955 = defunc_1_add_res_221957;\n    }\n    \n    double defunc_0_f_res_221958;\n    \n    if (cond_221954) {\n        defunc_0_f_res_221958 = 0.0;\n    } else {\n        int64_t i_221959 = add64(x_221932, gtid_221942);\n        double defunc_0_add_arg_221960;\n        \n        defunc_0_add_arg_221960 = ((__global\n                                    double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                (gtid_221924 *\n                                                                 ctx_param_ext_229597 +\n                                                                 i_221959 *\n        ",
                   "                                                         ctx_param_ext_229599)];\n        defunc_0_f_res_221958 = defunc_0_add_arg_221960;\n    }\n    \n    int64_t binop_p_221961 = sub64(defunc_0_f_res_221955,\n                                   defunc_0_g_res_221936);\n    double defunc_0_f_res_221962 = sitofp_i64_f64(binop_p_221961);\n    double abs_res_221963 = fabs(defunc_0_f_res_221962);\n    double tmp1_221964 = abs_res_221963 / x_221933;\n    double x_221965 = tmp1_221964 * tmp1_221964;\n    double y_221966 = tmp1_221964 * x_221965;\n    double tmp2_221967 = 1.0 - y_221966;\n    double x_221968 = tmp2_221967 * tmp2_221967;\n    double tmp3_221969 = tmp2_221967 * x_221968;\n    double tmp4_221970 = defunc_0_f_res_221958 * tmp3_221969;\n    double defunc_1_f_res_221971 = defunc_0_f_res_221962 * tmp4_221970;\n    double defunc_1_f_res_221972 = defunc_0_f_res_221962 *\n           defunc_1_f_res_221971;\n    \n    ((__local double *) red_arr_mem_235394)[gtid_221942] = tmp4_221970;\n    ((__local double *) red_arr_mem_235396)[gtid_221942] =\n        defunc_1_f_res_221971;\n    ((__local double *) red_arr_mem_235398)[gtid_221942] =\n        defunc_1_f_res_221972;\n    ((__local double *) color_232145)[gtid_221942] = defunc_1_f_res_221971;\n    ((__local double *) color_232144)[gtid_221942] = tmp4_221970;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_235400;\n    int32_t skip_waves_235401 = 1;\n    double x_221944;\n    double x_221945;\n    double x_221946;\n    double x_221947;\n    double x_221948;\n    double x_221949;\n    \n    offset_235400 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_235383, sext_i64_i32(q_l_203577))) {\n            x_221944 = ((__local\n                         double *) red_arr_mem_235394)[sext_i32_i64(local_tid_235383 +\n                                                       offset_235400)];\n            x_221945 = ((__local\n                         double *) red_arr_mem_235396)[sext_i32_i64(local_tid_235383 +\n      ",
                   "                                                 offset_235400)];\n            x_221946 = ((__local\n                         double *) red_arr_mem_235398)[sext_i32_i64(local_tid_235383 +\n                                                       offset_235400)];\n        }\n    }\n    offset_235400 = 1;\n    while (slt32(offset_235400, wave_sizze_235385)) {\n        if (slt32(local_tid_235383 + offset_235400, sext_i64_i32(q_l_203577)) &&\n            ((local_tid_235383 - squot32(local_tid_235383, wave_sizze_235385) *\n              wave_sizze_235385) & (2 * offset_235400 - 1)) == 0) {\n            // read array element\n            {\n                x_221947 = ((volatile __local\n                             double *) red_arr_mem_235394)[sext_i32_i64(local_tid_235383 +\n                                                           offset_235400)];\n                x_221948 = ((volatile __local\n                             double *) red_arr_mem_235396)[sext_i32_i64(local_tid_235383 +\n                                                           offset_235400)];\n                x_221949 = ((volatile __local\n                             double *) red_arr_mem_235398)[sext_i32_i64(local_tid_235383 +\n                                                           offset_235400)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221950 = x_221944 + x_221947;\n                double defunc_1_op_res_221951 = x_221945 + x_221948;\n                double defunc_1_op_res_221952 = x_221946 + x_221949;\n                \n                x_221944 = defunc_1_op_res_221950;\n                x_221945 = defunc_1_op_res_221951;\n                x_221946 = defunc_1_op_res_221952;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_235394)[sext_i32_i64(local_tid_235383)] =\n                    x_221944;\n                ((volatile __local\n                  double *) red_arr_",
                   "mem_235396)[sext_i32_i64(local_tid_235383)] =\n                    x_221945;\n                ((volatile __local\n                  double *) red_arr_mem_235398)[sext_i32_i64(local_tid_235383)] =\n                    x_221946;\n            }\n        }\n        offset_235400 *= 2;\n    }\n    while (slt32(skip_waves_235401, squot32(sext_i64_i32(q_l_203577) +\n                                            wave_sizze_235385 - 1,\n                                            wave_sizze_235385))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_235400 = skip_waves_235401 * wave_sizze_235385;\n        if (slt32(local_tid_235383 + offset_235400, sext_i64_i32(q_l_203577)) &&\n            ((local_tid_235383 - squot32(local_tid_235383, wave_sizze_235385) *\n              wave_sizze_235385) == 0 && (squot32(local_tid_235383,\n                                                  wave_sizze_235385) & (2 *\n                                                                        skip_waves_235401 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_221947 = ((__local\n                             double *) red_arr_mem_235394)[sext_i32_i64(local_tid_235383 +\n                                                           offset_235400)];\n                x_221948 = ((__local\n                             double *) red_arr_mem_235396)[sext_i32_i64(local_tid_235383 +\n                                                           offset_235400)];\n                x_221949 = ((__local\n                             double *) red_arr_mem_235398)[sext_i32_i64(local_tid_235383 +\n                                                           offset_235400)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221950 = x_221944 + x_221947;\n                double defunc_1_op_res_221951 = x_221945 + x_221948;\n                double defunc_1_op_res_221952 = x_2",
                   "21946 + x_221949;\n                \n                x_221944 = defunc_1_op_res_221950;\n                x_221945 = defunc_1_op_res_221951;\n                x_221946 = defunc_1_op_res_221952;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_235394)[sext_i32_i64(local_tid_235383)] =\n                    x_221944;\n                ((__local\n                  double *) red_arr_mem_235396)[sext_i32_i64(local_tid_235383)] =\n                    x_221945;\n                ((__local\n                  double *) red_arr_mem_235398)[sext_i32_i64(local_tid_235383)] =\n                    x_221946;\n            }\n        }\n        skip_waves_235401 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_221937 = ((__local\n                                   double *) red_arr_mem_235394)[(int64_t) 0];\n    defunc_2_reduce_res_221938 = ((__local\n                                   double *) red_arr_mem_235396)[(int64_t) 0];\n    defunc_2_reduce_res_221939 = ((__local\n                                   double *) red_arr_mem_235398)[(int64_t) 0];\n    \n    double x_221973 = defunc_2_reduce_res_221937 * defunc_2_reduce_res_221939;\n    double y_221974 = defunc_2_reduce_res_221938 * defunc_2_reduce_res_221938;\n    double y_221975 = x_221973 - y_221974;\n    double det1_221976 = 1.0 / y_221975;\n    double a11_221977 = defunc_2_reduce_res_221939 * det1_221976;\n    double x_221978 = 0.0 - defunc_2_reduce_res_221938;\n    double b11_221979 = det1_221976 * x_221978;\n    double c11_221980 = defunc_2_reduce_res_221937 * det1_221976;\n    double defunc_2_reduce_res_221981;\n    double defunc_2_reduce_res_221982;\n    int64_t gtid_221983 = sext_i32_i64(sext_i64_i32(ltid_pre_235387));\n    int32_t phys_tid_221984 = local_tid_235383;\n    __local unsigned char *red_arr_mem_235402;\n    \n    red_arr_mem_235402 = (__local unsigned char *) red_arr_mem_235402_backing_5;\n    \n    __local unsigned char *red_arr_mem_235404;\n  ",
                   "  \n    red_arr_mem_235404 = (__local unsigned char *) red_arr_mem_235404_backing_6;\n    \n    double x_221992;\n    \n    x_221992 = ((__local double *) color_232144)[gtid_221983];\n    \n    double x_221993;\n    \n    x_221993 = ((__local double *) color_232145)[gtid_221983];\n    \n    bool cond_221994 = sle64(n_203572, gtid_221983);\n    double defunc_0_f_res_221995;\n    \n    if (cond_221994) {\n        defunc_0_f_res_221995 = 0.0;\n    } else {\n        int64_t i_221996 = add64(x_221932, gtid_221983);\n        double defunc_0_add_arg_221997;\n        \n        defunc_0_add_arg_221997 = ((__global double *) mem_230659)[gtid_221924 *\n                                                                   n_203572 +\n                                                                   i_221996];\n        defunc_0_f_res_221995 = defunc_0_add_arg_221997;\n    }\n    \n    double x_221998 = a11_221977 * x_221992;\n    double y_221999 = b11_221979 * x_221993;\n    double x_222000 = x_221998 + y_221999;\n    double defunc_9_fit_fun_res_222001 = defunc_0_f_res_221995 * x_222000;\n    double x_222002 = b11_221979 * x_221992;\n    double y_222003 = c11_221980 * x_221993;\n    double x_222004 = x_222002 + y_222003;\n    double defunc_9_slope_fun_res_222005 = defunc_0_f_res_221995 * x_222004;\n    \n    ((__local double *) red_arr_mem_235402)[gtid_221983] =\n        defunc_9_fit_fun_res_222001;\n    ((__local double *) red_arr_mem_235404)[gtid_221983] =\n        defunc_9_slope_fun_res_222005;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_235406;\n    int32_t skip_waves_235407 = 1;\n    double x_221985;\n    double x_221986;\n    double x_221987;\n    double x_221988;\n    \n    offset_235406 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_235383, sext_i64_i32(q_l_203577))) {\n            x_221985 = ((__local\n                         double *) red_arr_mem_235402)[sext_i32_i64(local_tid_235383 +\n                                                       offset_235406)];\n",
                   "            x_221986 = ((__local\n                         double *) red_arr_mem_235404)[sext_i32_i64(local_tid_235383 +\n                                                       offset_235406)];\n        }\n    }\n    offset_235406 = 1;\n    while (slt32(offset_235406, wave_sizze_235385)) {\n        if (slt32(local_tid_235383 + offset_235406, sext_i64_i32(q_l_203577)) &&\n            ((local_tid_235383 - squot32(local_tid_235383, wave_sizze_235385) *\n              wave_sizze_235385) & (2 * offset_235406 - 1)) == 0) {\n            // read array element\n            {\n                x_221987 = ((volatile __local\n                             double *) red_arr_mem_235402)[sext_i32_i64(local_tid_235383 +\n                                                           offset_235406)];\n                x_221988 = ((volatile __local\n                             double *) red_arr_mem_235404)[sext_i32_i64(local_tid_235383 +\n                                                           offset_235406)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221989 = x_221985 + x_221987;\n                double defunc_1_op_res_221990 = x_221986 + x_221988;\n                \n                x_221985 = defunc_1_op_res_221989;\n                x_221986 = defunc_1_op_res_221990;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_235402)[sext_i32_i64(local_tid_235383)] =\n                    x_221985;\n                ((volatile __local\n                  double *) red_arr_mem_235404)[sext_i32_i64(local_tid_235383)] =\n                    x_221986;\n            }\n        }\n        offset_235406 *= 2;\n    }\n    while (slt32(skip_waves_235407, squot32(sext_i64_i32(q_l_203577) +\n                                            wave_sizze_235385 - 1,\n                                            wave_sizze_235385))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_235406 ",
                   "= skip_waves_235407 * wave_sizze_235385;\n        if (slt32(local_tid_235383 + offset_235406, sext_i64_i32(q_l_203577)) &&\n            ((local_tid_235383 - squot32(local_tid_235383, wave_sizze_235385) *\n              wave_sizze_235385) == 0 && (squot32(local_tid_235383,\n                                                  wave_sizze_235385) & (2 *\n                                                                        skip_waves_235407 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_221987 = ((__local\n                             double *) red_arr_mem_235402)[sext_i32_i64(local_tid_235383 +\n                                                           offset_235406)];\n                x_221988 = ((__local\n                             double *) red_arr_mem_235404)[sext_i32_i64(local_tid_235383 +\n                                                           offset_235406)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221989 = x_221985 + x_221987;\n                double defunc_1_op_res_221990 = x_221986 + x_221988;\n                \n                x_221985 = defunc_1_op_res_221989;\n                x_221986 = defunc_1_op_res_221990;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_235402)[sext_i32_i64(local_tid_235383)] =\n                    x_221985;\n                ((__local\n                  double *) red_arr_mem_235404)[sext_i32_i64(local_tid_235383)] =\n                    x_221986;\n            }\n        }\n        skip_waves_235407 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_221981 = ((__local\n                                   double *) red_arr_mem_235402)[(int64_t) 0];\n    defunc_2_reduce_res_221982 = ((__local\n                                   double *) red_arr_mem_235404)[(int64_t) 0",
                   "];\n    if (local_tid_235383 == 0) {\n        ((__global double *) mem_230982)[gtid_221924 * l_n_m_203733 +\n                                         gtid_221925] =\n            defunc_2_reduce_res_221981;\n    }\n    if (local_tid_235383 == 0) {\n        ((__global double *) mem_230986)[gtid_221924 * l_n_m_203733 +\n                                         gtid_221925] =\n            defunc_2_reduce_res_221982;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_222183(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *red_arr_mem_235434_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *red_arr_mem_235432_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *red_arr_mem_235428_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *red_arr_mem_235426_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *red_arr_mem_235424_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *red_arr_mem_235422_backing_aligned_5,\n                                             __local volatile\n                                             int64_t *red_arr_mem_235420_backing_aligned_6,\n                                             __local volatile\n                                             int64_t *color_232149_backing_aligned_7,\n                                             __local volatile\n                                             int64_t *color_232148_backing_aligned_8,\n                                             __local volatile\n                                             i",
                   "nt64_t *color_232147_backing_aligned_9,\n                                             __local volatile\n                                             int64_t *color_232146_backing_aligned_10,\n                                             int64_t n_203572,\n                                             int64_t q_l_203577,\n                                             int64_t jump_t_203582,\n                                             int64_t partition_sizze_203667,\n                                             int64_t l_n_m_203733,\n                                             int64_t i_203760,\n                                             int64_t ctx_param_ext_229596,\n                                             int64_t ctx_param_ext_229597,\n                                             int64_t ctx_param_ext_229599,\n                                             __global\n                                             unsigned char *ext_mem_229519,\n                                             __global\n                                             unsigned char *ext_mem_229520,\n                                             __global\n                                             unsigned char *mem_param_229601,\n                                             __global unsigned char *mem_230659,\n                                             __global unsigned char *mem_231006,\n                                             __global unsigned char *mem_231010)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_235434_backing_10 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235434_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_235432_backing_9 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235432_backing_aligned_1;\n    __local vol",
                   "atile unsigned char *restrict red_arr_mem_235428_backing_8 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235428_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_235426_backing_7 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235426_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_235424_backing_6 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235424_backing_aligned_4;\n    __local volatile unsigned char *restrict red_arr_mem_235422_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235422_backing_aligned_5;\n    __local volatile unsigned char *restrict red_arr_mem_235420_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235420_backing_aligned_6;\n    __local volatile unsigned char *restrict color_232149_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) color_232149_backing_aligned_7;\n    __local volatile unsigned char *restrict color_232148_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) color_232148_backing_aligned_8;\n    __local volatile unsigned char *restrict color_232147_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_232147_backing_aligned_9;\n    __local volatile unsigned char *restrict color_232146_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232146_backing_aligned_10;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235",
                   "408;\n    int32_t local_tid_235409;\n    int64_t group_sizze_235412;\n    int32_t wave_sizze_235411;\n    int32_t group_tid_235410;\n    \n    global_tid_235408 = get_global_id(0);\n    local_tid_235409 = get_local_id(0);\n    group_sizze_235412 = get_local_size(0);\n    wave_sizze_235411 = LOCKSTEP_WIDTH;\n    group_tid_235410 = get_group_id(0);\n    \n    int32_t phys_tid_222183 = group_tid_235410;\n    int64_t slice_235414 = q_l_203577;\n    int64_t ltid_pre_235413 = sext_i32_i64(local_tid_235409);\n    int64_t remnant_235415 = sext_i32_i64(local_tid_235409) - ltid_pre_235413;\n    int64_t slice_235416 = l_n_m_203733;\n    int64_t slice_235417 = partition_sizze_203667 * slice_235416;\n    int64_t gtid_222181 = squot64(sext_i32_i64(group_tid_235410), slice_235416);\n    int64_t remnant_235418 = sext_i32_i64(group_tid_235410) - gtid_222181 *\n            slice_235416;\n    int64_t gtid_222182 = remnant_235418;\n    int64_t remnant_235419 = remnant_235418 - gtid_222182;\n    __local unsigned char *color_232146;\n    \n    color_232146 = (__local unsigned char *) color_232146_backing_0;\n    \n    __local unsigned char *color_232147;\n    \n    color_232147 = (__local unsigned char *) color_232147_backing_1;\n    \n    __local unsigned char *color_232148;\n    \n    color_232148 = (__local unsigned char *) color_232148_backing_2;\n    \n    __local unsigned char *color_232149;\n    \n    color_232149 = (__local unsigned char *) color_232149_backing_3;\n    \n    int64_t x_222189;\n    \n    x_222189 = ((__global int64_t *) ext_mem_229520)[gtid_222181 *\n                                                     l_n_m_203733 +\n                                                     gtid_222182];\n    \n    double x_222190;\n    \n    x_222190 = ((__global double *) ext_mem_229519)[gtid_222181 * l_n_m_203733 +\n                                                    gtid_222182];\n    \n    int64_t min_arg_222191 = mul64(jump_t_203582, gtid_222182);\n    int64_t min_res_222192 = smin64(i_203760, min_arg_222191);\n    int64_t defunc",
                   "_0_g_res_222193 = add64((int64_t) 1, min_res_222192);\n    int64_t gtid_222196 = sext_i32_i64(sext_i64_i32(ltid_pre_235413));\n    int32_t phys_tid_222197 = local_tid_235409;\n    bool cond_222199 = sle64(n_203572, gtid_222196);\n    int64_t defunc_0_f_res_222200;\n    \n    if (cond_222199) {\n        defunc_0_f_res_222200 = (int64_t) 0;\n    } else {\n        int64_t i_222201 = add64(x_222189, gtid_222196);\n        int64_t defunc_1_add_res_222202 = add64((int64_t) 1, i_222201);\n        \n        defunc_0_f_res_222200 = defunc_1_add_res_222202;\n    }\n    \n    double defunc_0_f_res_222203;\n    \n    if (cond_222199) {\n        defunc_0_f_res_222203 = 0.0;\n    } else {\n        int64_t i_222204 = add64(x_222189, gtid_222196);\n        double defunc_0_add_arg_222205;\n        \n        defunc_0_add_arg_222205 = ((__global\n                                    double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                (gtid_222181 *\n                                                                 ctx_param_ext_229597 +\n                                                                 i_222204 *\n                                                                 ctx_param_ext_229599)];\n        defunc_0_f_res_222203 = defunc_0_add_arg_222205;\n    }\n    \n    int64_t binop_p_222206 = sub64(defunc_0_f_res_222200,\n                                   defunc_0_g_res_222193);\n    double defunc_0_f_res_222207 = sitofp_i64_f64(binop_p_222206);\n    double abs_res_222208 = fabs(defunc_0_f_res_222207);\n    double tmp1_222209 = abs_res_222208 / x_222190;\n    double x_222210 = tmp1_222209 * tmp1_222209;\n    double y_222211 = tmp1_222209 * x_222210;\n    double tmp2_222212 = 1.0 - y_222211;\n    double x_222213 = tmp2_222212 * tmp2_222212;\n    double tmp3_222214 = tmp2_222212 * x_222213;\n    double tmp4_222215 = defunc_0_f_res_222203 * tmp3_222214;\n    \n    ((__local double *) color_232149)[gtid_222196] = defunc_0_f_res_222207;\n    ((__local double *) col",
                   "or_232148)[gtid_222196] = tmp4_222215;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    double defunc_2_reduce_res_222216;\n    double defunc_2_reduce_res_222217;\n    double defunc_2_reduce_res_222218;\n    double defunc_2_reduce_res_222219;\n    double defunc_2_reduce_res_222220;\n    int64_t gtid_222223 = sext_i32_i64(sext_i64_i32(ltid_pre_235413));\n    int32_t phys_tid_222224 = local_tid_235409;\n    __local unsigned char *red_arr_mem_235420;\n    \n    red_arr_mem_235420 = (__local unsigned char *) red_arr_mem_235420_backing_4;\n    \n    __local unsigned char *red_arr_mem_235422;\n    \n    red_arr_mem_235422 = (__local unsigned char *) red_arr_mem_235422_backing_5;\n    \n    __local unsigned char *red_arr_mem_235424;\n    \n    red_arr_mem_235424 = (__local unsigned char *) red_arr_mem_235424_backing_6;\n    \n    __local unsigned char *red_arr_mem_235426;\n    \n    red_arr_mem_235426 = (__local unsigned char *) red_arr_mem_235426_backing_7;\n    \n    __local unsigned char *red_arr_mem_235428;\n    \n    red_arr_mem_235428 = (__local unsigned char *) red_arr_mem_235428_backing_8;\n    \n    double x_222240;\n    \n    x_222240 = ((__local double *) color_232149)[gtid_222223];\n    \n    double x_222241;\n    \n    x_222241 = ((__local double *) color_232148)[gtid_222223];\n    \n    double defunc_1_f_res_222242 = x_222240 * x_222241;\n    double defunc_1_f_res_222243 = x_222240 * defunc_1_f_res_222242;\n    double defunc_1_f_res_222244 = x_222240 * defunc_1_f_res_222243;\n    double defunc_1_f_res_222245 = x_222240 * defunc_1_f_res_222244;\n    \n    ((__local double *) red_arr_mem_235420)[gtid_222223] = x_222241;\n    ((__local double *) red_arr_mem_235422)[gtid_222223] =\n        defunc_1_f_res_222242;\n    ((__local double *) red_arr_mem_235424)[gtid_222223] =\n        defunc_1_f_res_222243;\n    ((__local double *) red_arr_mem_235426)[gtid_222223] =\n        defunc_1_f_res_222244;\n    ((__local double *) red_arr_mem_235428)[gtid_222223] =\n        defunc_1_f_res_222245;\n    ((__local double *) color_232",
                   "147)[gtid_222223] = defunc_1_f_res_222243;\n    ((__local double *) color_232146)[gtid_222223] = defunc_1_f_res_222242;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_235430;\n    int32_t skip_waves_235431 = 1;\n    double x_222225;\n    double x_222226;\n    double x_222227;\n    double x_222228;\n    double x_222229;\n    double x_222230;\n    double x_222231;\n    double x_222232;\n    double x_222233;\n    double x_222234;\n    \n    offset_235430 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_235409, sext_i64_i32(q_l_203577))) {\n            x_222225 = ((__local\n                         double *) red_arr_mem_235420)[sext_i32_i64(local_tid_235409 +\n                                                       offset_235430)];\n            x_222226 = ((__local\n                         double *) red_arr_mem_235422)[sext_i32_i64(local_tid_235409 +\n                                                       offset_235430)];\n            x_222227 = ((__local\n                         double *) red_arr_mem_235424)[sext_i32_i64(local_tid_235409 +\n                                                       offset_235430)];\n            x_222228 = ((__local\n                         double *) red_arr_mem_235426)[sext_i32_i64(local_tid_235409 +\n                                                       offset_235430)];\n            x_222229 = ((__local\n                         double *) red_arr_mem_235428)[sext_i32_i64(local_tid_235409 +\n                                                       offset_235430)];\n        }\n    }\n    offset_235430 = 1;\n    while (slt32(offset_235430, wave_sizze_235411)) {\n        if (slt32(local_tid_235409 + offset_235430, sext_i64_i32(q_l_203577)) &&\n            ((local_tid_235409 - squot32(local_tid_235409, wave_sizze_235411) *\n              wave_sizze_235411) & (2 * offset_235430 - 1)) == 0) {\n            // read array element\n            {\n                x_222230 = ((volatile __local\n                             double *) re",
                   "d_arr_mem_235420)[sext_i32_i64(local_tid_235409 +\n                                                           offset_235430)];\n                x_222231 = ((volatile __local\n                             double *) red_arr_mem_235422)[sext_i32_i64(local_tid_235409 +\n                                                           offset_235430)];\n                x_222232 = ((volatile __local\n                             double *) red_arr_mem_235424)[sext_i32_i64(local_tid_235409 +\n                                                           offset_235430)];\n                x_222233 = ((volatile __local\n                             double *) red_arr_mem_235426)[sext_i32_i64(local_tid_235409 +\n                                                           offset_235430)];\n                x_222234 = ((volatile __local\n                             double *) red_arr_mem_235428)[sext_i32_i64(local_tid_235409 +\n                                                           offset_235430)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_222235 = x_222225 + x_222230;\n                double defunc_1_op_res_222236 = x_222226 + x_222231;\n                double defunc_1_op_res_222237 = x_222227 + x_222232;\n                double defunc_1_op_res_222238 = x_222228 + x_222233;\n                double defunc_1_op_res_222239 = x_222229 + x_222234;\n                \n                x_222225 = defunc_1_op_res_222235;\n                x_222226 = defunc_1_op_res_222236;\n                x_222227 = defunc_1_op_res_222237;\n                x_222228 = defunc_1_op_res_222238;\n                x_222229 = defunc_1_op_res_222239;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_235420)[sext_i32_i64(local_tid_235409)] =\n                    x_222225;\n                ((volatile __local\n                  double *) red_arr_mem_235422)[sext_i32_i64(local_tid_235409)] =\n   ",
                   "                 x_222226;\n                ((volatile __local\n                  double *) red_arr_mem_235424)[sext_i32_i64(local_tid_235409)] =\n                    x_222227;\n                ((volatile __local\n                  double *) red_arr_mem_235426)[sext_i32_i64(local_tid_235409)] =\n                    x_222228;\n                ((volatile __local\n                  double *) red_arr_mem_235428)[sext_i32_i64(local_tid_235409)] =\n                    x_222229;\n            }\n        }\n        offset_235430 *= 2;\n    }\n    while (slt32(skip_waves_235431, squot32(sext_i64_i32(q_l_203577) +\n                                            wave_sizze_235411 - 1,\n                                            wave_sizze_235411))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_235430 = skip_waves_235431 * wave_sizze_235411;\n        if (slt32(local_tid_235409 + offset_235430, sext_i64_i32(q_l_203577)) &&\n            ((local_tid_235409 - squot32(local_tid_235409, wave_sizze_235411) *\n              wave_sizze_235411) == 0 && (squot32(local_tid_235409,\n                                                  wave_sizze_235411) & (2 *\n                                                                        skip_waves_235431 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_222230 = ((__local\n                             double *) red_arr_mem_235420)[sext_i32_i64(local_tid_235409 +\n                                                           offset_235430)];\n                x_222231 = ((__local\n                             double *) red_arr_mem_235422)[sext_i32_i64(local_tid_235409 +\n                                                           offset_235430)];\n                x_222232 = ((__local\n                             double *) red_arr_mem_235424)[sext_i32_i64(local_tid_235409 +\n                                                           offset_235430)];\n             ",
                   "   x_222233 = ((__local\n                             double *) red_arr_mem_235426)[sext_i32_i64(local_tid_235409 +\n                                                           offset_235430)];\n                x_222234 = ((__local\n                             double *) red_arr_mem_235428)[sext_i32_i64(local_tid_235409 +\n                                                           offset_235430)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_222235 = x_222225 + x_222230;\n                double defunc_1_op_res_222236 = x_222226 + x_222231;\n                double defunc_1_op_res_222237 = x_222227 + x_222232;\n                double defunc_1_op_res_222238 = x_222228 + x_222233;\n                double defunc_1_op_res_222239 = x_222229 + x_222234;\n                \n                x_222225 = defunc_1_op_res_222235;\n                x_222226 = defunc_1_op_res_222236;\n                x_222227 = defunc_1_op_res_222237;\n                x_222228 = defunc_1_op_res_222238;\n                x_222229 = defunc_1_op_res_222239;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_235420)[sext_i32_i64(local_tid_235409)] =\n                    x_222225;\n                ((__local\n                  double *) red_arr_mem_235422)[sext_i32_i64(local_tid_235409)] =\n                    x_222226;\n                ((__local\n                  double *) red_arr_mem_235424)[sext_i32_i64(local_tid_235409)] =\n                    x_222227;\n                ((__local\n                  double *) red_arr_mem_235426)[sext_i32_i64(local_tid_235409)] =\n                    x_222228;\n                ((__local\n                  double *) red_arr_mem_235428)[sext_i32_i64(local_tid_235409)] =\n                    x_222229;\n            }\n        }\n        skip_waves_235431 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_222216 = ((__local\n                     ",
                   "              double *) red_arr_mem_235420)[(int64_t) 0];\n    defunc_2_reduce_res_222217 = ((__local\n                                   double *) red_arr_mem_235422)[(int64_t) 0];\n    defunc_2_reduce_res_222218 = ((__local\n                                   double *) red_arr_mem_235424)[(int64_t) 0];\n    defunc_2_reduce_res_222219 = ((__local\n                                   double *) red_arr_mem_235426)[(int64_t) 0];\n    defunc_2_reduce_res_222220 = ((__local\n                                   double *) red_arr_mem_235428)[(int64_t) 0];\n    \n    double x_222246 = defunc_2_reduce_res_222218 * defunc_2_reduce_res_222220;\n    double y_222247 = defunc_2_reduce_res_222219 * defunc_2_reduce_res_222219;\n    double a12_222248 = x_222246 - y_222247;\n    double x_222249 = defunc_2_reduce_res_222218 * defunc_2_reduce_res_222219;\n    double y_222250 = defunc_2_reduce_res_222217 * defunc_2_reduce_res_222220;\n    double b12_222251 = x_222249 - y_222250;\n    double x_222252 = defunc_2_reduce_res_222217 * defunc_2_reduce_res_222219;\n    double y_222253 = defunc_2_reduce_res_222218 * defunc_2_reduce_res_222218;\n    double c12_222254 = x_222252 - y_222253;\n    double x_222255 = defunc_2_reduce_res_222216 * defunc_2_reduce_res_222220;\n    double b2_222256 = x_222255 - y_222253;\n    double x_222257 = defunc_2_reduce_res_222217 * defunc_2_reduce_res_222218;\n    double y_222258 = defunc_2_reduce_res_222216 * defunc_2_reduce_res_222219;\n    double c2_222259 = x_222257 - y_222258;\n    double x_222260 = defunc_2_reduce_res_222216 * a12_222248;\n    double y_222261 = defunc_2_reduce_res_222217 * b12_222251;\n    double x_222262 = x_222260 + y_222261;\n    double y_222263 = defunc_2_reduce_res_222218 * c12_222254;\n    double y_222264 = x_222262 + y_222263;\n    double det_222265 = 1.0 / y_222264;\n    double a12_222266 = a12_222248 * det_222265;\n    double b12_222267 = b12_222251 * det_222265;\n    double c12_222268 = c12_222254 * det_222265;\n    double b2_222269 = b2_222256 * det_222265;\n    do",
                   "uble c2_222270 = c2_222259 * det_222265;\n    double defunc_2_reduce_res_222271;\n    double defunc_2_reduce_res_222272;\n    int64_t gtid_222273 = sext_i32_i64(sext_i64_i32(ltid_pre_235413));\n    int32_t phys_tid_222274 = local_tid_235409;\n    __local unsigned char *red_arr_mem_235432;\n    \n    red_arr_mem_235432 = (__local unsigned char *) red_arr_mem_235432_backing_9;\n    \n    __local unsigned char *red_arr_mem_235434;\n    \n    red_arr_mem_235434 = (__local\n                          unsigned char *) red_arr_mem_235434_backing_10;\n    \n    double x_222282;\n    \n    x_222282 = ((__local double *) color_232148)[gtid_222273];\n    \n    double x_222283;\n    \n    x_222283 = ((__local double *) color_232146)[gtid_222273];\n    \n    double x_222284;\n    \n    x_222284 = ((__local double *) color_232147)[gtid_222273];\n    \n    bool cond_222285 = sle64(n_203572, gtid_222273);\n    double defunc_0_f_res_222286;\n    \n    if (cond_222285) {\n        defunc_0_f_res_222286 = 0.0;\n    } else {\n        int64_t i_222287 = add64(x_222189, gtid_222273);\n        double defunc_0_add_arg_222288;\n        \n        defunc_0_add_arg_222288 = ((__global double *) mem_230659)[gtid_222181 *\n                                                                   n_203572 +\n                                                                   i_222287];\n        defunc_0_f_res_222286 = defunc_0_add_arg_222288;\n    }\n    \n    double x_222289 = a12_222266 * x_222282;\n    double y_222290 = b12_222267 * x_222283;\n    double x_222291 = x_222289 + y_222290;\n    double y_222292 = c12_222268 * x_222284;\n    double x_222293 = x_222291 + y_222292;\n    double defunc_9_fit_fun_res_222294 = defunc_0_f_res_222286 * x_222293;\n    double x_222295 = b12_222267 * x_222282;\n    double y_222296 = b2_222269 * x_222283;\n    double x_222297 = x_222295 + y_222296;\n    double y_222298 = c2_222270 * x_222284;\n    double x_222299 = x_222297 + y_222298;\n    double defunc_9_slope_fun_res_222300 = defunc_0_f_res_222286 * x_222299;\n    \n    ",
                   "((__local double *) red_arr_mem_235432)[gtid_222273] =\n        defunc_9_fit_fun_res_222294;\n    ((__local double *) red_arr_mem_235434)[gtid_222273] =\n        defunc_9_slope_fun_res_222300;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_235436;\n    int32_t skip_waves_235437 = 1;\n    double x_222275;\n    double x_222276;\n    double x_222277;\n    double x_222278;\n    \n    offset_235436 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_235409, sext_i64_i32(q_l_203577))) {\n            x_222275 = ((__local\n                         double *) red_arr_mem_235432)[sext_i32_i64(local_tid_235409 +\n                                                       offset_235436)];\n            x_222276 = ((__local\n                         double *) red_arr_mem_235434)[sext_i32_i64(local_tid_235409 +\n                                                       offset_235436)];\n        }\n    }\n    offset_235436 = 1;\n    while (slt32(offset_235436, wave_sizze_235411)) {\n        if (slt32(local_tid_235409 + offset_235436, sext_i64_i32(q_l_203577)) &&\n            ((local_tid_235409 - squot32(local_tid_235409, wave_sizze_235411) *\n              wave_sizze_235411) & (2 * offset_235436 - 1)) == 0) {\n            // read array element\n            {\n                x_222277 = ((volatile __local\n                             double *) red_arr_mem_235432)[sext_i32_i64(local_tid_235409 +\n                                                           offset_235436)];\n                x_222278 = ((volatile __local\n                             double *) red_arr_mem_235434)[sext_i32_i64(local_tid_235409 +\n                                                           offset_235436)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_222279 = x_222275 + x_222277;\n                double defunc_1_op_res_222280 = x_222276 + x_222278;\n                \n                x_222275 = defunc_1_op_res_222279;\n                x",
                   "_222276 = defunc_1_op_res_222280;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_235432)[sext_i32_i64(local_tid_235409)] =\n                    x_222275;\n                ((volatile __local\n                  double *) red_arr_mem_235434)[sext_i32_i64(local_tid_235409)] =\n                    x_222276;\n            }\n        }\n        offset_235436 *= 2;\n    }\n    while (slt32(skip_waves_235437, squot32(sext_i64_i32(q_l_203577) +\n                                            wave_sizze_235411 - 1,\n                                            wave_sizze_235411))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_235436 = skip_waves_235437 * wave_sizze_235411;\n        if (slt32(local_tid_235409 + offset_235436, sext_i64_i32(q_l_203577)) &&\n            ((local_tid_235409 - squot32(local_tid_235409, wave_sizze_235411) *\n              wave_sizze_235411) == 0 && (squot32(local_tid_235409,\n                                                  wave_sizze_235411) & (2 *\n                                                                        skip_waves_235437 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_222277 = ((__local\n                             double *) red_arr_mem_235432)[sext_i32_i64(local_tid_235409 +\n                                                           offset_235436)];\n                x_222278 = ((__local\n                             double *) red_arr_mem_235434)[sext_i32_i64(local_tid_235409 +\n                                                           offset_235436)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_222279 = x_222275 + x_222277;\n                double defunc_1_op_res_222280 = x_222276 + x_222278;\n                \n                x_222275 = defunc_1_op_res_222279;\n             ",
                   "   x_222276 = defunc_1_op_res_222280;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_235432)[sext_i32_i64(local_tid_235409)] =\n                    x_222275;\n                ((__local\n                  double *) red_arr_mem_235434)[sext_i32_i64(local_tid_235409)] =\n                    x_222276;\n            }\n        }\n        skip_waves_235437 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_222271 = ((__local\n                                   double *) red_arr_mem_235432)[(int64_t) 0];\n    defunc_2_reduce_res_222272 = ((__local\n                                   double *) red_arr_mem_235434)[(int64_t) 0];\n    if (local_tid_235409 == 0) {\n        ((__global double *) mem_231006)[gtid_222181 * l_n_m_203733 +\n                                         gtid_222182] =\n            defunc_2_reduce_res_222271;\n    }\n    if (local_tid_235409 == 0) {\n        ((__global double *) mem_231010)[gtid_222181 * l_n_m_203733 +\n                                         gtid_222182] =\n            defunc_2_reduce_res_222272;\n    }\n    \n  error_5:\n    return;\n}\n__kernel void mainzisegmap_intragroup_226007(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *red_arr_mem_236294_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *red_arr_mem_236290_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *color_232164_backing_aligned_2,\n                                             int64_t n_203572,\n                                             int64_t q_t_203576,\n                                             int64_t jump_t_203582,\n                                             int64_t partition_sizze_203667,\n                                 ",
                   "            int64_t t_n_m_203740,\n                                             int64_t i_203760, __global\n                                             unsigned char *ext_mem_229304,\n                                             __global\n                                             unsigned char *ext_mem_229305,\n                                             __global\n                                             unsigned char *ext_mem_229568,\n                                             __global\n                                             unsigned char *ext_mem_229569,\n                                             __global unsigned char *mem_231524,\n                                             __global unsigned char *mem_231528,\n                                             __global unsigned char *mem_231538)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_236294_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236294_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_236290_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236290_backing_aligned_1;\n    __local volatile unsigned char *restrict color_232164_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232164_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236278;\n    int32_t local_tid_236279;\n    int64_t group_sizze_236282;\n    int32_t wave_sizze_236281;\n    int32_t group_tid_236280;\n    \n    global_tid_236278 = get_global_id(0);\n    local_tid_236279 = get_local_id(0);\n    group_sizze_236282 = get_local_size(0);\n    wave_sizze_236281 = LOCKSTEP_WIDTH;\n    group_tid_236280 = get_group_id(0);\n    \n    int32_t phys_ti",
                   "d_226007 = group_tid_236280;\n    int64_t slice_236284 = q_t_203576;\n    int64_t ltid_pre_236283 = sext_i32_i64(local_tid_236279);\n    int64_t remnant_236285 = sext_i32_i64(local_tid_236279) - ltid_pre_236283;\n    int64_t slice_236286 = t_n_m_203740;\n    int64_t slice_236287 = partition_sizze_203667 * slice_236286;\n    int64_t gtid_226005 = squot64(sext_i32_i64(group_tid_236280), slice_236286);\n    int64_t remnant_236288 = sext_i32_i64(group_tid_236280) - gtid_226005 *\n            slice_236286;\n    int64_t gtid_226006 = remnant_236288;\n    int64_t remnant_236289 = remnant_236288 - gtid_226006;\n    __local unsigned char *color_232164;\n    \n    color_232164 = (__local unsigned char *) color_232164_backing_0;\n    \n    int64_t x_226010;\n    \n    x_226010 = ((__global int64_t *) ext_mem_229304)[gtid_226005];\n    \n    int64_t x_226016;\n    \n    x_226016 = ((__global int64_t *) ext_mem_229569)[gtid_226005 *\n                                                     t_n_m_203740 +\n                                                     gtid_226006];\n    \n    double x_226017;\n    \n    x_226017 = ((__global double *) ext_mem_229568)[gtid_226005 * t_n_m_203740 +\n                                                    gtid_226006];\n    \n    int64_t min_arg_226018 = mul64(jump_t_203582, gtid_226006);\n    int64_t min_res_226019 = smin64(i_203760, min_arg_226018);\n    int64_t defunc_0_g_res_226020 = add64((int64_t) 1, min_res_226019);\n    double defunc_2_reduce_res_226021;\n    int64_t gtid_226023 = sext_i32_i64(sext_i64_i32(ltid_pre_236283));\n    int32_t phys_tid_226024 = local_tid_236279;\n    __local unsigned char *red_arr_mem_236290;\n    \n    red_arr_mem_236290 = (__local unsigned char *) red_arr_mem_236290_backing_1;\n    \n    bool cond_226029 = sle64(x_226010, gtid_226023);\n    int64_t defunc_0_f_res_226030;\n    \n    if (cond_226029) {\n        defunc_0_f_res_226030 = (int64_t) 0;\n    } else {\n        int64_t i_226031 = add64(x_226016, gtid_226023);\n        int64_t defunc_0_add_arg_226032;\n  ",
                   "      \n        defunc_0_add_arg_226032 = ((__global\n                                    int64_t *) ext_mem_229305)[gtid_226005 *\n                                                               n_203572 +\n                                                               i_226031];\n        \n        int64_t defunc_1_add_res_226033 = add64((int64_t) 1,\n                                                defunc_0_add_arg_226032);\n        \n        defunc_0_f_res_226030 = defunc_1_add_res_226033;\n    }\n    \n    double defunc_0_f_res_226034;\n    \n    if (cond_226029) {\n        defunc_0_f_res_226034 = 0.0;\n    } else {\n        int64_t i_226035 = add64(x_226016, gtid_226023);\n        double defunc_0_add_arg_226036;\n        \n        defunc_0_add_arg_226036 = ((__global double *) mem_231524)[gtid_226005 *\n                                                                   n_203572 +\n                                                                   i_226035];\n        defunc_0_f_res_226034 = defunc_0_add_arg_226036;\n    }\n    \n    int64_t binop_p_226037 = sub64(defunc_0_f_res_226030,\n                                   defunc_0_g_res_226020);\n    double defunc_0_f_res_226038 = sitofp_i64_f64(binop_p_226037);\n    double abs_res_226039 = fabs(defunc_0_f_res_226038);\n    double tmp1_226040 = abs_res_226039 / x_226017;\n    double x_226041 = tmp1_226040 * tmp1_226040;\n    double y_226042 = tmp1_226040 * x_226041;\n    double tmp2_226043 = 1.0 - y_226042;\n    double x_226044 = tmp2_226043 * tmp2_226043;\n    double tmp3_226045 = tmp2_226043 * x_226044;\n    double tmp4_226046 = defunc_0_f_res_226034 * tmp3_226045;\n    \n    ((__local double *) red_arr_mem_236290)[gtid_226023] = tmp4_226046;\n    ((__local double *) color_232164)[gtid_226023] = tmp4_226046;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_236292;\n    int32_t skip_waves_236293 = 1;\n    double x_226025;\n    double x_226026;\n    \n    offset_236292 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt3",
                   "2(local_tid_236279, sext_i64_i32(q_t_203576))) {\n            x_226025 = ((__local\n                         double *) red_arr_mem_236290)[sext_i32_i64(local_tid_236279 +\n                                                       offset_236292)];\n        }\n    }\n    offset_236292 = 1;\n    while (slt32(offset_236292, wave_sizze_236281)) {\n        if (slt32(local_tid_236279 + offset_236292, sext_i64_i32(q_t_203576)) &&\n            ((local_tid_236279 - squot32(local_tid_236279, wave_sizze_236281) *\n              wave_sizze_236281) & (2 * offset_236292 - 1)) == 0) {\n            // read array element\n            {\n                x_226026 = ((volatile __local\n                             double *) red_arr_mem_236290)[sext_i32_i64(local_tid_236279 +\n                                                           offset_236292)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226027 = x_226025 + x_226026;\n                \n                x_226025 = defunc_1_op_res_226027;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_236290)[sext_i32_i64(local_tid_236279)] =\n                    x_226025;\n            }\n        }\n        offset_236292 *= 2;\n    }\n    while (slt32(skip_waves_236293, squot32(sext_i64_i32(q_t_203576) +\n                                            wave_sizze_236281 - 1,\n                                            wave_sizze_236281))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_236292 = skip_waves_236293 * wave_sizze_236281;\n        if (slt32(local_tid_236279 + offset_236292, sext_i64_i32(q_t_203576)) &&\n            ((local_tid_236279 - squot32(local_tid_236279, wave_sizze_236281) *\n              wave_sizze_236281) == 0 && (squot32(local_tid_236279,\n                                                  wave_sizze_236281) & (2 *\n                                                                        skip_waves_23",
                   "6293 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_226026 = ((__local\n                             double *) red_arr_mem_236290)[sext_i32_i64(local_tid_236279 +\n                                                           offset_236292)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226027 = x_226025 + x_226026;\n                \n                x_226025 = defunc_1_op_res_226027;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_236290)[sext_i32_i64(local_tid_236279)] =\n                    x_226025;\n            }\n        }\n        skip_waves_236293 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_226021 = ((__local\n                                   double *) red_arr_mem_236290)[(int64_t) 0];\n    \n    double a0_226047 = 1.0 / defunc_2_reduce_res_226021;\n    double defunc_2_reduce_res_226048;\n    int64_t gtid_226049 = sext_i32_i64(sext_i64_i32(ltid_pre_236283));\n    int32_t phys_tid_226050 = local_tid_236279;\n    __local unsigned char *red_arr_mem_236294;\n    \n    red_arr_mem_236294 = (__local unsigned char *) red_arr_mem_236294_backing_2;\n    \n    double x_226055;\n    \n    x_226055 = ((__local double *) color_232164)[gtid_226049];\n    \n    bool cond_226056 = sle64(x_226010, gtid_226049);\n    double defunc_0_f_res_226057;\n    \n    if (cond_226056) {\n        defunc_0_f_res_226057 = 0.0;\n    } else {\n        int64_t i_226058 = add64(x_226016, gtid_226049);\n        double defunc_0_add_arg_226059;\n        \n        defunc_0_add_arg_226059 = ((__global double *) mem_231528)[gtid_226005 *\n                                                                   n_203572 +\n                                                                   i_226058];\n        defunc_0_f_res_226057 = defunc_0_add_arg_226",
                   "059;\n    }\n    \n    double x_226060 = a0_226047 * x_226055;\n    double defunc_9_fit_fun_res_226061 = defunc_0_f_res_226057 * x_226060;\n    \n    ((__local double *) red_arr_mem_236294)[gtid_226049] =\n        defunc_9_fit_fun_res_226061;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_236296;\n    int32_t skip_waves_236297 = 1;\n    double x_226051;\n    double x_226052;\n    \n    offset_236296 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_236279, sext_i64_i32(q_t_203576))) {\n            x_226051 = ((__local\n                         double *) red_arr_mem_236294)[sext_i32_i64(local_tid_236279 +\n                                                       offset_236296)];\n        }\n    }\n    offset_236296 = 1;\n    while (slt32(offset_236296, wave_sizze_236281)) {\n        if (slt32(local_tid_236279 + offset_236296, sext_i64_i32(q_t_203576)) &&\n            ((local_tid_236279 - squot32(local_tid_236279, wave_sizze_236281) *\n              wave_sizze_236281) & (2 * offset_236296 - 1)) == 0) {\n            // read array element\n            {\n                x_226052 = ((volatile __local\n                             double *) red_arr_mem_236294)[sext_i32_i64(local_tid_236279 +\n                                                           offset_236296)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226053 = x_226051 + x_226052;\n                \n                x_226051 = defunc_1_op_res_226053;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_236294)[sext_i32_i64(local_tid_236279)] =\n                    x_226051;\n            }\n        }\n        offset_236296 *= 2;\n    }\n    while (slt32(skip_waves_236297, squot32(sext_i64_i32(q_t_203576) +\n                                            wave_sizze_236281 - 1,\n                                            wave_sizze_236281))) {\n        ",
                   "barrier(CLK_LOCAL_MEM_FENCE);\n        offset_236296 = skip_waves_236297 * wave_sizze_236281;\n        if (slt32(local_tid_236279 + offset_236296, sext_i64_i32(q_t_203576)) &&\n            ((local_tid_236279 - squot32(local_tid_236279, wave_sizze_236281) *\n              wave_sizze_236281) == 0 && (squot32(local_tid_236279,\n                                                  wave_sizze_236281) & (2 *\n                                                                        skip_waves_236297 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_226052 = ((__local\n                             double *) red_arr_mem_236294)[sext_i32_i64(local_tid_236279 +\n                                                           offset_236296)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226053 = x_226051 + x_226052;\n                \n                x_226051 = defunc_1_op_res_226053;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_236294)[sext_i32_i64(local_tid_236279)] =\n                    x_226051;\n            }\n        }\n        skip_waves_236297 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_226048 = ((__local\n                                   double *) red_arr_mem_236294)[(int64_t) 0];\n    if (local_tid_236279 == 0) {\n        ((__global double *) mem_231538)[gtid_226005 * t_n_m_203740 +\n                                         gtid_226006] =\n            defunc_2_reduce_res_226048;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_226320(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *red_arr_mem_236340_backing_aligned_0,\n                                             __local volatile\n   ",
                   "                                          int64_t *red_arr_mem_236338_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *red_arr_mem_236334_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *red_arr_mem_236332_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *red_arr_mem_236330_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *color_232166_backing_aligned_5,\n                                             __local volatile\n                                             int64_t *color_232165_backing_aligned_6,\n                                             int64_t n_203572,\n                                             int64_t q_t_203576,\n                                             int64_t jump_t_203582,\n                                             int64_t partition_sizze_203667,\n                                             int64_t t_n_m_203740,\n                                             int64_t i_203760, __global\n                                             unsigned char *ext_mem_229304,\n                                             __global\n                                             unsigned char *ext_mem_229305,\n                                             __global\n                                             unsigned char *ext_mem_229568,\n                                             __global\n                                             unsigned char *ext_mem_229569,\n                                             __global unsigned char *mem_231548,\n                                             __global unsigned char *mem_231552,\n                                             __global unsigned char *mem_231565,\n                                ",
                   "             __global unsigned char *mem_231569)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_236340_backing_6 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236340_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_236338_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236338_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_236334_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236334_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_236332_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236332_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_236330_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236330_backing_aligned_4;\n    __local volatile unsigned char *restrict color_232166_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_232166_backing_aligned_5;\n    __local volatile unsigned char *restrict color_232165_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232165_backing_aligned_6;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236318;\n    int32_t local_tid_236319;\n    int64_t group_sizze_236322;\n    int32_t wave_sizze_236321;\n    int32_t group_tid_236320;\n    \n    global_tid_236318 = get_global_id(0);\n    local_tid_236319 = get_local_id(0);\n    group_sizze_236322 = get_local_size(0);\n  ",
                   "  wave_sizze_236321 = LOCKSTEP_WIDTH;\n    group_tid_236320 = get_group_id(0);\n    \n    int32_t phys_tid_226320 = group_tid_236320;\n    int64_t slice_236324 = q_t_203576;\n    int64_t ltid_pre_236323 = sext_i32_i64(local_tid_236319);\n    int64_t remnant_236325 = sext_i32_i64(local_tid_236319) - ltid_pre_236323;\n    int64_t slice_236326 = t_n_m_203740;\n    int64_t slice_236327 = partition_sizze_203667 * slice_236326;\n    int64_t gtid_226318 = squot64(sext_i32_i64(group_tid_236320), slice_236326);\n    int64_t remnant_236328 = sext_i32_i64(group_tid_236320) - gtid_226318 *\n            slice_236326;\n    int64_t gtid_226319 = remnant_236328;\n    int64_t remnant_236329 = remnant_236328 - gtid_226319;\n    __local unsigned char *color_232165;\n    \n    color_232165 = (__local unsigned char *) color_232165_backing_0;\n    \n    __local unsigned char *color_232166;\n    \n    color_232166 = (__local unsigned char *) color_232166_backing_1;\n    \n    int64_t x_226323;\n    \n    x_226323 = ((__global int64_t *) ext_mem_229304)[gtid_226318];\n    \n    int64_t x_226329;\n    \n    x_226329 = ((__global int64_t *) ext_mem_229569)[gtid_226318 *\n                                                     t_n_m_203740 +\n                                                     gtid_226319];\n    \n    double x_226330;\n    \n    x_226330 = ((__global double *) ext_mem_229568)[gtid_226318 * t_n_m_203740 +\n                                                    gtid_226319];\n    \n    int64_t min_arg_226331 = mul64(jump_t_203582, gtid_226319);\n    int64_t min_res_226332 = smin64(i_203760, min_arg_226331);\n    int64_t defunc_0_g_res_226333 = add64((int64_t) 1, min_res_226332);\n    double defunc_2_reduce_res_226334;\n    double defunc_2_reduce_res_226335;\n    double defunc_2_reduce_res_226336;\n    int64_t gtid_226339 = sext_i32_i64(sext_i64_i32(ltid_pre_236323));\n    int32_t phys_tid_226340 = local_tid_236319;\n    __local unsigned char *red_arr_mem_236330;\n    \n    red_arr_mem_236330 = (__local unsigned char *) red_arr_m",
                   "em_236330_backing_2;\n    \n    __local unsigned char *red_arr_mem_236332;\n    \n    red_arr_mem_236332 = (__local unsigned char *) red_arr_mem_236332_backing_3;\n    \n    __local unsigned char *red_arr_mem_236334;\n    \n    red_arr_mem_236334 = (__local unsigned char *) red_arr_mem_236334_backing_4;\n    \n    bool cond_226351 = sle64(x_226323, gtid_226339);\n    int64_t defunc_0_f_res_226352;\n    \n    if (cond_226351) {\n        defunc_0_f_res_226352 = (int64_t) 0;\n    } else {\n        int64_t i_226353 = add64(x_226329, gtid_226339);\n        int64_t defunc_0_add_arg_226354;\n        \n        defunc_0_add_arg_226354 = ((__global\n                                    int64_t *) ext_mem_229305)[gtid_226318 *\n                                                               n_203572 +\n                                                               i_226353];\n        \n        int64_t defunc_1_add_res_226355 = add64((int64_t) 1,\n                                                defunc_0_add_arg_226354);\n        \n        defunc_0_f_res_226352 = defunc_1_add_res_226355;\n    }\n    \n    double defunc_0_f_res_226356;\n    \n    if (cond_226351) {\n        defunc_0_f_res_226356 = 0.0;\n    } else {\n        int64_t i_226357 = add64(x_226329, gtid_226339);\n        double defunc_0_add_arg_226358;\n        \n        defunc_0_add_arg_226358 = ((__global double *) mem_231548)[gtid_226318 *\n                                                                   n_203572 +\n                                                                   i_226357];\n        defunc_0_f_res_226356 = defunc_0_add_arg_226358;\n    }\n    \n    int64_t binop_p_226359 = sub64(defunc_0_f_res_226352,\n                                   defunc_0_g_res_226333);\n    double defunc_0_f_res_226360 = sitofp_i64_f64(binop_p_226359);\n    double abs_res_226361 = fabs(defunc_0_f_res_226360);\n    double tmp1_226362 = abs_res_226361 / x_226330;\n    double x_226363 = tmp1_226362 * tmp1_226362;\n    double y_226364 = tmp1_226362 * x_226363;\n    double tmp2",
                   "_226365 = 1.0 - y_226364;\n    double x_226366 = tmp2_226365 * tmp2_226365;\n    double tmp3_226367 = tmp2_226365 * x_226366;\n    double tmp4_226368 = defunc_0_f_res_226356 * tmp3_226367;\n    double defunc_1_f_res_226369 = defunc_0_f_res_226360 * tmp4_226368;\n    double defunc_1_f_res_226370 = defunc_0_f_res_226360 *\n           defunc_1_f_res_226369;\n    \n    ((__local double *) red_arr_mem_236330)[gtid_226339] = tmp4_226368;\n    ((__local double *) red_arr_mem_236332)[gtid_226339] =\n        defunc_1_f_res_226369;\n    ((__local double *) red_arr_mem_236334)[gtid_226339] =\n        defunc_1_f_res_226370;\n    ((__local double *) color_232166)[gtid_226339] = defunc_1_f_res_226369;\n    ((__local double *) color_232165)[gtid_226339] = tmp4_226368;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_236336;\n    int32_t skip_waves_236337 = 1;\n    double x_226341;\n    double x_226342;\n    double x_226343;\n    double x_226344;\n    double x_226345;\n    double x_226346;\n    \n    offset_236336 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_236319, sext_i64_i32(q_t_203576))) {\n            x_226341 = ((__local\n                         double *) red_arr_mem_236330)[sext_i32_i64(local_tid_236319 +\n                                                       offset_236336)];\n            x_226342 = ((__local\n                         double *) red_arr_mem_236332)[sext_i32_i64(local_tid_236319 +\n                                                       offset_236336)];\n            x_226343 = ((__local\n                         double *) red_arr_mem_236334)[sext_i32_i64(local_tid_236319 +\n                                                       offset_236336)];\n        }\n    }\n    offset_236336 = 1;\n    while (slt32(offset_236336, wave_sizze_236321)) {\n        if (slt32(local_tid_236319 + offset_236336, sext_i64_i32(q_t_203576)) &&\n            ((local_tid_236319 - squot32(local_tid_236319, wave_sizze_236321) *\n              wave_sizze_236321) & (2 * ",
                   "offset_236336 - 1)) == 0) {\n            // read array element\n            {\n                x_226344 = ((volatile __local\n                             double *) red_arr_mem_236330)[sext_i32_i64(local_tid_236319 +\n                                                           offset_236336)];\n                x_226345 = ((volatile __local\n                             double *) red_arr_mem_236332)[sext_i32_i64(local_tid_236319 +\n                                                           offset_236336)];\n                x_226346 = ((volatile __local\n                             double *) red_arr_mem_236334)[sext_i32_i64(local_tid_236319 +\n                                                           offset_236336)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226347 = x_226341 + x_226344;\n                double defunc_1_op_res_226348 = x_226342 + x_226345;\n                double defunc_1_op_res_226349 = x_226343 + x_226346;\n                \n                x_226341 = defunc_1_op_res_226347;\n                x_226342 = defunc_1_op_res_226348;\n                x_226343 = defunc_1_op_res_226349;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_236330)[sext_i32_i64(local_tid_236319)] =\n                    x_226341;\n                ((volatile __local\n                  double *) red_arr_mem_236332)[sext_i32_i64(local_tid_236319)] =\n                    x_226342;\n                ((volatile __local\n                  double *) red_arr_mem_236334)[sext_i32_i64(local_tid_236319)] =\n                    x_226343;\n            }\n        }\n        offset_236336 *= 2;\n    }\n    while (slt32(skip_waves_236337, squot32(sext_i64_i32(q_t_203576) +\n                                            wave_sizze_236321 - 1,\n                                            wave_sizze_236321))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_236336 = skip",
                   "_waves_236337 * wave_sizze_236321;\n        if (slt32(local_tid_236319 + offset_236336, sext_i64_i32(q_t_203576)) &&\n            ((local_tid_236319 - squot32(local_tid_236319, wave_sizze_236321) *\n              wave_sizze_236321) == 0 && (squot32(local_tid_236319,\n                                                  wave_sizze_236321) & (2 *\n                                                                        skip_waves_236337 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_226344 = ((__local\n                             double *) red_arr_mem_236330)[sext_i32_i64(local_tid_236319 +\n                                                           offset_236336)];\n                x_226345 = ((__local\n                             double *) red_arr_mem_236332)[sext_i32_i64(local_tid_236319 +\n                                                           offset_236336)];\n                x_226346 = ((__local\n                             double *) red_arr_mem_236334)[sext_i32_i64(local_tid_236319 +\n                                                           offset_236336)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226347 = x_226341 + x_226344;\n                double defunc_1_op_res_226348 = x_226342 + x_226345;\n                double defunc_1_op_res_226349 = x_226343 + x_226346;\n                \n                x_226341 = defunc_1_op_res_226347;\n                x_226342 = defunc_1_op_res_226348;\n                x_226343 = defunc_1_op_res_226349;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_236330)[sext_i32_i64(local_tid_236319)] =\n                    x_226341;\n                ((__local\n                  double *) red_arr_mem_236332)[sext_i32_i64(local_tid_236319)] =\n                    x_226342;\n                ((_",
                   "_local\n                  double *) red_arr_mem_236334)[sext_i32_i64(local_tid_236319)] =\n                    x_226343;\n            }\n        }\n        skip_waves_236337 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_226334 = ((__local\n                                   double *) red_arr_mem_236330)[(int64_t) 0];\n    defunc_2_reduce_res_226335 = ((__local\n                                   double *) red_arr_mem_236332)[(int64_t) 0];\n    defunc_2_reduce_res_226336 = ((__local\n                                   double *) red_arr_mem_236334)[(int64_t) 0];\n    \n    double x_226371 = defunc_2_reduce_res_226334 * defunc_2_reduce_res_226336;\n    double y_226372 = defunc_2_reduce_res_226335 * defunc_2_reduce_res_226335;\n    double y_226373 = x_226371 - y_226372;\n    double det1_226374 = 1.0 / y_226373;\n    double a11_226375 = defunc_2_reduce_res_226336 * det1_226374;\n    double x_226376 = 0.0 - defunc_2_reduce_res_226335;\n    double b11_226377 = det1_226374 * x_226376;\n    double c11_226378 = defunc_2_reduce_res_226334 * det1_226374;\n    double defunc_2_reduce_res_226379;\n    double defunc_2_reduce_res_226380;\n    int64_t gtid_226381 = sext_i32_i64(sext_i64_i32(ltid_pre_236323));\n    int32_t phys_tid_226382 = local_tid_236319;\n    __local unsigned char *red_arr_mem_236338;\n    \n    red_arr_mem_236338 = (__local unsigned char *) red_arr_mem_236338_backing_5;\n    \n    __local unsigned char *red_arr_mem_236340;\n    \n    red_arr_mem_236340 = (__local unsigned char *) red_arr_mem_236340_backing_6;\n    \n    double x_226390;\n    \n    x_226390 = ((__local double *) color_232165)[gtid_226381];\n    \n    double x_226391;\n    \n    x_226391 = ((__local double *) color_232166)[gtid_226381];\n    \n    bool cond_226392 = sle64(x_226323, gtid_226381);\n    double defunc_0_f_res_226393;\n    \n    if (cond_226392) {\n        defunc_0_f_res_226393 = 0.0;\n    } else {\n        int64_t i_226394 = add64(x_226329, gtid_226381);\n        double defunc_0_add_arg_226395;\n        \n    ",
                   "    defunc_0_add_arg_226395 = ((__global double *) mem_231552)[gtid_226318 *\n                                                                   n_203572 +\n                                                                   i_226394];\n        defunc_0_f_res_226393 = defunc_0_add_arg_226395;\n    }\n    \n    double x_226396 = a11_226375 * x_226390;\n    double y_226397 = b11_226377 * x_226391;\n    double x_226398 = x_226396 + y_226397;\n    double defunc_9_fit_fun_res_226399 = defunc_0_f_res_226393 * x_226398;\n    double x_226400 = b11_226377 * x_226390;\n    double y_226401 = c11_226378 * x_226391;\n    double x_226402 = x_226400 + y_226401;\n    double defunc_9_slope_fun_res_226403 = defunc_0_f_res_226393 * x_226402;\n    \n    ((__local double *) red_arr_mem_236338)[gtid_226381] =\n        defunc_9_fit_fun_res_226399;\n    ((__local double *) red_arr_mem_236340)[gtid_226381] =\n        defunc_9_slope_fun_res_226403;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_236342;\n    int32_t skip_waves_236343 = 1;\n    double x_226383;\n    double x_226384;\n    double x_226385;\n    double x_226386;\n    \n    offset_236342 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_236319, sext_i64_i32(q_t_203576))) {\n            x_226383 = ((__local\n                         double *) red_arr_mem_236338)[sext_i32_i64(local_tid_236319 +\n                                                       offset_236342)];\n            x_226384 = ((__local\n                         double *) red_arr_mem_236340)[sext_i32_i64(local_tid_236319 +\n                                                       offset_236342)];\n        }\n    }\n    offset_236342 = 1;\n    while (slt32(offset_236342, wave_sizze_236321)) {\n        if (slt32(local_tid_236319 + offset_236342, sext_i64_i32(q_t_203576)) &&\n            ((local_tid_236319 - squot32(local_tid_236319, wave_sizze_236321) *\n              wave_sizze_236321) & (2 * offset_236342 - 1)) == 0) {\n            // read array element\n    ",
                   "        {\n                x_226385 = ((volatile __local\n                             double *) red_arr_mem_236338)[sext_i32_i64(local_tid_236319 +\n                                                           offset_236342)];\n                x_226386 = ((volatile __local\n                             double *) red_arr_mem_236340)[sext_i32_i64(local_tid_236319 +\n                                                           offset_236342)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226387 = x_226383 + x_226385;\n                double defunc_1_op_res_226388 = x_226384 + x_226386;\n                \n                x_226383 = defunc_1_op_res_226387;\n                x_226384 = defunc_1_op_res_226388;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_236338)[sext_i32_i64(local_tid_236319)] =\n                    x_226383;\n                ((volatile __local\n                  double *) red_arr_mem_236340)[sext_i32_i64(local_tid_236319)] =\n                    x_226384;\n            }\n        }\n        offset_236342 *= 2;\n    }\n    while (slt32(skip_waves_236343, squot32(sext_i64_i32(q_t_203576) +\n                                            wave_sizze_236321 - 1,\n                                            wave_sizze_236321))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_236342 = skip_waves_236343 * wave_sizze_236321;\n        if (slt32(local_tid_236319 + offset_236342, sext_i64_i32(q_t_203576)) &&\n            ((local_tid_236319 - squot32(local_tid_236319, wave_sizze_236321) *\n              wave_sizze_236321) == 0 && (squot32(local_tid_236319,\n                                                  wave_sizze_236321) & (2 *\n                                                                        skip_waves_236343 -\n                                                                        1)) ==\n             0)) {\n            // r",
                   "ead array element\n            {\n                x_226385 = ((__local\n                             double *) red_arr_mem_236338)[sext_i32_i64(local_tid_236319 +\n                                                           offset_236342)];\n                x_226386 = ((__local\n                             double *) red_arr_mem_236340)[sext_i32_i64(local_tid_236319 +\n                                                           offset_236342)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226387 = x_226383 + x_226385;\n                double defunc_1_op_res_226388 = x_226384 + x_226386;\n                \n                x_226383 = defunc_1_op_res_226387;\n                x_226384 = defunc_1_op_res_226388;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_236338)[sext_i32_i64(local_tid_236319)] =\n                    x_226383;\n                ((__local\n                  double *) red_arr_mem_236340)[sext_i32_i64(local_tid_236319)] =\n                    x_226384;\n            }\n        }\n        skip_waves_236343 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_226379 = ((__local\n                                   double *) red_arr_mem_236338)[(int64_t) 0];\n    defunc_2_reduce_res_226380 = ((__local\n                                   double *) red_arr_mem_236340)[(int64_t) 0];\n    if (local_tid_236319 == 0) {\n        ((__global double *) mem_231565)[gtid_226318 * t_n_m_203740 +\n                                         gtid_226319] =\n            defunc_2_reduce_res_226379;\n    }\n    if (local_tid_236319 == 0) {\n        ((__global double *) mem_231569)[gtid_226318 * t_n_m_203740 +\n                                         gtid_226319] =\n            defunc_2_reduce_res_226380;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_226724(__global int *global_failure,\n                                  ",
                   "           __local volatile\n                                             int64_t *red_arr_mem_236390_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *red_arr_mem_236388_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *red_arr_mem_236384_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *red_arr_mem_236382_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *red_arr_mem_236380_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *red_arr_mem_236378_backing_aligned_5,\n                                             __local volatile\n                                             int64_t *red_arr_mem_236376_backing_aligned_6,\n                                             __local volatile\n                                             int64_t *color_232170_backing_aligned_7,\n                                             __local volatile\n                                             int64_t *color_232169_backing_aligned_8,\n                                             __local volatile\n                                             int64_t *color_232168_backing_aligned_9,\n                                             __local volatile\n                                             int64_t *color_232167_backing_aligned_10,\n                                             int64_t n_203572,\n                                             int64_t q_t_203576,\n                                             int64_t jump_t_203582,\n                                             int64_t partition_sizze_203667,\n                                             int64_t t_n_m_203740,\n                       ",
                   "                      int64_t i_203760, __global\n                                             unsigned char *ext_mem_229304,\n                                             __global\n                                             unsigned char *ext_mem_229305,\n                                             __global\n                                             unsigned char *ext_mem_229568,\n                                             __global\n                                             unsigned char *ext_mem_229569,\n                                             __global unsigned char *mem_231579,\n                                             __global unsigned char *mem_231583,\n                                             __global unsigned char *mem_231603,\n                                             __global unsigned char *mem_231607)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_236390_backing_10 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236390_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_236388_backing_9 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236388_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_236384_backing_8 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236384_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_236382_backing_7 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236382_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_236380_backing_6 =\n                                   (__local volatile\n                                    unsigned char *) red_ar",
                   "r_mem_236380_backing_aligned_4;\n    __local volatile unsigned char *restrict red_arr_mem_236378_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236378_backing_aligned_5;\n    __local volatile unsigned char *restrict red_arr_mem_236376_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236376_backing_aligned_6;\n    __local volatile unsigned char *restrict color_232170_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) color_232170_backing_aligned_7;\n    __local volatile unsigned char *restrict color_232169_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) color_232169_backing_aligned_8;\n    __local volatile unsigned char *restrict color_232168_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_232168_backing_aligned_9;\n    __local volatile unsigned char *restrict color_232167_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232167_backing_aligned_10;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236364;\n    int32_t local_tid_236365;\n    int64_t group_sizze_236368;\n    int32_t wave_sizze_236367;\n    int32_t group_tid_236366;\n    \n    global_tid_236364 = get_global_id(0);\n    local_tid_236365 = get_local_id(0);\n    group_sizze_236368 = get_local_size(0);\n    wave_sizze_236367 = LOCKSTEP_WIDTH;\n    group_tid_236366 = get_group_id(0);\n    \n    int32_t phys_tid_226724 = group_tid_236366;\n    int64_t slice_236370 = q_t_203576;\n    int64_t ltid_pre_236369 = sext_i32_i64(local_tid_236365);\n    int64_t remnant_236371 = sext_i32_i64(local_tid_236365) - ltid_pre_236369;\n    int64_t slice_236372 = t_n_m_203740;\n",
                   "    int64_t slice_236373 = partition_sizze_203667 * slice_236372;\n    int64_t gtid_226722 = squot64(sext_i32_i64(group_tid_236366), slice_236372);\n    int64_t remnant_236374 = sext_i32_i64(group_tid_236366) - gtid_226722 *\n            slice_236372;\n    int64_t gtid_226723 = remnant_236374;\n    int64_t remnant_236375 = remnant_236374 - gtid_226723;\n    __local unsigned char *color_232167;\n    \n    color_232167 = (__local unsigned char *) color_232167_backing_0;\n    \n    __local unsigned char *color_232168;\n    \n    color_232168 = (__local unsigned char *) color_232168_backing_1;\n    \n    __local unsigned char *color_232169;\n    \n    color_232169 = (__local unsigned char *) color_232169_backing_2;\n    \n    __local unsigned char *color_232170;\n    \n    color_232170 = (__local unsigned char *) color_232170_backing_3;\n    \n    int64_t x_226727;\n    \n    x_226727 = ((__global int64_t *) ext_mem_229304)[gtid_226722];\n    \n    int64_t x_226733;\n    \n    x_226733 = ((__global int64_t *) ext_mem_229569)[gtid_226722 *\n                                                     t_n_m_203740 +\n                                                     gtid_226723];\n    \n    double x_226734;\n    \n    x_226734 = ((__global double *) ext_mem_229568)[gtid_226722 * t_n_m_203740 +\n                                                    gtid_226723];\n    \n    int64_t min_arg_226735 = mul64(jump_t_203582, gtid_226723);\n    int64_t min_res_226736 = smin64(i_203760, min_arg_226735);\n    int64_t defunc_0_g_res_226737 = add64((int64_t) 1, min_res_226736);\n    int64_t gtid_226740 = sext_i32_i64(sext_i64_i32(ltid_pre_236369));\n    int32_t phys_tid_226741 = local_tid_236365;\n    bool cond_226743 = sle64(x_226727, gtid_226740);\n    int64_t defunc_0_f_res_226744;\n    \n    if (cond_226743) {\n        defunc_0_f_res_226744 = (int64_t) 0;\n    } else {\n        int64_t i_226745 = add64(x_226733, gtid_226740);\n        int64_t defunc_0_add_arg_226746;\n        \n        defunc_0_add_arg_226746 = ((__global\n               ",
                   "                     int64_t *) ext_mem_229305)[gtid_226722 *\n                                                               n_203572 +\n                                                               i_226745];\n        \n        int64_t defunc_1_add_res_226747 = add64((int64_t) 1,\n                                                defunc_0_add_arg_226746);\n        \n        defunc_0_f_res_226744 = defunc_1_add_res_226747;\n    }\n    \n    double defunc_0_f_res_226748;\n    \n    if (cond_226743) {\n        defunc_0_f_res_226748 = 0.0;\n    } else {\n        int64_t i_226749 = add64(x_226733, gtid_226740);\n        double defunc_0_add_arg_226750;\n        \n        defunc_0_add_arg_226750 = ((__global double *) mem_231579)[gtid_226722 *\n                                                                   n_203572 +\n                                                                   i_226749];\n        defunc_0_f_res_226748 = defunc_0_add_arg_226750;\n    }\n    \n    int64_t binop_p_226751 = sub64(defunc_0_f_res_226744,\n                                   defunc_0_g_res_226737);\n    double defunc_0_f_res_226752 = sitofp_i64_f64(binop_p_226751);\n    double abs_res_226753 = fabs(defunc_0_f_res_226752);\n    double tmp1_226754 = abs_res_226753 / x_226734;\n    double x_226755 = tmp1_226754 * tmp1_226754;\n    double y_226756 = tmp1_226754 * x_226755;\n    double tmp2_226757 = 1.0 - y_226756;\n    double x_226758 = tmp2_226757 * tmp2_226757;\n    double tmp3_226759 = tmp2_226757 * x_226758;\n    double tmp4_226760 = defunc_0_f_res_226748 * tmp3_226759;\n    \n    ((__local double *) color_232170)[gtid_226740] = defunc_0_f_res_226752;\n    ((__local double *) color_232169)[gtid_226740] = tmp4_226760;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    double defunc_2_reduce_res_226761;\n    double defunc_2_reduce_res_226762;\n    double defunc_2_reduce_res_226763;\n    double defunc_2_reduce_res_226764;\n    double defunc_2_reduce_res_226765;\n    int64_t gtid_226768 = sext_i32_i64(sext_i64_i32(ltid_pre_236369));\n    i",
                   "nt32_t phys_tid_226769 = local_tid_236365;\n    __local unsigned char *red_arr_mem_236376;\n    \n    red_arr_mem_236376 = (__local unsigned char *) red_arr_mem_236376_backing_4;\n    \n    __local unsigned char *red_arr_mem_236378;\n    \n    red_arr_mem_236378 = (__local unsigned char *) red_arr_mem_236378_backing_5;\n    \n    __local unsigned char *red_arr_mem_236380;\n    \n    red_arr_mem_236380 = (__local unsigned char *) red_arr_mem_236380_backing_6;\n    \n    __local unsigned char *red_arr_mem_236382;\n    \n    red_arr_mem_236382 = (__local unsigned char *) red_arr_mem_236382_backing_7;\n    \n    __local unsigned char *red_arr_mem_236384;\n    \n    red_arr_mem_236384 = (__local unsigned char *) red_arr_mem_236384_backing_8;\n    \n    double x_226785;\n    \n    x_226785 = ((__local double *) color_232170)[gtid_226768];\n    \n    double x_226786;\n    \n    x_226786 = ((__local double *) color_232169)[gtid_226768];\n    \n    double defunc_1_f_res_226787 = x_226785 * x_226786;\n    double defunc_1_f_res_226788 = x_226785 * defunc_1_f_res_226787;\n    double defunc_1_f_res_226789 = x_226785 * defunc_1_f_res_226788;\n    double defunc_1_f_res_226790 = x_226785 * defunc_1_f_res_226789;\n    \n    ((__local double *) red_arr_mem_236376)[gtid_226768] = x_226786;\n    ((__local double *) red_arr_mem_236378)[gtid_226768] =\n        defunc_1_f_res_226787;\n    ((__local double *) red_arr_mem_236380)[gtid_226768] =\n        defunc_1_f_res_226788;\n    ((__local double *) red_arr_mem_236382)[gtid_226768] =\n        defunc_1_f_res_226789;\n    ((__local double *) red_arr_mem_236384)[gtid_226768] =\n        defunc_1_f_res_226790;\n    ((__local double *) color_232168)[gtid_226768] = defunc_1_f_res_226788;\n    ((__local double *) color_232167)[gtid_226768] = defunc_1_f_res_226787;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_236386;\n    int32_t skip_waves_236387 = 1;\n    double x_226770;\n    double x_226771;\n    double x_226772;\n    double x_226773;\n    double x_226774;\n    double x_226775;\n   ",
                   " double x_226776;\n    double x_226777;\n    double x_226778;\n    double x_226779;\n    \n    offset_236386 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_236365, sext_i64_i32(q_t_203576))) {\n            x_226770 = ((__local\n                         double *) red_arr_mem_236376)[sext_i32_i64(local_tid_236365 +\n                                                       offset_236386)];\n            x_226771 = ((__local\n                         double *) red_arr_mem_236378)[sext_i32_i64(local_tid_236365 +\n                                                       offset_236386)];\n            x_226772 = ((__local\n                         double *) red_arr_mem_236380)[sext_i32_i64(local_tid_236365 +\n                                                       offset_236386)];\n            x_226773 = ((__local\n                         double *) red_arr_mem_236382)[sext_i32_i64(local_tid_236365 +\n                                                       offset_236386)];\n            x_226774 = ((__local\n                         double *) red_arr_mem_236384)[sext_i32_i64(local_tid_236365 +\n                                                       offset_236386)];\n        }\n    }\n    offset_236386 = 1;\n    while (slt32(offset_236386, wave_sizze_236367)) {\n        if (slt32(local_tid_236365 + offset_236386, sext_i64_i32(q_t_203576)) &&\n            ((local_tid_236365 - squot32(local_tid_236365, wave_sizze_236367) *\n              wave_sizze_236367) & (2 * offset_236386 - 1)) == 0) {\n            // read array element\n            {\n                x_226775 = ((volatile __local\n                             double *) red_arr_mem_236376)[sext_i32_i64(local_tid_236365 +\n                                                           offset_236386)];\n                x_226776 = ((volatile __local\n                             double *) red_arr_mem_236378)[sext_i32_i64(local_tid_236365 +\n                                                           offset_236386)];\n          ",
                   "      x_226777 = ((volatile __local\n                             double *) red_arr_mem_236380)[sext_i32_i64(local_tid_236365 +\n                                                           offset_236386)];\n                x_226778 = ((volatile __local\n                             double *) red_arr_mem_236382)[sext_i32_i64(local_tid_236365 +\n                                                           offset_236386)];\n                x_226779 = ((volatile __local\n                             double *) red_arr_mem_236384)[sext_i32_i64(local_tid_236365 +\n                                                           offset_236386)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226780 = x_226770 + x_226775;\n                double defunc_1_op_res_226781 = x_226771 + x_226776;\n                double defunc_1_op_res_226782 = x_226772 + x_226777;\n                double defunc_1_op_res_226783 = x_226773 + x_226778;\n                double defunc_1_op_res_226784 = x_226774 + x_226779;\n                \n                x_226770 = defunc_1_op_res_226780;\n                x_226771 = defunc_1_op_res_226781;\n                x_226772 = defunc_1_op_res_226782;\n                x_226773 = defunc_1_op_res_226783;\n                x_226774 = defunc_1_op_res_226784;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_236376)[sext_i32_i64(local_tid_236365)] =\n                    x_226770;\n                ((volatile __local\n                  double *) red_arr_mem_236378)[sext_i32_i64(local_tid_236365)] =\n                    x_226771;\n                ((volatile __local\n                  double *) red_arr_mem_236380)[sext_i32_i64(local_tid_236365)] =\n                    x_226772;\n                ((volatile __local\n                  double *) red_arr_mem_236382)[sext_i32_i64(local_tid_236365)] =\n                    x_226773;\n                ((volatile _",
                   "_local\n                  double *) red_arr_mem_236384)[sext_i32_i64(local_tid_236365)] =\n                    x_226774;\n            }\n        }\n        offset_236386 *= 2;\n    }\n    while (slt32(skip_waves_236387, squot32(sext_i64_i32(q_t_203576) +\n                                            wave_sizze_236367 - 1,\n                                            wave_sizze_236367))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_236386 = skip_waves_236387 * wave_sizze_236367;\n        if (slt32(local_tid_236365 + offset_236386, sext_i64_i32(q_t_203576)) &&\n            ((local_tid_236365 - squot32(local_tid_236365, wave_sizze_236367) *\n              wave_sizze_236367) == 0 && (squot32(local_tid_236365,\n                                                  wave_sizze_236367) & (2 *\n                                                                        skip_waves_236387 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_226775 = ((__local\n                             double *) red_arr_mem_236376)[sext_i32_i64(local_tid_236365 +\n                                                           offset_236386)];\n                x_226776 = ((__local\n                             double *) red_arr_mem_236378)[sext_i32_i64(local_tid_236365 +\n                                                           offset_236386)];\n                x_226777 = ((__local\n                             double *) red_arr_mem_236380)[sext_i32_i64(local_tid_236365 +\n                                                           offset_236386)];\n                x_226778 = ((__local\n                             double *) red_arr_mem_236382)[sext_i32_i64(local_tid_236365 +\n                                                           offset_236386)];\n                x_226779 = ((__local\n                             double *) red_arr_mem_236384)[sext_i32_i64(local_tid_236365 +\n                              ",
                   "                             offset_236386)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226780 = x_226770 + x_226775;\n                double defunc_1_op_res_226781 = x_226771 + x_226776;\n                double defunc_1_op_res_226782 = x_226772 + x_226777;\n                double defunc_1_op_res_226783 = x_226773 + x_226778;\n                double defunc_1_op_res_226784 = x_226774 + x_226779;\n                \n                x_226770 = defunc_1_op_res_226780;\n                x_226771 = defunc_1_op_res_226781;\n                x_226772 = defunc_1_op_res_226782;\n                x_226773 = defunc_1_op_res_226783;\n                x_226774 = defunc_1_op_res_226784;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_236376)[sext_i32_i64(local_tid_236365)] =\n                    x_226770;\n                ((__local\n                  double *) red_arr_mem_236378)[sext_i32_i64(local_tid_236365)] =\n                    x_226771;\n                ((__local\n                  double *) red_arr_mem_236380)[sext_i32_i64(local_tid_236365)] =\n                    x_226772;\n                ((__local\n                  double *) red_arr_mem_236382)[sext_i32_i64(local_tid_236365)] =\n                    x_226773;\n                ((__local\n                  double *) red_arr_mem_236384)[sext_i32_i64(local_tid_236365)] =\n                    x_226774;\n            }\n        }\n        skip_waves_236387 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_226761 = ((__local\n                                   double *) red_arr_mem_236376)[(int64_t) 0];\n    defunc_2_reduce_res_226762 = ((__local\n                                   double *) red_arr_mem_236378)[(int64_t) 0];\n    defunc_2_reduce_res_226763 = ((__local\n                                   double *) red_arr_mem_236380)[(int64_t) 0];\n    defunc_2_reduce_res_226764 = ((__local\n    ",
                   "                               double *) red_arr_mem_236382)[(int64_t) 0];\n    defunc_2_reduce_res_226765 = ((__local\n                                   double *) red_arr_mem_236384)[(int64_t) 0];\n    \n    double x_226791 = defunc_2_reduce_res_226763 * defunc_2_reduce_res_226765;\n    double y_226792 = defunc_2_reduce_res_226764 * defunc_2_reduce_res_226764;\n    double a12_226793 = x_226791 - y_226792;\n    double x_226794 = defunc_2_reduce_res_226763 * defunc_2_reduce_res_226764;\n    double y_226795 = defunc_2_reduce_res_226762 * defunc_2_reduce_res_226765;\n    double b12_226796 = x_226794 - y_226795;\n    double x_226797 = defunc_2_reduce_res_226762 * defunc_2_reduce_res_226764;\n    double y_226798 = defunc_2_reduce_res_226763 * defunc_2_reduce_res_226763;\n    double c12_226799 = x_226797 - y_226798;\n    double x_226800 = defunc_2_reduce_res_226761 * defunc_2_reduce_res_226765;\n    double b2_226801 = x_226800 - y_226798;\n    double x_226802 = defunc_2_reduce_res_226762 * defunc_2_reduce_res_226763;\n    double y_226803 = defunc_2_reduce_res_226761 * defunc_2_reduce_res_226764;\n    double c2_226804 = x_226802 - y_226803;\n    double x_226805 = defunc_2_reduce_res_226761 * a12_226793;\n    double y_226806 = defunc_2_reduce_res_226762 * b12_226796;\n    double x_226807 = x_226805 + y_226806;\n    double y_226808 = defunc_2_reduce_res_226763 * c12_226799;\n    double y_226809 = x_226807 + y_226808;\n    double det_226810 = 1.0 / y_226809;\n    double a12_226811 = a12_226793 * det_226810;\n    double b12_226812 = b12_226796 * det_226810;\n    double c12_226813 = c12_226799 * det_226810;\n    double b2_226814 = b2_226801 * det_226810;\n    double c2_226815 = c2_226804 * det_226810;\n    double defunc_2_reduce_res_226816;\n    double defunc_2_reduce_res_226817;\n    int64_t gtid_226818 = sext_i32_i64(sext_i64_i32(ltid_pre_236369));\n    int32_t phys_tid_226819 = local_tid_236365;\n    __local unsigned char *red_arr_mem_236388;\n    \n    red_arr_mem_236388 = (__local unsigned char *) red_arr_",
                   "mem_236388_backing_9;\n    \n    __local unsigned char *red_arr_mem_236390;\n    \n    red_arr_mem_236390 = (__local\n                          unsigned char *) red_arr_mem_236390_backing_10;\n    \n    double x_226827;\n    \n    x_226827 = ((__local double *) color_232169)[gtid_226818];\n    \n    double x_226828;\n    \n    x_226828 = ((__local double *) color_232167)[gtid_226818];\n    \n    double x_226829;\n    \n    x_226829 = ((__local double *) color_232168)[gtid_226818];\n    \n    bool cond_226830 = sle64(x_226727, gtid_226818);\n    double defunc_0_f_res_226831;\n    \n    if (cond_226830) {\n        defunc_0_f_res_226831 = 0.0;\n    } else {\n        int64_t i_226832 = add64(x_226733, gtid_226818);\n        double defunc_0_add_arg_226833;\n        \n        defunc_0_add_arg_226833 = ((__global double *) mem_231583)[gtid_226722 *\n                                                                   n_203572 +\n                                                                   i_226832];\n        defunc_0_f_res_226831 = defunc_0_add_arg_226833;\n    }\n    \n    double x_226834 = a12_226811 * x_226827;\n    double y_226835 = b12_226812 * x_226828;\n    double x_226836 = x_226834 + y_226835;\n    double y_226837 = c12_226813 * x_226829;\n    double x_226838 = x_226836 + y_226837;\n    double defunc_9_fit_fun_res_226839 = defunc_0_f_res_226831 * x_226838;\n    double x_226840 = b12_226812 * x_226827;\n    double y_226841 = b2_226814 * x_226828;\n    double x_226842 = x_226840 + y_226841;\n    double y_226843 = c2_226815 * x_226829;\n    double x_226844 = x_226842 + y_226843;\n    double defunc_9_slope_fun_res_226845 = defunc_0_f_res_226831 * x_226844;\n    \n    ((__local double *) red_arr_mem_236388)[gtid_226818] =\n        defunc_9_fit_fun_res_226839;\n    ((__local double *) red_arr_mem_236390)[gtid_226818] =\n        defunc_9_slope_fun_res_226845;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_236392;\n    int32_t skip_waves_236393 = 1;\n    double x_226820;\n    double x_226821;\n    double x_226",
                   "822;\n    double x_226823;\n    \n    offset_236392 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_236365, sext_i64_i32(q_t_203576))) {\n            x_226820 = ((__local\n                         double *) red_arr_mem_236388)[sext_i32_i64(local_tid_236365 +\n                                                       offset_236392)];\n            x_226821 = ((__local\n                         double *) red_arr_mem_236390)[sext_i32_i64(local_tid_236365 +\n                                                       offset_236392)];\n        }\n    }\n    offset_236392 = 1;\n    while (slt32(offset_236392, wave_sizze_236367)) {\n        if (slt32(local_tid_236365 + offset_236392, sext_i64_i32(q_t_203576)) &&\n            ((local_tid_236365 - squot32(local_tid_236365, wave_sizze_236367) *\n              wave_sizze_236367) & (2 * offset_236392 - 1)) == 0) {\n            // read array element\n            {\n                x_226822 = ((volatile __local\n                             double *) red_arr_mem_236388)[sext_i32_i64(local_tid_236365 +\n                                                           offset_236392)];\n                x_226823 = ((volatile __local\n                             double *) red_arr_mem_236390)[sext_i32_i64(local_tid_236365 +\n                                                           offset_236392)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226824 = x_226820 + x_226822;\n                double defunc_1_op_res_226825 = x_226821 + x_226823;\n                \n                x_226820 = defunc_1_op_res_226824;\n                x_226821 = defunc_1_op_res_226825;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_236388)[sext_i32_i64(local_tid_236365)] =\n                    x_226820;\n                ((volatile __local\n                  double *) red_arr_mem_236390)[sext_i32_i64(loc",
                   "al_tid_236365)] =\n                    x_226821;\n            }\n        }\n        offset_236392 *= 2;\n    }\n    while (slt32(skip_waves_236393, squot32(sext_i64_i32(q_t_203576) +\n                                            wave_sizze_236367 - 1,\n                                            wave_sizze_236367))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_236392 = skip_waves_236393 * wave_sizze_236367;\n        if (slt32(local_tid_236365 + offset_236392, sext_i64_i32(q_t_203576)) &&\n            ((local_tid_236365 - squot32(local_tid_236365, wave_sizze_236367) *\n              wave_sizze_236367) == 0 && (squot32(local_tid_236365,\n                                                  wave_sizze_236367) & (2 *\n                                                                        skip_waves_236393 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_226822 = ((__local\n                             double *) red_arr_mem_236388)[sext_i32_i64(local_tid_236365 +\n                                                           offset_236392)];\n                x_226823 = ((__local\n                             double *) red_arr_mem_236390)[sext_i32_i64(local_tid_236365 +\n                                                           offset_236392)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226824 = x_226820 + x_226822;\n                double defunc_1_op_res_226825 = x_226821 + x_226823;\n                \n                x_226820 = defunc_1_op_res_226824;\n                x_226821 = defunc_1_op_res_226825;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_236388)[sext_i32_i64(local_tid_236365)] =\n                    x_226820;\n                ((__local\n                  double *) red_arr_mem_236390)[sext_i32_i64(local_tid_236365)",
                   "] =\n                    x_226821;\n            }\n        }\n        skip_waves_236393 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_226816 = ((__local\n                                   double *) red_arr_mem_236388)[(int64_t) 0];\n    defunc_2_reduce_res_226817 = ((__local\n                                   double *) red_arr_mem_236390)[(int64_t) 0];\n    if (local_tid_236365 == 0) {\n        ((__global double *) mem_231603)[gtid_226722 * t_n_m_203740 +\n                                         gtid_226723] =\n            defunc_2_reduce_res_226816;\n    }\n    if (local_tid_236365 == 0) {\n        ((__global double *) mem_231607)[gtid_226722 * t_n_m_203740 +\n                                         gtid_226723] =\n            defunc_2_reduce_res_226817;\n    }\n    \n  error_5:\n    return;\n}\n__kernel void mainzisegmap_intragroup_227074(__global int *global_failure,\n                                             int failure_is_an_option, __global\n                                             int64_t *global_failure_args,\n                                             __local volatile\n                                             int64_t *color_232172_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *color_232171_backing_aligned_1,\n                                             int64_t n_203572,\n                                             int64_t partition_sizze_203667,\n                                             int64_t ext_231630, __global\n                                             unsigned char *mem_229269, __global\n                                             unsigned char *ext_mem_229305,\n                                             __global\n                                             unsigned char *ext_mem_231625,\n                                             __global\n                                             unsigned char *ext_mem_231626,\n                             ",
                   "                __global unsigned char *mem_231653,\n                                             __global unsigned char *mem_231657)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict color_232172_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_232172_backing_aligned_0;\n    __local volatile unsigned char *restrict color_232171_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232171_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_236404;\n    int32_t local_tid_236405;\n    int64_t group_sizze_236408;\n    int32_t wave_sizze_236407;\n    int32_t group_tid_236406;\n    \n    global_tid_236404 = get_global_id(0);\n    local_tid_236405 = get_local_id(0);\n    group_sizze_236408 = get_local_size(0);\n    wave_sizze_236407 = LOCKSTEP_WIDTH;\n    group_tid_236406 = get_group_id(0);\n    \n    int32_t phys_tid_227074 = group_tid_236406;\n    int64_t slice_236410 = n_203572;\n    int64_t ltid_pre_236409 = sext_i32_i64(local_tid_236405);\n    int64_t remnant_236411 = sext_i32_i64(local_tid_236405) - ltid_pre_236409;\n    int64_t slice_236412 = partition_sizze_203667;\n    int64_t gtid_227073 = sext_i32_i64(group_tid_236406);\n    int64_t remnant_236413 = sext_i32_i64(group_tid_236406) - gtid_227073;\n    __local unsigned char *color_232171;\n    \n    color_232171 = (__local unsigned char *) color_232171_backing_0;\n    \n    __local unsigned char *color_232172;\n    \n    color_232172 = (__local unsigned char *) color_232172_backing_1;\n    \n    int64_t gtid_227084 = sext_i32_i64(sext_i64_i32(ltid_pre_236409));\n    int32_t phys_tid_22708",
                   "5 = local_tid_236405;\n    double x_227086;\n    \n    x_227086 = ((__global double *) mem_229269)[gtid_227073 * n_203572 +\n                                                gtid_227084];\n    \n    double x_227087;\n    \n    x_227087 = ((__global double *) ext_mem_231626)[gtid_227073 * n_203572 +\n                                                    gtid_227084];\n    \n    double x_227088;\n    \n    x_227088 = ((__global double *) ext_mem_231625)[gtid_227073 * ext_231630 +\n                                                    gtid_227084];\n    \n    double x_227089 = x_227086 - x_227087;\n    double defunc_2_f_res_227090 = x_227089 - x_227088;\n    bool isnan_res_227091;\n    \n    isnan_res_227091 = futrts_isnan64(defunc_2_f_res_227090);\n    \n    double defunc_0_f_res_227092;\n    \n    if (isnan_res_227091) {\n        defunc_0_f_res_227092 = defunc_2_f_res_227090;\n    } else {\n        double abs_res_227093 = fabs(defunc_2_f_res_227090);\n        \n        defunc_0_f_res_227092 = abs_res_227093;\n    }\n    ((__local double *) color_232172)[gtid_227084] = defunc_0_f_res_227092;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_227095 = sext_i32_i64(sext_i64_i32(ltid_pre_236409));\n    int32_t phys_tid_227096 = local_tid_236405;\n    int64_t x_227097;\n    \n    x_227097 = ((__global int64_t *) ext_mem_229305)[gtid_227073 * n_203572 +\n                                                     gtid_227095];\n    \n    bool cond_227098 = sle64((int64_t) 0, x_227097);\n    double defunc_0_f_res_227099;\n    \n    if (cond_227098) {\n        bool y_227100 = slt64(x_227097, n_203572);\n        bool bounds_check_227101 = cond_227098 && y_227100;\n        bool index_certs_227102;\n        \n        if (!bounds_check_227101) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 72) == -1) {\n                    global_failure_args[0] = (int64_t) x_227097;\n                    global_failure_args[1] = (int64_t) n_203572;\n                    ;\n                }\n                local_failu",
                   "re = true;\n                goto error_1;\n            }\n        }\n        \n        double defunc_0_f_res_t_res_227103;\n        \n        defunc_0_f_res_t_res_227103 = ((__local\n                                        double *) color_232172)[x_227097];\n        defunc_0_f_res_227099 = defunc_0_f_res_t_res_227103;\n    } else {\n        defunc_0_f_res_227099 = INFINITY;\n    }\n    ((__local double *) color_232171)[gtid_227095] = defunc_0_f_res_227099;\n    \n  error_1:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    double tmp_236414;\n    \n    tmp_236414 = ((__local\n                   double *) color_232171)[sext_i32_i64(local_tid_236405)];\n    ((__global double *) mem_231653)[gtid_227073 * n_203572 +\n                                     sext_i32_i64(local_tid_236405)] =\n        tmp_236414;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    double tmp_236415;\n    \n    tmp_236415 = ((__local\n                   double *) color_232172)[sext_i32_i64(local_tid_236405)];\n    ((__global double *) mem_231657)[gtid_227073 * n_203572 +\n                                     sext_i32_i64(local_tid_236405)] =\n        tmp_236415;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_227449(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *color_232187_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *color_232186_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *color_232185_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *color_232184_backing_aligned_3,\n                                             __local volatile\n                        ",
                   "                     int64_t *color_232183_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *color_232182_backing_aligned_5,\n                                             int64_t n_203572,\n                                             int64_t partition_sizze_203667,\n                                             int64_t i_203760,\n                                             int32_t iters_206755, __global\n                                             unsigned char *ext_mem_231669,\n                                             __global unsigned char *mem_231829,\n                                             __global\n                                             unsigned char *color_232180,\n                                             __global\n                                             unsigned char *color_232181)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict color_232187_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) color_232187_backing_aligned_0;\n    __local volatile unsigned char *restrict color_232186_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) color_232186_backing_aligned_1;\n    __local volatile unsigned char *restrict color_232185_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) color_232185_backing_aligned_2;\n    __local volatile unsigned char *restrict color_232184_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) color_232184_backing_aligned_3;\n    __local volatile unsigned char *restrict color_232183_backing_1 =\n                                   (__local volatile\n                                    unsigned char *",
                   ") color_232183_backing_aligned_4;\n    __local volatile unsigned char *restrict color_232182_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232182_backing_aligned_5;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236471;\n    int32_t local_tid_236472;\n    int64_t group_sizze_236475;\n    int32_t wave_sizze_236474;\n    int32_t group_tid_236473;\n    \n    global_tid_236471 = get_global_id(0);\n    local_tid_236472 = get_local_id(0);\n    group_sizze_236475 = get_local_size(0);\n    wave_sizze_236474 = LOCKSTEP_WIDTH;\n    group_tid_236473 = get_group_id(0);\n    \n    int32_t phys_tid_227449 = group_tid_236473;\n    int64_t slice_236477 = n_203572;\n    int64_t ltid_pre_236476 = sext_i32_i64(local_tid_236472);\n    int64_t remnant_236478 = sext_i32_i64(local_tid_236472) - ltid_pre_236476;\n    int64_t slice_236479 = partition_sizze_203667;\n    int64_t gtid_227448 = sext_i32_i64(group_tid_236473);\n    int64_t remnant_236480 = sext_i32_i64(group_tid_236473) - gtid_227448;\n    __local unsigned char *color_232182;\n    \n    color_232182 = (__local unsigned char *) color_232182_backing_0;\n    \n    __local unsigned char *color_232183;\n    \n    color_232183 = (__local unsigned char *) color_232183_backing_1;\n    \n    __local unsigned char *color_232184;\n    \n    color_232184 = (__local unsigned char *) color_232184_backing_2;\n    \n    __local unsigned char *color_232185;\n    \n    color_232185 = (__local unsigned char *) color_232185_backing_3;\n    \n    __local unsigned char *color_232186;\n    \n    color_232186 = (__local unsigned char *) color_232186_backing_4;\n    \n    __local unsigned char *color_232187;\n    \n    color_232187 = (__local unsigned char *) color_232187_backing_5;\n    \n    double tmp_236481;\n    \n    tmp_236481 = ((__global double *) ext_mem_231669)[gtid_227448 * n_203572 +\n                                                      sext_i32_i64(local_tid_236472)];\n    ((__",
                   "global double *) color_232180)[phys_tid_227449 * n_203572 +\n                                       sext_i32_i64(local_tid_236472)] =\n        tmp_236481;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    __global unsigned char *ext_mem_231821;\n    __global unsigned char *ext_mem_unused_232071;\n    __global unsigned char *mem_param_231792;\n    __global unsigned char *mem_param_out_232072;\n    \n    mem_param_231792 = color_232180;\n    mem_param_out_232072 = color_232181;\n    for (int32_t i_227453 = 0; i_227453 < iters_206755; i_227453++) {\n        int32_t defunc_2_radix_sort_step_arg_227455 = mul32(2, i_227453);\n        int32_t defunc_0_get_bit_arg_227456 = add32(1,\n                                                    defunc_2_radix_sort_step_arg_227455);\n        bool cond_f_res_227457 = defunc_0_get_bit_arg_227456 == 63;\n        bool cond_f_res_227458 = defunc_2_radix_sort_step_arg_227455 == 63;\n        int64_t unsign_arg_227459 = zext_i32_i64(defunc_0_get_bit_arg_227456);\n        int64_t unsign_arg_227460 =\n                zext_i32_i64(defunc_2_radix_sort_step_arg_227455);\n        int64_t gtid_227466 = sext_i32_i64(sext_i64_i32(ltid_pre_236476));\n        int32_t phys_tid_227467 = local_tid_236472;\n        double x_227480;\n        \n        x_227480 = ((__global double *) mem_param_231792)[phys_tid_227449 *\n                                                          n_203572 +\n                                                          gtid_227466];\n        \n        int64_t i64_arg_227481;\n        \n        i64_arg_227481 = futrts_to_bits64(x_227480);\n        \n        int64_t unsign_arg_227482 = ashr64(i64_arg_227481, unsign_arg_227459);\n        int64_t unsign_arg_227483 = (int64_t) 1 & unsign_arg_227482;\n        int32_t to_i32_res_227484 = zext_i64_i32(unsign_arg_227483);\n        int64_t unsign_arg_227485 = ashr64(i64_arg_227481, (int64_t) 63);\n        int64_t unsign_arg_227486 = (int64_t) 1 & unsign_arg_227485;\n        int32_t to_i32_res_227487 = zext_i64_i32(unsign_arg_227486);\n",
                   "        bool cond_227488 = to_i32_res_227487 == 1;\n        bool x_227489 = !cond_227488;\n        bool y_227490 = cond_f_res_227457 && x_227489;\n        bool cond_227491 = cond_227488 || y_227490;\n        int32_t defunc_1_get_bit_res_227492;\n        \n        if (cond_227491) {\n            int32_t defunc_1_get_bit_res_t_res_227493 = 1 ^ to_i32_res_227484;\n            \n            defunc_1_get_bit_res_227492 = defunc_1_get_bit_res_t_res_227493;\n        } else {\n            defunc_1_get_bit_res_227492 = to_i32_res_227484;\n        }\n        \n        int32_t x_227494 = mul32(2, defunc_1_get_bit_res_227492);\n        int64_t unsign_arg_227495 = ashr64(i64_arg_227481, unsign_arg_227460);\n        int64_t unsign_arg_227496 = (int64_t) 1 & unsign_arg_227495;\n        int32_t to_i32_res_227497 = zext_i64_i32(unsign_arg_227496);\n        bool y_227498 = cond_f_res_227458 && x_227489;\n        bool cond_227499 = cond_227488 || y_227498;\n        int32_t defunc_1_get_bit_res_227500;\n        \n        if (cond_227499) {\n            int32_t defunc_1_get_bit_res_t_res_227501 = 1 ^ to_i32_res_227497;\n            \n            defunc_1_get_bit_res_227500 = defunc_1_get_bit_res_t_res_227501;\n        } else {\n            defunc_1_get_bit_res_227500 = to_i32_res_227497;\n        }\n        \n        int32_t defunc_0_f_res_227502 = add32(x_227494,\n                                              defunc_1_get_bit_res_227500);\n        bool cond_227503 = defunc_0_f_res_227502 == 0;\n        int64_t defunc_0_f_res_227504 = btoi_bool_i64(cond_227503);\n        int64_t defunc_0_f_res_227505;\n        int64_t defunc_0_f_res_227506;\n        int64_t defunc_0_f_res_227507;\n        \n        if (cond_227503) {\n            defunc_0_f_res_227505 = (int64_t) 0;\n            defunc_0_f_res_227506 = (int64_t) 0;\n            defunc_0_f_res_227507 = (int64_t) 0;\n        } else {\n            bool cond_227508 = defunc_0_f_res_227502 == 1;\n            int64_t defunc_0_f_res_f_res_227509 = btoi_bool_i64(cond_227508);\n           ",
                   " int64_t defunc_0_f_res_f_res_227510;\n            int64_t defunc_0_f_res_f_res_227511;\n            \n            if (cond_227508) {\n                defunc_0_f_res_f_res_227510 = (int64_t) 0;\n                defunc_0_f_res_f_res_227511 = (int64_t) 0;\n            } else {\n                bool cond_227512 = defunc_0_f_res_227502 == 2;\n                int64_t defunc_0_f_res_f_res_f_res_227513 =\n                        btoi_bool_i64(cond_227512);\n                bool cond_neg_227514 = !cond_227512;\n                int64_t defunc_0_f_res_f_res_f_res_227515 =\n                        btoi_bool_i64(cond_neg_227514);\n                \n                defunc_0_f_res_f_res_227510 = defunc_0_f_res_f_res_f_res_227513;\n                defunc_0_f_res_f_res_227511 = defunc_0_f_res_f_res_f_res_227515;\n            }\n            defunc_0_f_res_227505 = defunc_0_f_res_f_res_227509;\n            defunc_0_f_res_227506 = defunc_0_f_res_f_res_227510;\n            defunc_0_f_res_227507 = defunc_0_f_res_f_res_227511;\n        }\n        ((__local int64_t *) color_232187)[gtid_227466] = defunc_0_f_res_227504;\n        ((__local int64_t *) color_232186)[gtid_227466] = defunc_0_f_res_227505;\n        ((__local int64_t *) color_232185)[gtid_227466] = defunc_0_f_res_227506;\n        ((__local int64_t *) color_232184)[gtid_227466] = defunc_0_f_res_227507;\n        ((__local int32_t *) color_232183)[gtid_227466] = defunc_0_f_res_227502;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int64_t dims_flat_236485 = n_203572;\n        int64_t x_227468;\n        int64_t x_227469;\n        int64_t x_227470;\n        int64_t x_227471;\n        int64_t x_227472;\n        int64_t x_227473;\n        int64_t x_227474;\n        int64_t x_227475;\n        int64_t x_236490;\n        int64_t x_236491;\n        int64_t x_236492;\n        int64_t x_236493;\n        int64_t x_236494;\n        int64_t x_236495;\n        int64_t x_236496;\n        int64_t x_236497;\n        bool ltid_in_bounds_236502 = slt64(sext_i32_i64(local_tid_236472),\n",
                   "                                           n_203572);\n        int32_t skip_threads_236503;\n        \n        // read input for in-block scan\n        {\n            if (ltid_in_bounds_236502) {\n                x_227472 = ((volatile __local\n                             int64_t *) color_232187)[sext_i32_i64(local_tid_236472)];\n                x_227473 = ((volatile __local\n                             int64_t *) color_232186)[sext_i32_i64(local_tid_236472)];\n                x_227474 = ((volatile __local\n                             int64_t *) color_232185)[sext_i32_i64(local_tid_236472)];\n                x_227475 = ((volatile __local\n                             int64_t *) color_232184)[sext_i32_i64(local_tid_236472)];\n                if ((local_tid_236472 - squot32(local_tid_236472, 32) * 32) ==\n                    0) {\n                    x_227468 = x_227472;\n                    x_227469 = x_227473;\n                    x_227470 = x_227474;\n                    x_227471 = x_227475;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_236503 = 1;\n            while (slt32(skip_threads_236503, 32)) {\n                bool thread_active_236504 = sle32(skip_threads_236503,\n                                                  local_tid_236472 -\n                                                  squot32(local_tid_236472,\n                                                          32) * 32) &&\n                     ltid_in_bounds_236502;\n                \n                if (thread_active_236504) {\n                    // read operands\n                    {\n                        x_227468 = ((volatile __local\n                                     int64_t *) color_232187)[sext_i32_i64(local_tid_236472) -\n                                                              sext_i32_i64(skip_threads_236503)];\n                        x_227469 = ((volatile __local\n                                     int64_t *) color_23218",
                   "6)[sext_i32_i64(local_tid_236472) -\n                                                              sext_i32_i64(skip_threads_236503)];\n                        x_227470 = ((volatile __local\n                                     int64_t *) color_232185)[sext_i32_i64(local_tid_236472) -\n                                                              sext_i32_i64(skip_threads_236503)];\n                        x_227471 = ((volatile __local\n                                     int64_t *) color_232184)[sext_i32_i64(local_tid_236472) -\n                                                              sext_i32_i64(skip_threads_236503)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_236505 =\n                         slt64(srem64(sext_i32_i64(local_tid_236472), n_203572),\n                               sext_i32_i64(local_tid_236472) -\n                               sext_i32_i64(local_tid_236472 -\n                               skip_threads_236503));\n                    \n                    if (thread_active_236504 && inactive_236505) {\n                        x_227468 = x_227472;\n                        x_227469 = x_227473;\n                        x_227470 = x_227474;\n                        x_227471 = x_227475;\n                    }\n                    if (thread_active_236504) {\n                        if (!inactive_236505) {\n                            int64_t defunc_1_op_res_227476 = add64(x_227468,\n                                                                   x_227472);\n                            int64_t defunc_1_op_res_227477 = add64(x_227469,\n                                                                   x_227473);\n                            int64_t defunc_1_op_res_227478 = add64(x_227470,\n                                                                   x_227474);\n                            int64_t defunc_1_op_res_227479 = add64(x_227471,\n                                            ",
                   "                       x_227475);\n                            \n                            x_227468 = defunc_1_op_res_227476;\n                            x_227469 = defunc_1_op_res_227477;\n                            x_227470 = defunc_1_op_res_227478;\n                            x_227471 = defunc_1_op_res_227479;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_236474, skip_threads_236503)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_236504) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) color_232187)[sext_i32_i64(local_tid_236472)] =\n                            x_227468;\n                        x_227472 = x_227468;\n                        ((volatile __local\n                          int64_t *) color_232186)[sext_i32_i64(local_tid_236472)] =\n                            x_227469;\n                        x_227473 = x_227469;\n                        ((volatile __local\n                          int64_t *) color_232185)[sext_i32_i64(local_tid_236472)] =\n                            x_227470;\n                        x_227474 = x_227470;\n                        ((volatile __local\n                          int64_t *) color_232184)[sext_i32_i64(local_tid_236472)] =\n                            x_227471;\n                        x_227475 = x_227471;\n                    }\n                }\n                if (sle32(wave_sizze_236474, skip_threads_236503)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_236503 *= 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_236472 - squot32(local_tid_236472, 32) * 32) == 31 &&\n                ltid_in_bounds_236502) {\n                ((volatile __local\n                  in",
                   "t64_t *) color_232187)[sext_i32_i64(squot32(local_tid_236472,\n                                                                32))] =\n                    x_227468;\n                ((volatile __local\n                  int64_t *) color_232186)[sext_i32_i64(squot32(local_tid_236472,\n                                                                32))] =\n                    x_227469;\n                ((volatile __local\n                  int64_t *) color_232185)[sext_i32_i64(squot32(local_tid_236472,\n                                                                32))] =\n                    x_227470;\n                ((volatile __local\n                  int64_t *) color_232184)[sext_i32_i64(squot32(local_tid_236472,\n                                                                32))] =\n                    x_227471;\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_236506;\n            \n            // read input for in-block scan\n            {\n                if (squot32(local_tid_236472, 32) == 0 &&\n                    ltid_in_bounds_236502) {\n                    x_236494 = ((volatile __local\n                                 int64_t *) color_232187)[sext_i32_i64(local_tid_236472)];\n                    x_236495 = ((volatile __local\n                                 int64_t *) color_232186)[sext_i32_i64(local_tid_236472)];\n                    x_236496 = ((volatile __local\n                                 int64_t *) color_232185)[sext_i32_i64(local_tid_236472)];\n                    x_236497 = ((volatile __local\n                                 int64_t *) color_232184)[sext_i32_i64(local_tid_236472)];\n                    if ((local_tid_236472 - squot32(local_tid_236472, 32) *\n                         32) == 0) {\n                        x_236490 = x_236494;\n                        x_236491 = x_236495;\n                        x_236492 = ",
                   "x_236496;\n                        x_236493 = x_236497;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_236506 = 1;\n                while (slt32(skip_threads_236506, 32)) {\n                    bool thread_active_236507 = sle32(skip_threads_236506,\n                                                      local_tid_236472 -\n                                                      squot32(local_tid_236472,\n                                                              32) * 32) &&\n                         (squot32(local_tid_236472, 32) == 0 &&\n                          ltid_in_bounds_236502);\n                    \n                    if (thread_active_236507) {\n                        // read operands\n                        {\n                            x_236490 = ((volatile __local\n                                         int64_t *) color_232187)[sext_i32_i64(local_tid_236472) -\n                                                                  sext_i32_i64(skip_threads_236506)];\n                            x_236491 = ((volatile __local\n                                         int64_t *) color_232186)[sext_i32_i64(local_tid_236472) -\n                                                                  sext_i32_i64(skip_threads_236506)];\n                            x_236492 = ((volatile __local\n                                         int64_t *) color_232185)[sext_i32_i64(local_tid_236472) -\n                                                                  sext_i32_i64(skip_threads_236506)];\n                            x_236493 = ((volatile __local\n                                         int64_t *) color_232184)[sext_i32_i64(local_tid_236472) -\n                                                                  sext_i32_i64(skip_threads_236506)];\n                        }\n                    }\n                    // perform operation\n                    {\n                   ",
                   "     bool inactive_236508 =\n                             slt64(srem64(sext_i32_i64(local_tid_236472 * 32 +\n                                          32 - 1), n_203572),\n                                   sext_i32_i64(local_tid_236472 * 32 + 32 -\n                                   1) - sext_i32_i64((local_tid_236472 -\n                                                      skip_threads_236506) *\n                                   32 + 32 - 1));\n                        \n                        if (thread_active_236507 && inactive_236508) {\n                            x_236490 = x_236494;\n                            x_236491 = x_236495;\n                            x_236492 = x_236496;\n                            x_236493 = x_236497;\n                        }\n                        if (thread_active_236507) {\n                            if (!inactive_236508) {\n                                int64_t defunc_1_op_res_236498 = add64(x_236490,\n                                                                       x_236494);\n                                int64_t defunc_1_op_res_236499 = add64(x_236491,\n                                                                       x_236495);\n                                int64_t defunc_1_op_res_236500 = add64(x_236492,\n                                                                       x_236496);\n                                int64_t defunc_1_op_res_236501 = add64(x_236493,\n                                                                       x_236497);\n                                \n                                x_236490 = defunc_1_op_res_236498;\n                                x_236491 = defunc_1_op_res_236499;\n                                x_236492 = defunc_1_op_res_236500;\n                                x_236493 = defunc_1_op_res_236501;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_236474, skip_threads_236506)) {\n                        barr",
                   "ier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_236507) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) color_232187)[sext_i32_i64(local_tid_236472)] =\n                                x_236490;\n                            x_236494 = x_236490;\n                            ((volatile __local\n                              int64_t *) color_232186)[sext_i32_i64(local_tid_236472)] =\n                                x_236491;\n                            x_236495 = x_236491;\n                            ((volatile __local\n                              int64_t *) color_232185)[sext_i32_i64(local_tid_236472)] =\n                                x_236492;\n                            x_236496 = x_236492;\n                            ((volatile __local\n                              int64_t *) color_232184)[sext_i32_i64(local_tid_236472)] =\n                                x_236493;\n                            x_236497 = x_236493;\n                        }\n                    }\n                    if (sle32(wave_sizze_236474, skip_threads_236506)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_236506 *= 2;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        bool no_carry_in_236509 = squot32(local_tid_236472, 32) == 0 ||\n             !ltid_in_bounds_236502;\n        \n        // carry-in for every block except the first\n        {\n            // read operands\n            {\n                if (!no_carry_in_236509) {\n                    x_227472 = x_227468;\n                    x_227473 = x_227469;\n                    x_227474 = x_227470;\n                    x_227475 = x_227471;\n                    x_227468 = ((__local\n                                 int64_t *) color_232187)[sext_i32_i64(squot32(local_tid_236472,\n                             ",
                   "                                                  32)) -\n                                                          (int64_t) 1];\n                    x_227469 = ((__local\n                                 int64_t *) color_232186)[sext_i32_i64(squot32(local_tid_236472,\n                                                                               32)) -\n                                                          (int64_t) 1];\n                    x_227470 = ((__local\n                                 int64_t *) color_232185)[sext_i32_i64(squot32(local_tid_236472,\n                                                                               32)) -\n                                                          (int64_t) 1];\n                    x_227471 = ((__local\n                                 int64_t *) color_232184)[sext_i32_i64(squot32(local_tid_236472,\n                                                                               32)) -\n                                                          (int64_t) 1];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_236510 =\n                     slt64(srem64(sext_i32_i64(local_tid_236472), n_203572),\n                           sext_i32_i64(local_tid_236472) -\n                           sext_i32_i64(squot32(local_tid_236472, 32) * 32 -\n                           1));\n                \n                if (!no_carry_in_236509) {\n                    if (inactive_236510) {\n                        x_227468 = x_227472;\n                        x_227469 = x_227473;\n                        x_227470 = x_227474;\n                        x_227471 = x_227475;\n                    }\n                }\n                if (!no_carry_in_236509) {\n                    if (!inactive_236510) {\n                        int64_t defunc_1_op_res_227476 = add64(x_227468,\n                                                               x_227472);\n                        int64_t defunc_1_op_res_227477 = add64",
                   "(x_227469,\n                                                               x_227473);\n                        int64_t defunc_1_op_res_227478 = add64(x_227470,\n                                                               x_227474);\n                        int64_t defunc_1_op_res_227479 = add64(x_227471,\n                                                               x_227475);\n                        \n                        x_227468 = defunc_1_op_res_227476;\n                        x_227469 = defunc_1_op_res_227477;\n                        x_227470 = defunc_1_op_res_227478;\n                        x_227471 = defunc_1_op_res_227479;\n                    }\n                }\n            }\n            // write final result\n            {\n                if (!no_carry_in_236509) {\n                    ((__local\n                      int64_t *) color_232187)[sext_i32_i64(local_tid_236472)] =\n                        x_227468;\n                    ((__local\n                      int64_t *) color_232186)[sext_i32_i64(local_tid_236472)] =\n                        x_227469;\n                    ((__local\n                      int64_t *) color_232185)[sext_i32_i64(local_tid_236472)] =\n                        x_227470;\n                    ((__local\n                      int64_t *) color_232184)[sext_i32_i64(local_tid_236472)] =\n                        x_227471;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // restore correct values for first block\n        {\n            if (squot32(local_tid_236472, 32) == 0 && ltid_in_bounds_236502) {\n                ((__local\n                  int64_t *) color_232187)[sext_i32_i64(local_tid_236472)] =\n                    x_227472;\n                ((__local\n                  int64_t *) color_232186)[sext_i32_i64(local_tid_236472)] =\n                    x_227473;\n                ((__local\n                  int64_t *) color_232185)[sext_i32_i64(local_tid_236472)] =\n                    x_227474;\n                (",
                   "(__local\n                  int64_t *) color_232184)[sext_i32_i64(local_tid_236472)] =\n                    x_227475;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int64_t last_res_227516;\n        \n        last_res_227516 = ((__local int64_t *) color_232187)[i_203760];\n        \n        int64_t last_res_227517;\n        \n        last_res_227517 = ((__local int64_t *) color_232186)[i_203760];\n        \n        int64_t last_res_227518;\n        \n        last_res_227518 = ((__local int64_t *) color_232185)[i_203760];\n        \n        double tmp_236511;\n        \n        tmp_236511 = ((__global double *) mem_param_231792)[phys_tid_227449 *\n                                                            n_203572 +\n                                                            sext_i32_i64(local_tid_236472)];\n        ((__local double *) color_232182)[sext_i32_i64(local_tid_236472)] =\n            tmp_236511;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int64_t write_i_227521 = sext_i32_i64(sext_i64_i32(ltid_pre_236476));\n        int32_t phys_tid_227522 = local_tid_236472;\n        int32_t x_227523;\n        \n        x_227523 = ((__local int32_t *) color_232183)[write_i_227521];\n        \n        double write_value_227528;\n        \n        write_value_227528 = ((__global\n                               double *) mem_param_231792)[phys_tid_227449 *\n                                                           n_203572 +\n                                                           write_i_227521];\n        \n        bool match_lit_227529 = 0 == x_227523;\n        int64_t defunc_1_f_res_227530;\n        \n        if (match_lit_227529) {\n            int64_t x_227524;\n            \n            x_227524 = ((__local int64_t *) color_232187)[write_i_227521];\n            \n            int64_t case_res_227531 = sub64(x_227524, (int64_t) 1);\n            \n            defunc_1_f_res_227530 = case_res_227531;\n        } else {\n            bool match_lit_227532 = 1 == x_227523",
                   ";\n            int64_t x_227533;\n            \n            if (match_lit_227532) {\n                int64_t x_227525;\n                \n                x_227525 = ((__local int64_t *) color_232186)[write_i_227521];\n                \n                int64_t x_227534 = add64(last_res_227516, x_227525);\n                int64_t case_res_227535 = sub64(x_227534, (int64_t) 1);\n                \n                x_227533 = case_res_227535;\n            } else {\n                bool match_lit_227536 = 2 == x_227523;\n                int64_t x_227537;\n                \n                if (match_lit_227536) {\n                    int64_t x_227526;\n                    \n                    x_227526 = ((__local\n                                 int64_t *) color_232185)[write_i_227521];\n                    \n                    int64_t x_227538 = add64(last_res_227516, last_res_227517);\n                    int64_t x_227539 = add64(x_227526, x_227538);\n                    int64_t case_res_227540 = sub64(x_227539, (int64_t) 1);\n                    \n                    x_227537 = case_res_227540;\n                } else {\n                    int64_t x_227527;\n                    \n                    x_227527 = ((__local\n                                 int64_t *) color_232184)[write_i_227521];\n                    \n                    int64_t x_227541 = add64(last_res_227516, last_res_227517);\n                    int64_t x_227542 = add64(last_res_227518, x_227541);\n                    int64_t x_227543 = add64(x_227527, x_227542);\n                    int64_t defunc_1_f_res_res_227544 = sub64(x_227543,\n                                                              (int64_t) 1);\n                    \n                    x_227537 = defunc_1_f_res_res_227544;\n                }\n                x_227533 = x_227537;\n            }\n            defunc_1_f_res_227530 = x_227533;\n        }\n        if (sle64((int64_t) 0, defunc_1_f_res_227530) &&\n            slt64(defunc_1_f_res_227530, n_203572)) {\n            (",
                   "(__local double *) color_232182)[defunc_1_f_res_227530] =\n                write_value_227528;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        double tmp_236512;\n        \n        tmp_236512 = ((__local\n                       double *) color_232182)[sext_i32_i64(local_tid_236472)];\n        ((__global double *) mem_param_out_232072)[phys_tid_227449 * n_203572 +\n                                                   sext_i32_i64(local_tid_236472)] =\n            tmp_236512;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        __global unsigned char *mem_param_tmp_236482;\n        \n        mem_param_tmp_236482 = mem_param_out_232072;\n        \n        __global unsigned char *mem_param_out_tmp_236483;\n        \n        mem_param_out_tmp_236483 = mem_param_231792;\n        mem_param_231792 = mem_param_tmp_236482;\n        mem_param_out_232072 = mem_param_out_tmp_236483;\n    }\n    ext_mem_231821 = mem_param_231792;\n    ext_mem_unused_232071 = mem_param_out_232072;\n    if (local_tid_236472 == 0) {\n        for (int64_t i_236513 = 0; i_236513 < n_203572; i_236513++) {\n            double tmp_236514;\n            \n            tmp_236514 = ((__global double *) ext_mem_231821)[phys_tid_227449 *\n                                                              n_203572 +\n                                                              i_236513];\n            ((__global double *) mem_231829)[gtid_227448 * n_203572 +\n                                             i_236513] = tmp_236514;\n        }\n    }\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_227905(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *color_232193_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *color_232192_backing_aligned_1,\n                                             __local volatile\n                             ",
                   "                int64_t *color_232191_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *color_232190_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *color_232189_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *color_232188_backing_aligned_5,\n                                             int64_t n_203572,\n                                             int64_t partition_sizze_203667,\n                                             int64_t i_203760,\n                                             unsigned char cond_f_res_227891_bits,\n                                             unsigned char cond_f_res_227892_bits,\n                                             int64_t unsign_arg_227893,\n                                             int64_t unsign_arg_227894, __global\n                                             unsigned char *mem_param_231841,\n                                             __global unsigned char *mem_231872)\n{\n    bool cond_f_res_227891 = cond_f_res_227891_bits;\n    bool cond_f_res_227892 = cond_f_res_227892_bits;\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict color_232193_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) color_232193_backing_aligned_0;\n    __local volatile unsigned char *restrict color_232192_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) color_232192_backing_aligned_1;\n    __local volatile unsigned char *restrict color_232191_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) color_232191_backing_aligned",
                   "_2;\n    __local volatile unsigned char *restrict color_232190_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) color_232190_backing_aligned_3;\n    __local volatile unsigned char *restrict color_232189_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_232189_backing_aligned_4;\n    __local volatile unsigned char *restrict color_232188_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232188_backing_aligned_5;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236517;\n    int32_t local_tid_236518;\n    int64_t group_sizze_236521;\n    int32_t wave_sizze_236520;\n    int32_t group_tid_236519;\n    \n    global_tid_236517 = get_global_id(0);\n    local_tid_236518 = get_local_id(0);\n    group_sizze_236521 = get_local_size(0);\n    wave_sizze_236520 = LOCKSTEP_WIDTH;\n    group_tid_236519 = get_group_id(0);\n    \n    int32_t phys_tid_227905 = group_tid_236519;\n    int64_t slice_236523 = n_203572;\n    int64_t ltid_pre_236522 = sext_i32_i64(local_tid_236518);\n    int64_t remnant_236524 = sext_i32_i64(local_tid_236518) - ltid_pre_236522;\n    int64_t slice_236525 = partition_sizze_203667;\n    int64_t gtid_227904 = sext_i32_i64(group_tid_236519);\n    int64_t remnant_236526 = sext_i32_i64(group_tid_236519) - gtid_227904;\n    __local unsigned char *color_232188;\n    \n    color_232188 = (__local unsigned char *) color_232188_backing_0;\n    \n    __local unsigned char *color_232189;\n    \n    color_232189 = (__local unsigned char *) color_232189_backing_1;\n    \n    __local unsigned char *color_232190;\n    \n    color_232190 = (__local unsigned char *) color_232190_backing_2;\n    \n    __local unsigned char *color_232191;\n    \n    color_232191 = (__local unsigned char *) color_232191_backing_3;\n    \n    __local unsigned char *color_232192;\n    \n    color_",
                   "232192 = (__local unsigned char *) color_232192_backing_4;\n    \n    __local unsigned char *color_232193;\n    \n    color_232193 = (__local unsigned char *) color_232193_backing_5;\n    \n    double tmp_236527;\n    \n    tmp_236527 = ((__global double *) mem_param_231841)[gtid_227904 * n_203572 +\n                                                        sext_i32_i64(local_tid_236518)];\n    ((__local double *) color_232193)[sext_i32_i64(local_tid_236518)] =\n        tmp_236527;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_227915 = sext_i32_i64(sext_i64_i32(ltid_pre_236522));\n    int32_t phys_tid_227916 = local_tid_236518;\n    double x_227929;\n    \n    x_227929 = ((__global double *) mem_param_231841)[gtid_227904 * n_203572 +\n                                                      gtid_227915];\n    \n    int64_t i64_arg_227930;\n    \n    i64_arg_227930 = futrts_to_bits64(x_227929);\n    \n    int64_t unsign_arg_227931 = ashr64(i64_arg_227930, unsign_arg_227893);\n    int64_t unsign_arg_227932 = (int64_t) 1 & unsign_arg_227931;\n    int32_t to_i32_res_227933 = zext_i64_i32(unsign_arg_227932);\n    int64_t unsign_arg_227934 = ashr64(i64_arg_227930, (int64_t) 63);\n    int64_t unsign_arg_227935 = (int64_t) 1 & unsign_arg_227934;\n    int32_t to_i32_res_227936 = zext_i64_i32(unsign_arg_227935);\n    bool cond_227937 = to_i32_res_227936 == 1;\n    bool x_227938 = !cond_227937;\n    bool y_227939 = cond_f_res_227891 && x_227938;\n    bool cond_227940 = cond_227937 || y_227939;\n    int32_t defunc_1_get_bit_res_227941;\n    \n    if (cond_227940) {\n        int32_t defunc_1_get_bit_res_t_res_227942 = 1 ^ to_i32_res_227933;\n        \n        defunc_1_get_bit_res_227941 = defunc_1_get_bit_res_t_res_227942;\n    } else {\n        defunc_1_get_bit_res_227941 = to_i32_res_227933;\n    }\n    \n    int32_t x_227943 = mul32(2, defunc_1_get_bit_res_227941);\n    int64_t unsign_arg_227944 = ashr64(i64_arg_227930, unsign_arg_227894);\n    int64_t unsign_arg_227945 = (int64_t) 1 & unsign_arg_227944;\n    int32",
                   "_t to_i32_res_227946 = zext_i64_i32(unsign_arg_227945);\n    bool y_227947 = cond_f_res_227892 && x_227938;\n    bool cond_227948 = cond_227937 || y_227947;\n    int32_t defunc_1_get_bit_res_227949;\n    \n    if (cond_227948) {\n        int32_t defunc_1_get_bit_res_t_res_227950 = 1 ^ to_i32_res_227946;\n        \n        defunc_1_get_bit_res_227949 = defunc_1_get_bit_res_t_res_227950;\n    } else {\n        defunc_1_get_bit_res_227949 = to_i32_res_227946;\n    }\n    \n    int32_t defunc_0_f_res_227951 = add32(x_227943,\n                                          defunc_1_get_bit_res_227949);\n    bool cond_227952 = defunc_0_f_res_227951 == 0;\n    int64_t defunc_0_f_res_227953 = btoi_bool_i64(cond_227952);\n    int64_t defunc_0_f_res_227954;\n    int64_t defunc_0_f_res_227955;\n    int64_t defunc_0_f_res_227956;\n    \n    if (cond_227952) {\n        defunc_0_f_res_227954 = (int64_t) 0;\n        defunc_0_f_res_227955 = (int64_t) 0;\n        defunc_0_f_res_227956 = (int64_t) 0;\n    } else {\n        bool cond_227957 = defunc_0_f_res_227951 == 1;\n        int64_t defunc_0_f_res_f_res_227958 = btoi_bool_i64(cond_227957);\n        int64_t defunc_0_f_res_f_res_227959;\n        int64_t defunc_0_f_res_f_res_227960;\n        \n        if (cond_227957) {\n            defunc_0_f_res_f_res_227959 = (int64_t) 0;\n            defunc_0_f_res_f_res_227960 = (int64_t) 0;\n        } else {\n            bool cond_227961 = defunc_0_f_res_227951 == 2;\n            int64_t defunc_0_f_res_f_res_f_res_227962 =\n                    btoi_bool_i64(cond_227961);\n            bool cond_neg_227963 = !cond_227961;\n            int64_t defunc_0_f_res_f_res_f_res_227964 =\n                    btoi_bool_i64(cond_neg_227963);\n            \n            defunc_0_f_res_f_res_227959 = defunc_0_f_res_f_res_f_res_227962;\n            defunc_0_f_res_f_res_227960 = defunc_0_f_res_f_res_f_res_227964;\n        }\n        defunc_0_f_res_227954 = defunc_0_f_res_f_res_227958;\n        defunc_0_f_res_227955 = defunc_0_f_res_f_res_227959;\n        defunc_0_",
                   "f_res_227956 = defunc_0_f_res_f_res_227960;\n    }\n    ((__local int64_t *) color_232192)[gtid_227915] = defunc_0_f_res_227953;\n    ((__local int64_t *) color_232191)[gtid_227915] = defunc_0_f_res_227954;\n    ((__local int64_t *) color_232190)[gtid_227915] = defunc_0_f_res_227955;\n    ((__local int64_t *) color_232189)[gtid_227915] = defunc_0_f_res_227956;\n    ((__local int32_t *) color_232188)[gtid_227915] = defunc_0_f_res_227951;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_236528 = n_203572;\n    int64_t x_227917;\n    int64_t x_227918;\n    int64_t x_227919;\n    int64_t x_227920;\n    int64_t x_227921;\n    int64_t x_227922;\n    int64_t x_227923;\n    int64_t x_227924;\n    int64_t x_236533;\n    int64_t x_236534;\n    int64_t x_236535;\n    int64_t x_236536;\n    int64_t x_236537;\n    int64_t x_236538;\n    int64_t x_236539;\n    int64_t x_236540;\n    bool ltid_in_bounds_236545 = slt64(sext_i32_i64(local_tid_236518),\n                                       n_203572);\n    int32_t skip_threads_236546;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_236545) {\n            x_227921 = ((volatile __local\n                         int64_t *) color_232192)[sext_i32_i64(local_tid_236518)];\n            x_227922 = ((volatile __local\n                         int64_t *) color_232191)[sext_i32_i64(local_tid_236518)];\n            x_227923 = ((volatile __local\n                         int64_t *) color_232190)[sext_i32_i64(local_tid_236518)];\n            x_227924 = ((volatile __local\n                         int64_t *) color_232189)[sext_i32_i64(local_tid_236518)];\n            if ((local_tid_236518 - squot32(local_tid_236518, 32) * 32) == 0) {\n                x_227917 = x_227921;\n                x_227918 = x_227922;\n                x_227919 = x_227923;\n                x_227920 = x_227924;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_236546 = 1;\n        while (slt32(skip_threads_236546, 32))",
                   " {\n            bool thread_active_236547 = sle32(skip_threads_236546,\n                                              local_tid_236518 -\n                                              squot32(local_tid_236518, 32) *\n                                              32) && ltid_in_bounds_236545;\n            \n            if (thread_active_236547) {\n                // read operands\n                {\n                    x_227917 = ((volatile __local\n                                 int64_t *) color_232192)[sext_i32_i64(local_tid_236518) -\n                                                          sext_i32_i64(skip_threads_236546)];\n                    x_227918 = ((volatile __local\n                                 int64_t *) color_232191)[sext_i32_i64(local_tid_236518) -\n                                                          sext_i32_i64(skip_threads_236546)];\n                    x_227919 = ((volatile __local\n                                 int64_t *) color_232190)[sext_i32_i64(local_tid_236518) -\n                                                          sext_i32_i64(skip_threads_236546)];\n                    x_227920 = ((volatile __local\n                                 int64_t *) color_232189)[sext_i32_i64(local_tid_236518) -\n                                                          sext_i32_i64(skip_threads_236546)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_236548 =\n                     slt64(srem64(sext_i32_i64(local_tid_236518), n_203572),\n                           sext_i32_i64(local_tid_236518) -\n                           sext_i32_i64(local_tid_236518 -\n                           skip_threads_236546));\n                \n                if (thread_active_236547 && inactive_236548) {\n                    x_227917 = x_227921;\n                    x_227918 = x_227922;\n                    x_227919 = x_227923;\n                    x_227920 = x_227924;\n                }\n                if (thread_active_236547)",
                   " {\n                    if (!inactive_236548) {\n                        int64_t defunc_1_op_res_227925 = add64(x_227917,\n                                                               x_227921);\n                        int64_t defunc_1_op_res_227926 = add64(x_227918,\n                                                               x_227922);\n                        int64_t defunc_1_op_res_227927 = add64(x_227919,\n                                                               x_227923);\n                        int64_t defunc_1_op_res_227928 = add64(x_227920,\n                                                               x_227924);\n                        \n                        x_227917 = defunc_1_op_res_227925;\n                        x_227918 = defunc_1_op_res_227926;\n                        x_227919 = defunc_1_op_res_227927;\n                        x_227920 = defunc_1_op_res_227928;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_236520, skip_threads_236546)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_236547) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) color_232192)[sext_i32_i64(local_tid_236518)] =\n                        x_227917;\n                    x_227921 = x_227917;\n                    ((volatile __local\n                      int64_t *) color_232191)[sext_i32_i64(local_tid_236518)] =\n                        x_227918;\n                    x_227922 = x_227918;\n                    ((volatile __local\n                      int64_t *) color_232190)[sext_i32_i64(local_tid_236518)] =\n                        x_227919;\n                    x_227923 = x_227919;\n                    ((volatile __local\n                      int64_t *) color_232189)[sext_i32_i64(local_tid_236518)] =\n                        x_227920;\n                    x_227924 = x_227920;\n                }\n            }\n            if (sle32(w",
                   "ave_sizze_236520, skip_threads_236546)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_236546 *= 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_236518 - squot32(local_tid_236518, 32) * 32) == 31 &&\n            ltid_in_bounds_236545) {\n            ((volatile __local\n              int64_t *) color_232192)[sext_i32_i64(squot32(local_tid_236518,\n                                                            32))] = x_227917;\n            ((volatile __local\n              int64_t *) color_232191)[sext_i32_i64(squot32(local_tid_236518,\n                                                            32))] = x_227918;\n            ((volatile __local\n              int64_t *) color_232190)[sext_i32_i64(squot32(local_tid_236518,\n                                                            32))] = x_227919;\n            ((volatile __local\n              int64_t *) color_232189)[sext_i32_i64(squot32(local_tid_236518,\n                                                            32))] = x_227920;\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_236549;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_236518, 32) == 0 && ltid_in_bounds_236545) {\n                x_236537 = ((volatile __local\n                             int64_t *) color_232192)[sext_i32_i64(local_tid_236518)];\n                x_236538 = ((volatile __local\n                             int64_t *) color_232191)[sext_i32_i64(local_tid_236518)];\n                x_236539 = ((volatile __local\n                             int64_t *) color_232190)[sext_i32_i64(local_tid_236518)];\n                x_236540 = ((volatile __local\n                             int64_t *) color_232189)[sext_i32_i64(local_tid_236518)];\n                if ((local_ti",
                   "d_236518 - squot32(local_tid_236518, 32) * 32) ==\n                    0) {\n                    x_236533 = x_236537;\n                    x_236534 = x_236538;\n                    x_236535 = x_236539;\n                    x_236536 = x_236540;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_236549 = 1;\n            while (slt32(skip_threads_236549, 32)) {\n                bool thread_active_236550 = sle32(skip_threads_236549,\n                                                  local_tid_236518 -\n                                                  squot32(local_tid_236518,\n                                                          32) * 32) &&\n                     (squot32(local_tid_236518, 32) == 0 &&\n                      ltid_in_bounds_236545);\n                \n                if (thread_active_236550) {\n                    // read operands\n                    {\n                        x_236533 = ((volatile __local\n                                     int64_t *) color_232192)[sext_i32_i64(local_tid_236518) -\n                                                              sext_i32_i64(skip_threads_236549)];\n                        x_236534 = ((volatile __local\n                                     int64_t *) color_232191)[sext_i32_i64(local_tid_236518) -\n                                                              sext_i32_i64(skip_threads_236549)];\n                        x_236535 = ((volatile __local\n                                     int64_t *) color_232190)[sext_i32_i64(local_tid_236518) -\n                                                              sext_i32_i64(skip_threads_236549)];\n                        x_236536 = ((volatile __local\n                                     int64_t *) color_232189)[sext_i32_i64(local_tid_236518) -\n                                                              sext_i32_i64(skip_threads_236549)];\n                    }\n                }\n                // per",
                   "form operation\n                {\n                    bool inactive_236551 =\n                         slt64(srem64(sext_i32_i64(local_tid_236518 * 32 + 32 -\n                                      1), n_203572),\n                               sext_i32_i64(local_tid_236518 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_236518 -\n                                             skip_threads_236549) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_236550 && inactive_236551) {\n                        x_236533 = x_236537;\n                        x_236534 = x_236538;\n                        x_236535 = x_236539;\n                        x_236536 = x_236540;\n                    }\n                    if (thread_active_236550) {\n                        if (!inactive_236551) {\n                            int64_t defunc_1_op_res_236541 = add64(x_236533,\n                                                                   x_236537);\n                            int64_t defunc_1_op_res_236542 = add64(x_236534,\n                                                                   x_236538);\n                            int64_t defunc_1_op_res_236543 = add64(x_236535,\n                                                                   x_236539);\n                            int64_t defunc_1_op_res_236544 = add64(x_236536,\n                                                                   x_236540);\n                            \n                            x_236533 = defunc_1_op_res_236541;\n                            x_236534 = defunc_1_op_res_236542;\n                            x_236535 = defunc_1_op_res_236543;\n                            x_236536 = defunc_1_op_res_236544;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_236520, skip_threads_236549)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_236550) {\n ",
                   "                   // write result\n                    {\n                        ((volatile __local\n                          int64_t *) color_232192)[sext_i32_i64(local_tid_236518)] =\n                            x_236533;\n                        x_236537 = x_236533;\n                        ((volatile __local\n                          int64_t *) color_232191)[sext_i32_i64(local_tid_236518)] =\n                            x_236534;\n                        x_236538 = x_236534;\n                        ((volatile __local\n                          int64_t *) color_232190)[sext_i32_i64(local_tid_236518)] =\n                            x_236535;\n                        x_236539 = x_236535;\n                        ((volatile __local\n                          int64_t *) color_232189)[sext_i32_i64(local_tid_236518)] =\n                            x_236536;\n                        x_236540 = x_236536;\n                    }\n                }\n                if (sle32(wave_sizze_236520, skip_threads_236549)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_236549 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_236552 = squot32(local_tid_236518, 32) == 0 ||\n         !ltid_in_bounds_236545;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_236552) {\n                x_227921 = x_227917;\n                x_227922 = x_227918;\n                x_227923 = x_227919;\n                x_227924 = x_227920;\n                x_227917 = ((__local\n                             int64_t *) color_232192)[sext_i32_i64(squot32(local_tid_236518,\n                                                                           32)) -\n                                                      (int64_t) 1];\n                x_227918 = ((__local\n                             int64_t *) color_232191)[sext_i32_i64(squot32(local_tid_236518,\n                  ",
                   "                                                         32)) -\n                                                      (int64_t) 1];\n                x_227919 = ((__local\n                             int64_t *) color_232190)[sext_i32_i64(squot32(local_tid_236518,\n                                                                           32)) -\n                                                      (int64_t) 1];\n                x_227920 = ((__local\n                             int64_t *) color_232189)[sext_i32_i64(squot32(local_tid_236518,\n                                                                           32)) -\n                                                      (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_236553 = slt64(srem64(sext_i32_i64(local_tid_236518),\n                                                n_203572),\n                                         sext_i32_i64(local_tid_236518) -\n                                         sext_i32_i64(squot32(local_tid_236518,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_236552) {\n                if (inactive_236553) {\n                    x_227917 = x_227921;\n                    x_227918 = x_227922;\n                    x_227919 = x_227923;\n                    x_227920 = x_227924;\n                }\n            }\n            if (!no_carry_in_236552) {\n                if (!inactive_236553) {\n                    int64_t defunc_1_op_res_227925 = add64(x_227917, x_227921);\n                    int64_t defunc_1_op_res_227926 = add64(x_227918, x_227922);\n                    int64_t defunc_1_op_res_227927 = add64(x_227919, x_227923);\n                    int64_t defunc_1_op_res_227928 = add64(x_227920, x_227924);\n                    \n                    x_227917 = defunc_1_op_res_227925;\n                    x_227918 = defunc_1_op_res_227926;\n                    x_227919 = defunc_1_op_res_227927;\n  ",
                   "                  x_227920 = defunc_1_op_res_227928;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_236552) {\n                ((__local\n                  int64_t *) color_232192)[sext_i32_i64(local_tid_236518)] =\n                    x_227917;\n                ((__local\n                  int64_t *) color_232191)[sext_i32_i64(local_tid_236518)] =\n                    x_227918;\n                ((__local\n                  int64_t *) color_232190)[sext_i32_i64(local_tid_236518)] =\n                    x_227919;\n                ((__local\n                  int64_t *) color_232189)[sext_i32_i64(local_tid_236518)] =\n                    x_227920;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_236518, 32) == 0 && ltid_in_bounds_236545) {\n            ((__local int64_t *) color_232192)[sext_i32_i64(local_tid_236518)] =\n                x_227921;\n            ((__local int64_t *) color_232191)[sext_i32_i64(local_tid_236518)] =\n                x_227922;\n            ((__local int64_t *) color_232190)[sext_i32_i64(local_tid_236518)] =\n                x_227923;\n            ((__local int64_t *) color_232189)[sext_i32_i64(local_tid_236518)] =\n                x_227924;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t last_res_227965;\n    \n    last_res_227965 = ((__local int64_t *) color_232192)[i_203760];\n    \n    int64_t last_res_227966;\n    \n    last_res_227966 = ((__local int64_t *) color_232191)[i_203760];\n    \n    int64_t last_res_227967;\n    \n    last_res_227967 = ((__local int64_t *) color_232190)[i_203760];\n    \n    int64_t write_i_227969 = sext_i32_i64(sext_i64_i32(ltid_pre_236522));\n    int32_t phys_tid_227970 = local_tid_236518;\n    int32_t x_227971;\n    \n    x_227971 = ((__local int32_t *) color_232188)[write_i_227969];\n    \n    double write_value_227976;\n    \n    write_value_227976 = ((__global double",
                   " *) mem_param_231841)[gtid_227904 *\n                                                                n_203572 +\n                                                                write_i_227969];\n    \n    bool match_lit_227977 = 0 == x_227971;\n    int64_t defunc_1_f_res_227978;\n    \n    if (match_lit_227977) {\n        int64_t x_227972;\n        \n        x_227972 = ((__local int64_t *) color_232192)[write_i_227969];\n        \n        int64_t case_res_227979 = sub64(x_227972, (int64_t) 1);\n        \n        defunc_1_f_res_227978 = case_res_227979;\n    } else {\n        bool match_lit_227980 = 1 == x_227971;\n        int64_t x_227981;\n        \n        if (match_lit_227980) {\n            int64_t x_227973;\n            \n            x_227973 = ((__local int64_t *) color_232191)[write_i_227969];\n            \n            int64_t x_227982 = add64(last_res_227965, x_227973);\n            int64_t case_res_227983 = sub64(x_227982, (int64_t) 1);\n            \n            x_227981 = case_res_227983;\n        } else {\n            bool match_lit_227984 = 2 == x_227971;\n            int64_t x_227985;\n            \n            if (match_lit_227984) {\n                int64_t x_227974;\n                \n                x_227974 = ((__local int64_t *) color_232190)[write_i_227969];\n                \n                int64_t x_227986 = add64(last_res_227965, last_res_227966);\n                int64_t x_227987 = add64(x_227974, x_227986);\n                int64_t case_res_227988 = sub64(x_227987, (int64_t) 1);\n                \n                x_227985 = case_res_227988;\n            } else {\n                int64_t x_227975;\n                \n                x_227975 = ((__local int64_t *) color_232189)[write_i_227969];\n                \n                int64_t x_227989 = add64(last_res_227965, last_res_227966);\n                int64_t x_227990 = add64(last_res_227967, x_227989);\n                int64_t x_227991 = add64(x_227975, x_227990);\n                int64_t defunc_1_f_res_res_227992 = sub64(x_227991,\n   ",
                   "                                                       (int64_t) 1);\n                \n                x_227985 = defunc_1_f_res_res_227992;\n            }\n            x_227981 = x_227985;\n        }\n        defunc_1_f_res_227978 = x_227981;\n    }\n    if (sle64((int64_t) 0, defunc_1_f_res_227978) &&\n        slt64(defunc_1_f_res_227978, n_203572)) {\n        ((__local double *) color_232193)[defunc_1_f_res_227978] =\n            write_value_227976;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    double tmp_236554;\n    \n    tmp_236554 = ((__local\n                   double *) color_232193)[sext_i32_i64(local_tid_236518)];\n    ((__global double *) mem_231872)[gtid_227904 * n_203572 +\n                                     sext_i32_i64(local_tid_236518)] =\n        tmp_236554;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegred_large_212093(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_233177_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233175_backing_aligned_1,\n                                        int64_t n_p_203574, int64_t q_s_203575,\n                                        int64_t partition_sizze_203667,\n                                        int64_t defunc_0_f_res_203721,\n                                        int64_t s_n_m_203726,\n                                        int64_t num_groups_212086,\n                                        int64_t groups_per_segment_233161,\n                                        int64_t elements_per_thread_233162,\n                                        int64_t virt_num_groups_233163,\n                                        int64_t threads_per_segment_233165,\n                                        __global unsigned char *ext_mem_229372,\n                                        __global unsigned char *ext_me",
                   "m_229373,\n                                        __global unsigned char *ext_mem_229470,\n                                        __global unsigned char *ext_mem_229471,\n                                        __global unsigned char *mem_229639,\n                                        __global unsigned char *mem_229795,\n                                        __global unsigned char *mem_229805,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233166,\n                                        __global\n                                        unsigned char *mainzicounter_mem_233168)\n{\n    #define segred_group_sizze_212085 (mainzisegred_group_sizze_211266)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict sync_arr_mem_233177_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_233177_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_233175_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233175_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233170;\n    int32_t local_tid_233171;\n    int64_t group_sizze_233174;\n    int32_t wave_sizze_233173;\n    int32_t group_tid_233172;\n    \n    global_tid_233170 = get_global_id(0);\n    local_tid_233171 = get_local_id(0);\n    group_sizze_233174 = get_local_size(0);\n    wave_sizze_233173 = LOCKSTEP_WIDTH;\n    group_tid_233172 = get_group_id(0);\n    \n    int32_t phys_tid_212093 = global_tid_233170;\n    __local unsigned char *red_arr_mem_233175;\n    \n    red_arr_mem_233175 = (__local unsigned char *) red_arr_mem_233175_backing_0;\n    \n    __local unsigned char *sync_arr_mem_233177;\n    \n    sync_arr_mem_233177 = (__local\n                           unsign",
                   "ed char *) sync_arr_mem_233177_backing_1;\n    \n    int32_t phys_group_id_233179;\n    \n    phys_group_id_233179 = get_group_id(0);\n    for (int32_t i_233180 = 0; i_233180 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_233163) - phys_group_id_233179,\n                   sext_i64_i32(num_groups_212086)); i_233180++) {\n        int32_t virt_group_id_233181 = phys_group_id_233179 + i_233180 *\n                sext_i64_i32(num_groups_212086);\n        int32_t flat_segment_id_233182 = squot32(virt_group_id_233181,\n                                                 sext_i64_i32(groups_per_segment_233161));\n        int64_t global_tid_233183 = srem64(sext_i32_i64(virt_group_id_233181) *\n                                           segred_group_sizze_212085 +\n                                           sext_i32_i64(local_tid_233171),\n                                           segred_group_sizze_212085 *\n                                           groups_per_segment_233161);\n        int64_t slice_233184 = s_n_m_203726;\n        int64_t slice_233185 = n_p_203574 * slice_233184;\n        int64_t slice_233186 = partition_sizze_203667 * slice_233185;\n        int64_t gtid_212089 = squot64(sext_i32_i64(flat_segment_id_233182),\n                                      slice_233185);\n        int64_t remnant_233187 = sext_i32_i64(flat_segment_id_233182) -\n                gtid_212089 * slice_233185;\n        int64_t gtid_212090 = squot64(remnant_233187, slice_233184);\n        int64_t remnant_233188 = remnant_233187 - gtid_212090 * slice_233184;\n        int64_t gtid_212091 = remnant_233188;\n        int64_t remnant_233189 = remnant_233188 - gtid_212091;\n        int64_t gtid_212092;\n        double x_acc_233190;\n        int64_t chunk_sizze_233191 = smin64(elements_per_thread_233162,\n                                            sdiv_up64(q_s_203575 -\n                                                      global_tid_233183,\n                                                      threads_per_segment_233165));\n ",
                   "       double x_212094;\n        double x_212095;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_233190 = 0.0;\n        }\n        for (int64_t i_233195 = 0; i_233195 < chunk_sizze_233191; i_233195++) {\n            gtid_212092 = global_tid_233183 + threads_per_segment_233165 *\n                i_233195;\n            // apply map function\n            {\n                int64_t x_212105;\n                \n                x_212105 = ((__global int64_t *) ext_mem_229372)[gtid_212089 *\n                                                                 n_p_203574 +\n                                                                 gtid_212090];\n                \n                int64_t x_212109;\n                \n                x_212109 = ((__global int64_t *) ext_mem_229471)[gtid_212089 *\n                                                                 (s_n_m_203726 *\n                                                                  n_p_203574) +\n                                                                 gtid_212090 *\n                                                                 s_n_m_203726 +\n                                                                 gtid_212091];\n                \n                double x_212110;\n                \n                x_212110 = ((__global double *) ext_mem_229470)[gtid_212089 *\n                                                                (s_n_m_203726 *\n                                                                 n_p_203574) +\n                                                                gtid_212090 *\n                                                                s_n_m_203726 +\n                                                                gtid_212091];\n                \n                int64_t defunc_0_m_fun_res_212111;\n                \n                defunc_0_m_fun_res_212111 = ((__global\n                                              int64_t *) mem_229795)[gtid_212089 *\n                   ",
                   "                                                  (s_n_m_203726 *\n                                                                      n_p_203574) +\n                                                                     gtid_212090 *\n                                                                     s_n_m_203726 +\n                                                                     gtid_212091];\n                \n                bool cond_212113 = sle64(x_212105, gtid_212092);\n                int64_t defunc_0_f_res_212114;\n                \n                if (cond_212113) {\n                    defunc_0_f_res_212114 = (int64_t) 0;\n                } else {\n                    int64_t i_212115 = add64(gtid_212092, x_212109);\n                    int64_t defunc_0_add_arg_212116;\n                    \n                    defunc_0_add_arg_212116 = ((__global\n                                                int64_t *) ext_mem_229373)[gtid_212089 *\n                                                                           (defunc_0_f_res_203721 *\n                                                                            n_p_203574) +\n                                                                           gtid_212090 *\n                                                                           defunc_0_f_res_203721 +\n                                                                           i_212115];\n                    \n                    int64_t defunc_1_add_res_212117 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_212116);\n                    \n                    defunc_0_f_res_212114 = defunc_1_add_res_212117;\n                }\n                \n                double defunc_0_f_res_212118;\n                \n                if (cond_212113) {\n                    defunc_0_f_res_212118 = 0.0;\n                } else {\n                    int64_t i_212119 = add64(gtid_212092, x_212109);\n                    double defunc_0_ad",
                   "d_arg_212120;\n                    \n                    defunc_0_add_arg_212120 = ((__global\n                                                double *) mem_229639)[gtid_212089 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_212090 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_212119];\n                    defunc_0_f_res_212118 = defunc_0_add_arg_212120;\n                }\n                \n                int64_t binop_p_212121 = sub64(defunc_0_f_res_212114,\n                                               defunc_0_m_fun_res_212111);\n                double defunc_0_f_res_212122 = sitofp_i64_f64(binop_p_212121);\n                double abs_res_212123 = fabs(defunc_0_f_res_212122);\n                double tmp1_212124 = abs_res_212123 / x_212110;\n                double x_212125 = tmp1_212124 * tmp1_212124;\n                double y_212126 = tmp1_212124 * x_212125;\n                double tmp2_212127 = 1.0 - y_212126;\n                double x_212128 = tmp2_212127 * tmp2_212127;\n                double tmp3_212129 = tmp2_212127 * x_212128;\n                double w_j_212130 = defunc_0_f_res_212118 * tmp3_212129;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_212094 = x_acc_233190;\n                }\n                // load new values\n                {\n                    x_212095 = w_j_212130;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_212096 = x_212094 + x_212095;\n                    \n                    // store in accumulator\n                    {\n                        x_a",
                   "cc_233190 = defunc_1_op_res_212096;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_212094 = x_acc_233190;\n            ((__local\n              double *) red_arr_mem_233175)[sext_i32_i64(local_tid_233171)] =\n                x_212094;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_233196;\n        int32_t skip_waves_233197 = 1;\n        double x_233192;\n        double x_233193;\n        \n        offset_233196 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_233171,\n                      sext_i64_i32(segred_group_sizze_212085))) {\n                x_233192 = ((__local\n                             double *) red_arr_mem_233175)[sext_i32_i64(local_tid_233171 +\n                                                           offset_233196)];\n            }\n        }\n        offset_233196 = 1;\n        while (slt32(offset_233196, wave_sizze_233173)) {\n            if (slt32(local_tid_233171 + offset_233196,\n                      sext_i64_i32(segred_group_sizze_212085)) &&\n                ((local_tid_233171 - squot32(local_tid_233171,\n                                             wave_sizze_233173) *\n                  wave_sizze_233173) & (2 * offset_233196 - 1)) == 0) {\n                // read array element\n                {\n                    x_233193 = ((volatile __local\n                                 double *) red_arr_mem_233175)[sext_i32_i64(local_tid_233171 +\n                                                               offset_233196)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233194 = x_233192 + x_233193;\n                    \n                    x_233192 = defunc_1_op_res_233194;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n    ",
                   "                  double *) red_arr_mem_233175)[sext_i32_i64(local_tid_233171)] =\n                        x_233192;\n                }\n            }\n            offset_233196 *= 2;\n        }\n        while (slt32(skip_waves_233197,\n                     squot32(sext_i64_i32(segred_group_sizze_212085) +\n                             wave_sizze_233173 - 1, wave_sizze_233173))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_233196 = skip_waves_233197 * wave_sizze_233173;\n            if (slt32(local_tid_233171 + offset_233196,\n                      sext_i64_i32(segred_group_sizze_212085)) &&\n                ((local_tid_233171 - squot32(local_tid_233171,\n                                             wave_sizze_233173) *\n                  wave_sizze_233173) == 0 && (squot32(local_tid_233171,\n                                                      wave_sizze_233173) & (2 *\n                                                                            skip_waves_233197 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_233193 = ((__local\n                                 double *) red_arr_mem_233175)[sext_i32_i64(local_tid_233171 +\n                                                               offset_233196)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233194 = x_233192 + x_233193;\n                    \n                    x_233192 = defunc_1_op_res_233194;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_233175)[sext_i32_i64(local_tid_233171)] =\n                        x_233192;\n                }\n            }\n            skip_waves_233197 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n     ",
                   "   {\n            if (sext_i32_i64(local_tid_233171) == (int64_t) 0) {\n                x_acc_233190 = x_233192;\n            }\n        }\n        if (groups_per_segment_233161 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_233171 == 0) {\n                    ((__global double *) mem_229805)[gtid_212089 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_212090 *\n                                                     s_n_m_203726 +\n                                                     gtid_212091] =\n                        x_acc_233190;\n                }\n            }\n        } else {\n            int32_t old_counter_233198;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_233171 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_233166)[sext_i32_i64(virt_group_id_233181)] =\n                        x_acc_233190;\n                    mem_fence_global();\n                    old_counter_233198 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233168)[sext_i32_i64(srem32(flat_segment_id_233182,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_233177)[(int64_t) 0] =\n                        old_counter_233198 == groups_per_segment_233161 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_233199;\n            \n            is_last_group_233199 = ((__local\n         ",
                   "                            bool *) sync_arr_mem_233177)[(int64_t) 0];\n            if (is_last_group_233199) {\n                if (local_tid_233171 == 0) {\n                    old_counter_233198 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233168)[sext_i32_i64(srem32(flat_segment_id_233182,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_233161));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_233200 =\n                            sdiv_up64(groups_per_segment_233161,\n                                      segred_group_sizze_212085);\n                    \n                    x_212094 = 0.0;\n                    for (int64_t i_233201 = 0; i_233201 <\n                         read_per_thread_233200; i_233201++) {\n                        int64_t group_res_id_233202 =\n                                sext_i32_i64(local_tid_233171) *\n                                read_per_thread_233200 + i_233201;\n                        int64_t index_of_group_res_233203 =\n                                sext_i32_i64(flat_segment_id_233182) *\n                                groups_per_segment_233161 + group_res_id_233202;\n                        \n                        if (slt64(group_res_id_233202,\n                                  groups_per_segment_233161)) {\n                            x_212095 = ((__global\n                                         double *) segred_tmp_mem_233166)[index_of_group_res_233203];\n                            \n                            double defunc_1_op_res_212096 = x_212094 + x_212095;\n                            \n                            x_212094 = defunc_1_op_res_212096;\n      ",
                   "                  }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_233175)[sext_i32_i64(local_tid_233171)] =\n                    x_212094;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_233204;\n                    int32_t skip_waves_233205 = 1;\n                    double x_233192;\n                    double x_233193;\n                    \n                    offset_233204 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_233171,\n                                  sext_i64_i32(segred_group_sizze_212085))) {\n                            x_233192 = ((__local\n                                         double *) red_arr_mem_233175)[sext_i32_i64(local_tid_233171 +\n                                                                       offset_233204)];\n                        }\n                    }\n                    offset_233204 = 1;\n                    while (slt32(offset_233204, wave_sizze_233173)) {\n                        if (slt32(local_tid_233171 + offset_233204,\n                                  sext_i64_i32(segred_group_sizze_212085)) &&\n                            ((local_tid_233171 - squot32(local_tid_233171,\n                                                         wave_sizze_233173) *\n                              wave_sizze_233173) & (2 * offset_233204 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_233193 = ((volatile __local\n                                             double *) red_arr_mem_233175)[sext_i32_i64(local_tid_233171 +\n                                                                           offset_233204)];\n                            }\n                            // apply reduction operation\n    ",
                   "                        {\n                                double defunc_1_op_res_233194 = x_233192 +\n                                       x_233193;\n                                \n                                x_233192 = defunc_1_op_res_233194;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233175)[sext_i32_i64(local_tid_233171)] =\n                                    x_233192;\n                            }\n                        }\n                        offset_233204 *= 2;\n                    }\n                    while (slt32(skip_waves_233205,\n                                 squot32(sext_i64_i32(segred_group_sizze_212085) +\n                                         wave_sizze_233173 - 1,\n                                         wave_sizze_233173))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_233204 = skip_waves_233205 * wave_sizze_233173;\n                        if (slt32(local_tid_233171 + offset_233204,\n                                  sext_i64_i32(segred_group_sizze_212085)) &&\n                            ((local_tid_233171 - squot32(local_tid_233171,\n                                                         wave_sizze_233173) *\n                              wave_sizze_233173) == 0 &&\n                             (squot32(local_tid_233171, wave_sizze_233173) &\n                              (2 * skip_waves_233205 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_233193 = ((__local\n                                             double *) red_arr_mem_233175)[sext_i32_i64(local_tid_233171 +\n                                                                           offset_233204)];\n                            }\n                            // apply reduction operation\n",
                   "                            {\n                                double defunc_1_op_res_233194 = x_233192 +\n                                       x_233193;\n                                \n                                x_233192 = defunc_1_op_res_233194;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_233175)[sext_i32_i64(local_tid_233171)] =\n                                    x_233192;\n                            }\n                        }\n                        skip_waves_233205 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_233171 == 0) {\n                            ((__global double *) mem_229805)[gtid_212089 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_212090 *\n                                                             s_n_m_203726 +\n                                                             gtid_212091] =\n                                x_233192;\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_212085\n}\n__kernel void mainzisegred_large_212167(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_233265_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233263_backing_aligned_1,\n                                        int64_t n_p_203574, int64_t q_s_203575,\n                  ",
                   "                      int64_t partition_sizze_203667,\n                                        int64_t defunc_0_f_res_203721,\n                                        int64_t s_n_m_203726,\n                                        int64_t num_groups_212160,\n                                        int64_t groups_per_segment_233249,\n                                        int64_t elements_per_thread_233250,\n                                        int64_t virt_num_groups_233251,\n                                        int64_t threads_per_segment_233253,\n                                        __global unsigned char *ext_mem_229372,\n                                        __global unsigned char *ext_mem_229373,\n                                        __global unsigned char *ext_mem_229470,\n                                        __global unsigned char *ext_mem_229471,\n                                        __global unsigned char *mem_229634,\n                                        __global unsigned char *mem_229639,\n                                        __global unsigned char *mem_229811,\n                                        __global unsigned char *mem_229816,\n                                        __global unsigned char *mem_229822,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233254,\n                                        __global\n                                        unsigned char *mainzicounter_mem_233256)\n{\n    #define segred_group_sizze_212159 (mainzisegred_group_sizze_211164)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict sync_arr_mem_233265_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_233265_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_233263_backing_0 =\n                       ",
                   "            (__local volatile\n                                    unsigned char *) red_arr_mem_233263_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233258;\n    int32_t local_tid_233259;\n    int64_t group_sizze_233262;\n    int32_t wave_sizze_233261;\n    int32_t group_tid_233260;\n    \n    global_tid_233258 = get_global_id(0);\n    local_tid_233259 = get_local_id(0);\n    group_sizze_233262 = get_local_size(0);\n    wave_sizze_233261 = LOCKSTEP_WIDTH;\n    group_tid_233260 = get_group_id(0);\n    \n    int32_t phys_tid_212167 = global_tid_233258;\n    __local unsigned char *red_arr_mem_233263;\n    \n    red_arr_mem_233263 = (__local unsigned char *) red_arr_mem_233263_backing_0;\n    \n    __local unsigned char *sync_arr_mem_233265;\n    \n    sync_arr_mem_233265 = (__local\n                           unsigned char *) sync_arr_mem_233265_backing_1;\n    \n    int32_t phys_group_id_233267;\n    \n    phys_group_id_233267 = get_group_id(0);\n    for (int32_t i_233268 = 0; i_233268 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_233251) - phys_group_id_233267,\n                   sext_i64_i32(num_groups_212160)); i_233268++) {\n        int32_t virt_group_id_233269 = phys_group_id_233267 + i_233268 *\n                sext_i64_i32(num_groups_212160);\n        int32_t flat_segment_id_233270 = squot32(virt_group_id_233269,\n                                                 sext_i64_i32(groups_per_segment_233249));\n        int64_t global_tid_233271 = srem64(sext_i32_i64(virt_group_id_233269) *\n                                           segred_group_sizze_212159 +\n                                           sext_i32_i64(local_tid_233259),\n                                           segred_group_sizze_212159 *\n                                           groups_per_segment_233249);\n        int64_t slice_233272 = s_n_m_203726;\n        int64_t slice_233273 = n_p_203574 * slice_233272;\n        int64_t slice_233274 = partition_sizze_203667 * slice_233273;\n ",
                   "       int64_t gtid_212163 = squot64(sext_i32_i64(flat_segment_id_233270),\n                                      slice_233273);\n        int64_t remnant_233275 = sext_i32_i64(flat_segment_id_233270) -\n                gtid_212163 * slice_233273;\n        int64_t gtid_212164 = squot64(remnant_233275, slice_233272);\n        int64_t remnant_233276 = remnant_233275 - gtid_212164 * slice_233272;\n        int64_t gtid_212165 = remnant_233276;\n        int64_t remnant_233277 = remnant_233276 - gtid_212165;\n        int64_t gtid_212166;\n        double x_acc_233278;\n        int64_t chunk_sizze_233279 = smin64(elements_per_thread_233250,\n                                            sdiv_up64(q_s_203575 -\n                                                      global_tid_233271,\n                                                      threads_per_segment_233253));\n        double x_212168;\n        double x_212169;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_233278 = 0.0;\n        }\n        for (int64_t i_233283 = 0; i_233283 < chunk_sizze_233279; i_233283++) {\n            gtid_212166 = global_tid_233271 + threads_per_segment_233253 *\n                i_233283;\n            // apply map function\n            {\n                int64_t x_212182;\n                \n                x_212182 = ((__global int64_t *) ext_mem_229372)[gtid_212163 *\n                                                                 n_p_203574 +\n                                                                 gtid_212164];\n                \n                int64_t x_212187;\n                \n                x_212187 = ((__global int64_t *) ext_mem_229471)[gtid_212163 *\n                                                                 (s_n_m_203726 *\n                                                                  n_p_203574) +\n                                                                 gtid_212164 *\n                                                                 s_n_m_203726 +\n     ",
                   "                                                            gtid_212165];\n                \n                double x_212188;\n                \n                x_212188 = ((__global double *) ext_mem_229470)[gtid_212163 *\n                                                                (s_n_m_203726 *\n                                                                 n_p_203574) +\n                                                                gtid_212164 *\n                                                                s_n_m_203726 +\n                                                                gtid_212165];\n                \n                double a0_212189;\n                \n                a0_212189 = ((__global double *) mem_229811)[gtid_212163 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_212164 *\n                                                             s_n_m_203726 +\n                                                             gtid_212165];\n                \n                int64_t defunc_0_m_fun_res_212190;\n                \n                defunc_0_m_fun_res_212190 = ((__global\n                                              int64_t *) mem_229816)[gtid_212163 *\n                                                                     (s_n_m_203726 *\n                                                                      n_p_203574) +\n                                                                     gtid_212164 *\n                                                                     s_n_m_203726 +\n                                                                     gtid_212165];\n                \n                bool cond_212192 = sle64(x_212182, gtid_212166);\n                int64_t defunc_0_f_res_212193;\n                \n                if (cond_212192) {\n                    defunc_0_f_res_212193 ",
                   "= (int64_t) 0;\n                } else {\n                    int64_t i_212194 = add64(gtid_212166, x_212187);\n                    int64_t defunc_0_add_arg_212195;\n                    \n                    defunc_0_add_arg_212195 = ((__global\n                                                int64_t *) ext_mem_229373)[gtid_212163 *\n                                                                           (defunc_0_f_res_203721 *\n                                                                            n_p_203574) +\n                                                                           gtid_212164 *\n                                                                           defunc_0_f_res_203721 +\n                                                                           i_212194];\n                    \n                    int64_t defunc_1_add_res_212196 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_212195);\n                    \n                    defunc_0_f_res_212193 = defunc_1_add_res_212196;\n                }\n                \n                double defunc_0_f_res_212197;\n                \n                if (cond_212192) {\n                    defunc_0_f_res_212197 = 0.0;\n                } else {\n                    int64_t i_212198 = add64(gtid_212166, x_212187);\n                    double defunc_0_add_arg_212199;\n                    \n                    defunc_0_add_arg_212199 = ((__global\n                                                double *) mem_229639)[gtid_212163 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_212164 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_212198];\n        ",
                   "            defunc_0_f_res_212197 = defunc_0_add_arg_212199;\n                }\n                \n                int64_t binop_p_212200 = sub64(defunc_0_f_res_212193,\n                                               defunc_0_m_fun_res_212190);\n                double defunc_0_f_res_212201 = sitofp_i64_f64(binop_p_212200);\n                double abs_res_212202 = fabs(defunc_0_f_res_212201);\n                double tmp1_212203 = abs_res_212202 / x_212188;\n                double x_212204 = tmp1_212203 * tmp1_212203;\n                double y_212205 = tmp1_212203 * x_212204;\n                double tmp2_212206 = 1.0 - y_212205;\n                double x_212207 = tmp2_212206 * tmp2_212206;\n                double tmp3_212208 = tmp2_212206 * x_212207;\n                double tmp4_212209 = defunc_0_f_res_212197 * tmp3_212208;\n                double defunc_0_f_res_212210;\n                \n                if (cond_212192) {\n                    defunc_0_f_res_212210 = 0.0;\n                } else {\n                    int64_t i_212211 = add64(gtid_212166, x_212187);\n                    double defunc_0_add_arg_212212;\n                    \n                    defunc_0_add_arg_212212 = ((__global\n                                                double *) mem_229634)[gtid_212163 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_212164 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_212211];\n                    defunc_0_f_res_212210 = defunc_0_add_arg_212212;\n                }\n                \n                double x_212213 = a0_212189 * tmp4_212209;\n                double defunc_9_fit_fun_res_212214 = defunc_0_f_res_212210 *\n                       x_212213;\n            ",
                   "    \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_212168 = x_acc_233278;\n                }\n                // load new values\n                {\n                    x_212169 = defunc_9_fit_fun_res_212214;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_212170 = x_212168 + x_212169;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_233278 = defunc_1_op_res_212170;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_212168 = x_acc_233278;\n            ((__local\n              double *) red_arr_mem_233263)[sext_i32_i64(local_tid_233259)] =\n                x_212168;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_233284;\n        int32_t skip_waves_233285 = 1;\n        double x_233280;\n        double x_233281;\n        \n        offset_233284 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_233259,\n                      sext_i64_i32(segred_group_sizze_212159))) {\n                x_233280 = ((__local\n                             double *) red_arr_mem_233263)[sext_i32_i64(local_tid_233259 +\n                                                           offset_233284)];\n            }\n        }\n        offset_233284 = 1;\n        while (slt32(offset_233284, wave_sizze_233261)) {\n            if (slt32(local_tid_233259 + offset_233284,\n                      sext_i64_i32(segred_group_sizze_212159)) &&\n                ((local_tid_233259 - squot32(local_tid_233259,\n                                             wave_sizze_233261) *\n                  wave_sizze_233261) & (2 * offset_233284 - 1)) == 0) {\n                // read array element\n                {\n                 ",
                   "   x_233281 = ((volatile __local\n                                 double *) red_arr_mem_233263)[sext_i32_i64(local_tid_233259 +\n                                                               offset_233284)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233282 = x_233280 + x_233281;\n                    \n                    x_233280 = defunc_1_op_res_233282;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233263)[sext_i32_i64(local_tid_233259)] =\n                        x_233280;\n                }\n            }\n            offset_233284 *= 2;\n        }\n        while (slt32(skip_waves_233285,\n                     squot32(sext_i64_i32(segred_group_sizze_212159) +\n                             wave_sizze_233261 - 1, wave_sizze_233261))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_233284 = skip_waves_233285 * wave_sizze_233261;\n            if (slt32(local_tid_233259 + offset_233284,\n                      sext_i64_i32(segred_group_sizze_212159)) &&\n                ((local_tid_233259 - squot32(local_tid_233259,\n                                             wave_sizze_233261) *\n                  wave_sizze_233261) == 0 && (squot32(local_tid_233259,\n                                                      wave_sizze_233261) & (2 *\n                                                                            skip_waves_233285 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_233281 = ((__local\n                                 double *) red_arr_mem_233263)[sext_i32_i64(local_tid_233259 +\n                                                               offset_233284)];\n                }\n                // apply reduction operation\n             ",
                   "   {\n                    double defunc_1_op_res_233282 = x_233280 + x_233281;\n                    \n                    x_233280 = defunc_1_op_res_233282;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_233263)[sext_i32_i64(local_tid_233259)] =\n                        x_233280;\n                }\n            }\n            skip_waves_233285 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_233259) == (int64_t) 0) {\n                x_acc_233278 = x_233280;\n            }\n        }\n        if (groups_per_segment_233249 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_233259 == 0) {\n                    ((__global double *) mem_229822)[gtid_212163 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_212164 *\n                                                     s_n_m_203726 +\n                                                     gtid_212165] =\n                        x_acc_233278;\n                }\n            }\n        } else {\n            int32_t old_counter_233286;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_233259 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_233254)[sext_i32_i64(virt_group_id_233269)] =\n                        x_acc_233278;\n                    mem_fence_global();\n                    old_counter_233286 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233256)[sext_i32_i64(srem32(flat_segment_id_233270,\n       ",
                   "                                                                                               10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_233265)[(int64_t) 0] =\n                        old_counter_233286 == groups_per_segment_233249 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_233287;\n            \n            is_last_group_233287 = ((__local\n                                     bool *) sync_arr_mem_233265)[(int64_t) 0];\n            if (is_last_group_233287) {\n                if (local_tid_233259 == 0) {\n                    old_counter_233286 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233256)[sext_i32_i64(srem32(flat_segment_id_233270,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_233249));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_233288 =\n                            sdiv_up64(groups_per_segment_233249,\n                                      segred_group_sizze_212159);\n                    \n                    x_212168 = 0.0;\n                    for (int64_t i_233289 = 0; i_233289 <\n                         read_per_thread_233288; i_233289++) {\n                        int64_t group_res_id_233290 =\n                                sext_i32_i64(local_tid_233259) *\n                                read_per_thread_233288 + i_233289;\n                        int64_t index_of_group_res_233291 =\n                                sext_i32_i64(flat_segment_id_233270) *\n                       ",
                   "         groups_per_segment_233249 + group_res_id_233290;\n                        \n                        if (slt64(group_res_id_233290,\n                                  groups_per_segment_233249)) {\n                            x_212169 = ((__global\n                                         double *) segred_tmp_mem_233254)[index_of_group_res_233291];\n                            \n                            double defunc_1_op_res_212170 = x_212168 + x_212169;\n                            \n                            x_212168 = defunc_1_op_res_212170;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_233263)[sext_i32_i64(local_tid_233259)] =\n                    x_212168;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_233292;\n                    int32_t skip_waves_233293 = 1;\n                    double x_233280;\n                    double x_233281;\n                    \n                    offset_233292 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_233259,\n                                  sext_i64_i32(segred_group_sizze_212159))) {\n                            x_233280 = ((__local\n                                         double *) red_arr_mem_233263)[sext_i32_i64(local_tid_233259 +\n                                                                       offset_233292)];\n                        }\n                    }\n                    offset_233292 = 1;\n                    while (slt32(offset_233292, wave_sizze_233261)) {\n                        if (slt32(local_tid_233259 + offset_233292,\n                                  sext_i64_i32(segred_group_sizze_212159)) &&\n                            ((local_tid_233259 - squot32(local_tid_233259,\n                                                         wav",
                   "e_sizze_233261) *\n                              wave_sizze_233261) & (2 * offset_233292 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_233281 = ((volatile __local\n                                             double *) red_arr_mem_233263)[sext_i32_i64(local_tid_233259 +\n                                                                           offset_233292)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233282 = x_233280 +\n                                       x_233281;\n                                \n                                x_233280 = defunc_1_op_res_233282;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233263)[sext_i32_i64(local_tid_233259)] =\n                                    x_233280;\n                            }\n                        }\n                        offset_233292 *= 2;\n                    }\n                    while (slt32(skip_waves_233293,\n                                 squot32(sext_i64_i32(segred_group_sizze_212159) +\n                                         wave_sizze_233261 - 1,\n                                         wave_sizze_233261))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_233292 = skip_waves_233293 * wave_sizze_233261;\n                        if (slt32(local_tid_233259 + offset_233292,\n                                  sext_i64_i32(segred_group_sizze_212159)) &&\n                            ((local_tid_233259 - squot32(local_tid_233259,\n                                                         wave_sizze_233261) *\n                              wave_sizze_233261) == 0 &&\n  ",
                   "                           (squot32(local_tid_233259, wave_sizze_233261) &\n                              (2 * skip_waves_233293 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_233281 = ((__local\n                                             double *) red_arr_mem_233263)[sext_i32_i64(local_tid_233259 +\n                                                                           offset_233292)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233282 = x_233280 +\n                                       x_233281;\n                                \n                                x_233280 = defunc_1_op_res_233282;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_233263)[sext_i32_i64(local_tid_233259)] =\n                                    x_233280;\n                            }\n                        }\n                        skip_waves_233293 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_233259 == 0) {\n                            ((__global double *) mem_229822)[gtid_212163 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_212164 *\n                                                             s_n_m_203726 +\n                                                             gtid_212165] =\n                                x_233280;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_ME",
                   "M_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_212159\n}\n__kernel void mainzisegred_large_214227(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_233530_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233528_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233526_backing_aligned_2,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233524_backing_aligned_3,\n                                        int64_t n_p_203574, int64_t q_s_203575,\n                                        int64_t partition_sizze_203667,\n                                        int64_t defunc_0_f_res_203721,\n                                        int64_t s_n_m_203726,\n                                        int64_t num_groups_214218,\n                                        int64_t groups_per_segment_233506,\n                                        int64_t elements_per_thread_233507,\n                                        int64_t virt_num_groups_233508,\n                                        int64_t threads_per_segment_233510,\n                                        __global unsigned char *ext_mem_229372,\n                                        __global unsigned char *ext_mem_229373,\n                                        __global unsigned char *ext_mem_229470,\n                                        __global unsigned char *ext_mem_229471,\n                                        __global unsigned char *mem_229639,\n                                        __global unsigned char *mem_230081,\n                                        __global unsigned char *mem_230091,\n                                        __global ",
                   "unsigned char *mem_230096,\n                                        __global unsigned char *mem_230101,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233511,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233513,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233515,\n                                        __global\n                                        unsigned char *mainzicounter_mem_233517)\n{\n    #define segred_group_sizze_214217 (mainzisegred_group_sizze_213183)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict sync_arr_mem_233530_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_233530_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_233528_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233528_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_233526_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233526_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_233524_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233524_backing_aligned_3;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233519;\n    int32_t local_tid_233520;\n    int64_t group_sizze_233523;\n    int32_t wave_sizze_233522;\n    int32_t group_tid_233521;\n    \n    global_tid_233519 = get_global_id(0);\n    local_tid_233520 = get_local_id(0);\n    group_sizze_233523 = get_local_siz",
                   "e(0);\n    wave_sizze_233522 = LOCKSTEP_WIDTH;\n    group_tid_233521 = get_group_id(0);\n    \n    int32_t phys_tid_214227 = global_tid_233519;\n    __local unsigned char *red_arr_mem_233524;\n    \n    red_arr_mem_233524 = (__local unsigned char *) red_arr_mem_233524_backing_0;\n    \n    __local unsigned char *red_arr_mem_233526;\n    \n    red_arr_mem_233526 = (__local unsigned char *) red_arr_mem_233526_backing_1;\n    \n    __local unsigned char *red_arr_mem_233528;\n    \n    red_arr_mem_233528 = (__local unsigned char *) red_arr_mem_233528_backing_2;\n    \n    __local unsigned char *sync_arr_mem_233530;\n    \n    sync_arr_mem_233530 = (__local\n                           unsigned char *) sync_arr_mem_233530_backing_3;\n    \n    int32_t phys_group_id_233532;\n    \n    phys_group_id_233532 = get_group_id(0);\n    for (int32_t i_233533 = 0; i_233533 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_233508) - phys_group_id_233532,\n                   sext_i64_i32(num_groups_214218)); i_233533++) {\n        int32_t virt_group_id_233534 = phys_group_id_233532 + i_233533 *\n                sext_i64_i32(num_groups_214218);\n        int32_t flat_segment_id_233535 = squot32(virt_group_id_233534,\n                                                 sext_i64_i32(groups_per_segment_233506));\n        int64_t global_tid_233536 = srem64(sext_i32_i64(virt_group_id_233534) *\n                                           segred_group_sizze_214217 +\n                                           sext_i32_i64(local_tid_233520),\n                                           segred_group_sizze_214217 *\n                                           groups_per_segment_233506);\n        int64_t slice_233537 = s_n_m_203726;\n        int64_t slice_233538 = n_p_203574 * slice_233537;\n        int64_t slice_233539 = partition_sizze_203667 * slice_233538;\n        int64_t gtid_214223 = squot64(sext_i32_i64(flat_segment_id_233535),\n                                      slice_233538);\n        int64_t remnant_233540 = sext_i32_i64(flat_s",
                   "egment_id_233535) -\n                gtid_214223 * slice_233538;\n        int64_t gtid_214224 = squot64(remnant_233540, slice_233537);\n        int64_t remnant_233541 = remnant_233540 - gtid_214224 * slice_233537;\n        int64_t gtid_214225 = remnant_233541;\n        int64_t remnant_233542 = remnant_233541 - gtid_214225;\n        int64_t gtid_214226;\n        double x_acc_233543;\n        double x_acc_233544;\n        double x_acc_233545;\n        int64_t chunk_sizze_233546 = smin64(elements_per_thread_233507,\n                                            sdiv_up64(q_s_203575 -\n                                                      global_tid_233536,\n                                                      threads_per_segment_233510));\n        double x_214228;\n        double x_214229;\n        double x_214230;\n        double x_214231;\n        double x_214232;\n        double x_214233;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_233543 = 0.0;\n            x_acc_233544 = 0.0;\n            x_acc_233545 = 0.0;\n        }\n        for (int64_t i_233556 = 0; i_233556 < chunk_sizze_233546; i_233556++) {\n            gtid_214226 = global_tid_233536 + threads_per_segment_233510 *\n                i_233556;\n            // apply map function\n            {\n                int64_t x_214245;\n                \n                x_214245 = ((__global int64_t *) ext_mem_229372)[gtid_214223 *\n                                                                 n_p_203574 +\n                                                                 gtid_214224];\n                \n                int64_t x_214249;\n                \n                x_214249 = ((__global int64_t *) ext_mem_229471)[gtid_214223 *\n                                                                 (s_n_m_203726 *\n                                                                  n_p_203574) +\n                                                                 gtid_214224 *\n                                           ",
                   "                      s_n_m_203726 +\n                                                                 gtid_214225];\n                \n                double x_214250;\n                \n                x_214250 = ((__global double *) ext_mem_229470)[gtid_214223 *\n                                                                (s_n_m_203726 *\n                                                                 n_p_203574) +\n                                                                gtid_214224 *\n                                                                s_n_m_203726 +\n                                                                gtid_214225];\n                \n                int64_t defunc_0_m_fun_res_214251;\n                \n                defunc_0_m_fun_res_214251 = ((__global\n                                              int64_t *) mem_230081)[gtid_214223 *\n                                                                     (s_n_m_203726 *\n                                                                      n_p_203574) +\n                                                                     gtid_214224 *\n                                                                     s_n_m_203726 +\n                                                                     gtid_214225];\n                \n                bool cond_214253 = sle64(x_214245, gtid_214226);\n                int64_t defunc_0_f_res_214254;\n                \n                if (cond_214253) {\n                    defunc_0_f_res_214254 = (int64_t) 0;\n                } else {\n                    int64_t i_214255 = add64(gtid_214226, x_214249);\n                    int64_t defunc_0_add_arg_214256;\n                    \n                    defunc_0_add_arg_214256 = ((__global\n                                                int64_t *) ext_mem_229373)[gtid_214223 *\n                                                                           (defunc_0_f_res_203721 *\n                                                   ",
                   "                         n_p_203574) +\n                                                                           gtid_214224 *\n                                                                           defunc_0_f_res_203721 +\n                                                                           i_214255];\n                    \n                    int64_t defunc_1_add_res_214257 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_214256);\n                    \n                    defunc_0_f_res_214254 = defunc_1_add_res_214257;\n                }\n                \n                double defunc_0_f_res_214258;\n                \n                if (cond_214253) {\n                    defunc_0_f_res_214258 = 0.0;\n                } else {\n                    int64_t i_214259 = add64(gtid_214226, x_214249);\n                    double defunc_0_add_arg_214260;\n                    \n                    defunc_0_add_arg_214260 = ((__global\n                                                double *) mem_229639)[gtid_214223 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_214224 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_214259];\n                    defunc_0_f_res_214258 = defunc_0_add_arg_214260;\n                }\n                \n                int64_t binop_p_214261 = sub64(defunc_0_f_res_214254,\n                                               defunc_0_m_fun_res_214251);\n                double defunc_0_f_res_214262 = sitofp_i64_f64(binop_p_214261);\n                double abs_res_214263 = fabs(defunc_0_f_res_214262);\n                double tmp1_214264 = abs_res_214263 / x_214250;\n                double x_21",
                   "4265 = tmp1_214264 * tmp1_214264;\n                double y_214266 = tmp1_214264 * x_214265;\n                double tmp2_214267 = 1.0 - y_214266;\n                double x_214268 = tmp2_214267 * tmp2_214267;\n                double tmp3_214269 = tmp2_214267 * x_214268;\n                double w_j_214270 = defunc_0_f_res_214258 * tmp3_214269;\n                double xw_j_214271 = defunc_0_f_res_214262 * w_j_214270;\n                double x2w_j_214272 = defunc_0_f_res_214262 * xw_j_214271;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_214228 = x_acc_233543;\n                    x_214229 = x_acc_233544;\n                    x_214230 = x_acc_233545;\n                }\n                // load new values\n                {\n                    x_214231 = w_j_214270;\n                    x_214232 = xw_j_214271;\n                    x_214233 = x2w_j_214272;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_214234 = x_214228 + x_214231;\n                    double defunc_1_op_res_214235 = x_214229 + x_214232;\n                    double defunc_1_op_res_214236 = x_214230 + x_214233;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_233543 = defunc_1_op_res_214234;\n                        x_acc_233544 = defunc_1_op_res_214235;\n                        x_acc_233545 = defunc_1_op_res_214236;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_214228 = x_acc_233543;\n            x_214229 = x_acc_233544;\n            x_214230 = x_acc_233545;\n            ((__local\n              double *) red_arr_mem_233524)[sext_i32_i64(local_tid_233520)] =\n                x_214228;\n            ((__local\n              double *) red_arr_mem_233526)[sext_i32_i64(local_tid",
                   "_233520)] =\n                x_214229;\n            ((__local\n              double *) red_arr_mem_233528)[sext_i32_i64(local_tid_233520)] =\n                x_214230;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_233557;\n        int32_t skip_waves_233558 = 1;\n        double x_233547;\n        double x_233548;\n        double x_233549;\n        double x_233550;\n        double x_233551;\n        double x_233552;\n        \n        offset_233557 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_233520,\n                      sext_i64_i32(segred_group_sizze_214217))) {\n                x_233547 = ((__local\n                             double *) red_arr_mem_233524)[sext_i32_i64(local_tid_233520 +\n                                                           offset_233557)];\n                x_233548 = ((__local\n                             double *) red_arr_mem_233526)[sext_i32_i64(local_tid_233520 +\n                                                           offset_233557)];\n                x_233549 = ((__local\n                             double *) red_arr_mem_233528)[sext_i32_i64(local_tid_233520 +\n                                                           offset_233557)];\n            }\n        }\n        offset_233557 = 1;\n        while (slt32(offset_233557, wave_sizze_233522)) {\n            if (slt32(local_tid_233520 + offset_233557,\n                      sext_i64_i32(segred_group_sizze_214217)) &&\n                ((local_tid_233520 - squot32(local_tid_233520,\n                                             wave_sizze_233522) *\n                  wave_sizze_233522) & (2 * offset_233557 - 1)) == 0) {\n                // read array element\n                {\n                    x_233550 = ((volatile __local\n                                 double *) red_arr_mem_233524)[sext_i32_i64(local_tid_233520 +\n                                                               offset_233557)];\n                    x_23",
                   "3551 = ((volatile __local\n                                 double *) red_arr_mem_233526)[sext_i32_i64(local_tid_233520 +\n                                                               offset_233557)];\n                    x_233552 = ((volatile __local\n                                 double *) red_arr_mem_233528)[sext_i32_i64(local_tid_233520 +\n                                                               offset_233557)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233553 = x_233547 + x_233550;\n                    double defunc_1_op_res_233554 = x_233548 + x_233551;\n                    double defunc_1_op_res_233555 = x_233549 + x_233552;\n                    \n                    x_233547 = defunc_1_op_res_233553;\n                    x_233548 = defunc_1_op_res_233554;\n                    x_233549 = defunc_1_op_res_233555;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233524)[sext_i32_i64(local_tid_233520)] =\n                        x_233547;\n                    ((volatile __local\n                      double *) red_arr_mem_233526)[sext_i32_i64(local_tid_233520)] =\n                        x_233548;\n                    ((volatile __local\n                      double *) red_arr_mem_233528)[sext_i32_i64(local_tid_233520)] =\n                        x_233549;\n                }\n            }\n            offset_233557 *= 2;\n        }\n        while (slt32(skip_waves_233558,\n                     squot32(sext_i64_i32(segred_group_sizze_214217) +\n                             wave_sizze_233522 - 1, wave_sizze_233522))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_233557 = skip_waves_233558 * wave_sizze_233522;\n            if (slt32(local_tid_233520 + offset_233557,\n                      sext_i64_i32(segred_group_sizze_214217)) &&\n                ((local_tid_233520 - sq",
                   "uot32(local_tid_233520,\n                                             wave_sizze_233522) *\n                  wave_sizze_233522) == 0 && (squot32(local_tid_233520,\n                                                      wave_sizze_233522) & (2 *\n                                                                            skip_waves_233558 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_233550 = ((__local\n                                 double *) red_arr_mem_233524)[sext_i32_i64(local_tid_233520 +\n                                                               offset_233557)];\n                    x_233551 = ((__local\n                                 double *) red_arr_mem_233526)[sext_i32_i64(local_tid_233520 +\n                                                               offset_233557)];\n                    x_233552 = ((__local\n                                 double *) red_arr_mem_233528)[sext_i32_i64(local_tid_233520 +\n                                                               offset_233557)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233553 = x_233547 + x_233550;\n                    double defunc_1_op_res_233554 = x_233548 + x_233551;\n                    double defunc_1_op_res_233555 = x_233549 + x_233552;\n                    \n                    x_233547 = defunc_1_op_res_233553;\n                    x_233548 = defunc_1_op_res_233554;\n                    x_233549 = defunc_1_op_res_233555;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_233524)[sext_i32_i64(local_tid_233520)] =\n                        x_233547;\n                    ((__local\n                      double *) red_arr_mem_233526)[sext_i32_i64(local_tid_233520)] =\n                   ",
                   "     x_233548;\n                    ((__local\n                      double *) red_arr_mem_233528)[sext_i32_i64(local_tid_233520)] =\n                        x_233549;\n                }\n            }\n            skip_waves_233558 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_233520) == (int64_t) 0) {\n                x_acc_233543 = x_233547;\n                x_acc_233544 = x_233548;\n                x_acc_233545 = x_233549;\n            }\n        }\n        if (groups_per_segment_233506 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_233520 == 0) {\n                    ((__global double *) mem_230091)[gtid_214223 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_214224 *\n                                                     s_n_m_203726 +\n                                                     gtid_214225] =\n                        x_acc_233543;\n                    ((__global double *) mem_230096)[gtid_214223 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_214224 *\n                                                     s_n_m_203726 +\n                                                     gtid_214225] =\n                        x_acc_233544;\n                    ((__global double *) mem_230101)[gtid_214223 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_214224 *\n                                                     s_n_m_203726 +\n                               ",
                   "                      gtid_214225] =\n                        x_acc_233545;\n                }\n            }\n        } else {\n            int32_t old_counter_233559;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_233520 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_233511)[sext_i32_i64(virt_group_id_233534)] =\n                        x_acc_233543;\n                    ((__global\n                      double *) segred_tmp_mem_233513)[sext_i32_i64(virt_group_id_233534)] =\n                        x_acc_233544;\n                    ((__global\n                      double *) segred_tmp_mem_233515)[sext_i32_i64(virt_group_id_233534)] =\n                        x_acc_233545;\n                    mem_fence_global();\n                    old_counter_233559 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233517)[sext_i32_i64(srem32(flat_segment_id_233535,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_233530)[(int64_t) 0] =\n                        old_counter_233559 == groups_per_segment_233506 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_233560;\n            \n            is_last_group_233560 = ((__local\n                                     bool *) sync_arr_mem_233530)[(int64_t) 0];\n            if (is_last_group_233560) {\n                if (local_tid_233520 == 0) {\n                    old_counter_233559 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233517)[sext_i32_i64(sre",
                   "m32(flat_segment_id_233535,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_233506));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_233561 =\n                            sdiv_up64(groups_per_segment_233506,\n                                      segred_group_sizze_214217);\n                    \n                    x_214228 = 0.0;\n                    x_214229 = 0.0;\n                    x_214230 = 0.0;\n                    for (int64_t i_233562 = 0; i_233562 <\n                         read_per_thread_233561; i_233562++) {\n                        int64_t group_res_id_233563 =\n                                sext_i32_i64(local_tid_233520) *\n                                read_per_thread_233561 + i_233562;\n                        int64_t index_of_group_res_233564 =\n                                sext_i32_i64(flat_segment_id_233535) *\n                                groups_per_segment_233506 + group_res_id_233563;\n                        \n                        if (slt64(group_res_id_233563,\n                                  groups_per_segment_233506)) {\n                            x_214231 = ((__global\n                                         double *) segred_tmp_mem_233511)[index_of_group_res_233564];\n                            x_214232 = ((__global\n                                         double *) segred_tmp_mem_233513)[index_of_group_res_233564];\n                            x_214233 = ((__global\n                                         double *) segred_tmp_mem_233515)[index_of_group_res_233564];\n                            \n                            double defunc_1_op_res_214234 = x_214228 + x_214231;\n                            double defunc_1_op_res_214235 = x_214229 + x_214232;\n   ",
                   "                         double defunc_1_op_res_214236 = x_214230 + x_214233;\n                            \n                            x_214228 = defunc_1_op_res_214234;\n                            x_214229 = defunc_1_op_res_214235;\n                            x_214230 = defunc_1_op_res_214236;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_233524)[sext_i32_i64(local_tid_233520)] =\n                    x_214228;\n                ((__local\n                  double *) red_arr_mem_233526)[sext_i32_i64(local_tid_233520)] =\n                    x_214229;\n                ((__local\n                  double *) red_arr_mem_233528)[sext_i32_i64(local_tid_233520)] =\n                    x_214230;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_233565;\n                    int32_t skip_waves_233566 = 1;\n                    double x_233547;\n                    double x_233548;\n                    double x_233549;\n                    double x_233550;\n                    double x_233551;\n                    double x_233552;\n                    \n                    offset_233565 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_233520,\n                                  sext_i64_i32(segred_group_sizze_214217))) {\n                            x_233547 = ((__local\n                                         double *) red_arr_mem_233524)[sext_i32_i64(local_tid_233520 +\n                                                                       offset_233565)];\n                            x_233548 = ((__local\n                                         double *) red_arr_mem_233526)[sext_i32_i64(local_tid_233520 +\n                                                                       offset_233565)];\n                            x_2335",
                   "49 = ((__local\n                                         double *) red_arr_mem_233528)[sext_i32_i64(local_tid_233520 +\n                                                                       offset_233565)];\n                        }\n                    }\n                    offset_233565 = 1;\n                    while (slt32(offset_233565, wave_sizze_233522)) {\n                        if (slt32(local_tid_233520 + offset_233565,\n                                  sext_i64_i32(segred_group_sizze_214217)) &&\n                            ((local_tid_233520 - squot32(local_tid_233520,\n                                                         wave_sizze_233522) *\n                              wave_sizze_233522) & (2 * offset_233565 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_233550 = ((volatile __local\n                                             double *) red_arr_mem_233524)[sext_i32_i64(local_tid_233520 +\n                                                                           offset_233565)];\n                                x_233551 = ((volatile __local\n                                             double *) red_arr_mem_233526)[sext_i32_i64(local_tid_233520 +\n                                                                           offset_233565)];\n                                x_233552 = ((volatile __local\n                                             double *) red_arr_mem_233528)[sext_i32_i64(local_tid_233520 +\n                                                                           offset_233565)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233553 = x_233547 +\n                                       x_233550;\n                                double defunc_1_op_res_233554 = x_233548 +\n                                       x_233551",
                   ";\n                                double defunc_1_op_res_233555 = x_233549 +\n                                       x_233552;\n                                \n                                x_233547 = defunc_1_op_res_233553;\n                                x_233548 = defunc_1_op_res_233554;\n                                x_233549 = defunc_1_op_res_233555;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233524)[sext_i32_i64(local_tid_233520)] =\n                                    x_233547;\n                                ((volatile __local\n                                  double *) red_arr_mem_233526)[sext_i32_i64(local_tid_233520)] =\n                                    x_233548;\n                                ((volatile __local\n                                  double *) red_arr_mem_233528)[sext_i32_i64(local_tid_233520)] =\n                                    x_233549;\n                            }\n                        }\n                        offset_233565 *= 2;\n                    }\n                    while (slt32(skip_waves_233566,\n                                 squot32(sext_i64_i32(segred_group_sizze_214217) +\n                                         wave_sizze_233522 - 1,\n                                         wave_sizze_233522))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_233565 = skip_waves_233566 * wave_sizze_233522;\n                        if (slt32(local_tid_233520 + offset_233565,\n                                  sext_i64_i32(segred_group_sizze_214217)) &&\n                            ((local_tid_233520 - squot32(local_tid_233520,\n                                                         wave_sizze_233522) *\n                              wave_sizze_233522) == 0 &&\n                             (squot32(local_tid_233520, wave_siz",
                   "ze_233522) &\n                              (2 * skip_waves_233566 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_233550 = ((__local\n                                             double *) red_arr_mem_233524)[sext_i32_i64(local_tid_233520 +\n                                                                           offset_233565)];\n                                x_233551 = ((__local\n                                             double *) red_arr_mem_233526)[sext_i32_i64(local_tid_233520 +\n                                                                           offset_233565)];\n                                x_233552 = ((__local\n                                             double *) red_arr_mem_233528)[sext_i32_i64(local_tid_233520 +\n                                                                           offset_233565)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233553 = x_233547 +\n                                       x_233550;\n                                double defunc_1_op_res_233554 = x_233548 +\n                                       x_233551;\n                                double defunc_1_op_res_233555 = x_233549 +\n                                       x_233552;\n                                \n                                x_233547 = defunc_1_op_res_233553;\n                                x_233548 = defunc_1_op_res_233554;\n                                x_233549 = defunc_1_op_res_233555;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_233524)[sext_i32_i64(local_tid_233520)] =\n                                    x_233547;\n                                ((__local\n               ",
                   "                   double *) red_arr_mem_233526)[sext_i32_i64(local_tid_233520)] =\n                                    x_233548;\n                                ((__local\n                                  double *) red_arr_mem_233528)[sext_i32_i64(local_tid_233520)] =\n                                    x_233549;\n                            }\n                        }\n                        skip_waves_233566 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_233520 == 0) {\n                            ((__global double *) mem_230091)[gtid_214223 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_214224 *\n                                                             s_n_m_203726 +\n                                                             gtid_214225] =\n                                x_233547;\n                            ((__global double *) mem_230096)[gtid_214223 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_214224 *\n                                                             s_n_m_203726 +\n                                                             gtid_214225] =\n                                x_233548;\n                            ((__global double *) mem_230101)[gtid_214223 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_214224 *\n                                                             s_n_m_203726 +\n                                               ",
                   "              gtid_214225] =\n                                x_233549;\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_214217\n}\n__kernel void mainzisegred_large_214321(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_233636_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233634_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233632_backing_aligned_2,\n                                        int64_t n_p_203574, int64_t q_s_203575,\n                                        int64_t partition_sizze_203667,\n                                        int64_t defunc_0_f_res_203721,\n                                        int64_t s_n_m_203726,\n                                        int64_t num_groups_214313,\n                                        int64_t groups_per_segment_233616,\n                                        int64_t elements_per_thread_233617,\n                                        int64_t virt_num_groups_233618,\n                                        int64_t threads_per_segment_233620,\n                                        __global unsigned char *ext_mem_229372,\n                                        __global unsigned char *ext_mem_229373,\n                                        __global unsigned char *ext_mem_229470,\n                                        __global unsigned char *ext_mem_229471,\n                                        __global unsigned char *mem_229634,\n                                        __global unsigned char *mem_229639,\n                                        __global unsigned char *mem_230107,\n   ",
                   "                                     __global unsigned char *mem_230112,\n                                        __global unsigned char *mem_230117,\n                                        __global unsigned char *mem_230122,\n                                        __global unsigned char *mem_230128,\n                                        __global unsigned char *mem_230133,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233621,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233623,\n                                        __global\n                                        unsigned char *mainzicounter_mem_233625)\n{\n    #define segred_group_sizze_214312 (mainzisegred_group_sizze_213050)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict sync_arr_mem_233636_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_233636_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_233634_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233634_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_233632_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233632_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233627;\n    int32_t local_tid_233628;\n    int64_t group_sizze_233631;\n    int32_t wave_sizze_233630;\n    int32_t group_tid_233629;\n    \n    global_tid_233627 = get_global_id(0);\n    local_tid_233628 = get_local_id(0);\n    group_sizze_233631 = get_local_size(0);\n    wave_sizze_233630 = LOCKSTEP_WIDTH;\n    group_tid_233629 = get_",
                   "group_id(0);\n    \n    int32_t phys_tid_214321 = global_tid_233627;\n    __local unsigned char *red_arr_mem_233632;\n    \n    red_arr_mem_233632 = (__local unsigned char *) red_arr_mem_233632_backing_0;\n    \n    __local unsigned char *red_arr_mem_233634;\n    \n    red_arr_mem_233634 = (__local unsigned char *) red_arr_mem_233634_backing_1;\n    \n    __local unsigned char *sync_arr_mem_233636;\n    \n    sync_arr_mem_233636 = (__local\n                           unsigned char *) sync_arr_mem_233636_backing_2;\n    \n    int32_t phys_group_id_233638;\n    \n    phys_group_id_233638 = get_group_id(0);\n    for (int32_t i_233639 = 0; i_233639 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_233618) - phys_group_id_233638,\n                   sext_i64_i32(num_groups_214313)); i_233639++) {\n        int32_t virt_group_id_233640 = phys_group_id_233638 + i_233639 *\n                sext_i64_i32(num_groups_214313);\n        int32_t flat_segment_id_233641 = squot32(virt_group_id_233640,\n                                                 sext_i64_i32(groups_per_segment_233616));\n        int64_t global_tid_233642 = srem64(sext_i32_i64(virt_group_id_233640) *\n                                           segred_group_sizze_214312 +\n                                           sext_i32_i64(local_tid_233628),\n                                           segred_group_sizze_214312 *\n                                           groups_per_segment_233616);\n        int64_t slice_233643 = s_n_m_203726;\n        int64_t slice_233644 = n_p_203574 * slice_233643;\n        int64_t slice_233645 = partition_sizze_203667 * slice_233644;\n        int64_t gtid_214317 = squot64(sext_i32_i64(flat_segment_id_233641),\n                                      slice_233644);\n        int64_t remnant_233646 = sext_i32_i64(flat_segment_id_233641) -\n                gtid_214317 * slice_233644;\n        int64_t gtid_214318 = squot64(remnant_233646, slice_233643);\n        int64_t remnant_233647 = remnant_233646 - gtid_214318 * slice_233643;\n",
                   "        int64_t gtid_214319 = remnant_233647;\n        int64_t remnant_233648 = remnant_233647 - gtid_214319;\n        int64_t gtid_214320;\n        double x_acc_233649;\n        double x_acc_233650;\n        int64_t chunk_sizze_233651 = smin64(elements_per_thread_233617,\n                                            sdiv_up64(q_s_203575 -\n                                                      global_tid_233642,\n                                                      threads_per_segment_233620));\n        double x_214322;\n        double x_214323;\n        double x_214324;\n        double x_214325;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_233649 = 0.0;\n            x_acc_233650 = 0.0;\n        }\n        for (int64_t i_233658 = 0; i_233658 < chunk_sizze_233651; i_233658++) {\n            gtid_214320 = global_tid_233642 + threads_per_segment_233620 *\n                i_233658;\n            // apply map function\n            {\n                int64_t x_214341;\n                \n                x_214341 = ((__global int64_t *) ext_mem_229372)[gtid_214317 *\n                                                                 n_p_203574 +\n                                                                 gtid_214318];\n                \n                int64_t x_214348;\n                \n                x_214348 = ((__global int64_t *) ext_mem_229471)[gtid_214317 *\n                                                                 (s_n_m_203726 *\n                                                                  n_p_203574) +\n                                                                 gtid_214318 *\n                                                                 s_n_m_203726 +\n                                                                 gtid_214319];\n                \n                double x_214349;\n                \n                x_214349 = ((__global double *) ext_mem_229470)[gtid_214317 *\n                                                             ",
                   "   (s_n_m_203726 *\n                                                                 n_p_203574) +\n                                                                gtid_214318 *\n                                                                s_n_m_203726 +\n                                                                gtid_214319];\n                \n                double a11_214350;\n                \n                a11_214350 = ((__global double *) mem_230107)[gtid_214317 *\n                                                              (s_n_m_203726 *\n                                                               n_p_203574) +\n                                                              gtid_214318 *\n                                                              s_n_m_203726 +\n                                                              gtid_214319];\n                \n                double b11_214351;\n                \n                b11_214351 = ((__global double *) mem_230112)[gtid_214317 *\n                                                              (s_n_m_203726 *\n                                                               n_p_203574) +\n                                                              gtid_214318 *\n                                                              s_n_m_203726 +\n                                                              gtid_214319];\n                \n                double c11_214352;\n                \n                c11_214352 = ((__global double *) mem_230117)[gtid_214317 *\n                                                              (s_n_m_203726 *\n                                                               n_p_203574) +\n                                                              gtid_214318 *\n                                                              s_n_m_203726 +\n                                                              gtid_214319];\n                \n                int64_t defunc_0_m_fun_res_214353;\n            ",
                   "    \n                defunc_0_m_fun_res_214353 = ((__global\n                                              int64_t *) mem_230122)[gtid_214317 *\n                                                                     (s_n_m_203726 *\n                                                                      n_p_203574) +\n                                                                     gtid_214318 *\n                                                                     s_n_m_203726 +\n                                                                     gtid_214319];\n                \n                bool cond_214355 = sle64(x_214341, gtid_214320);\n                int64_t defunc_0_f_res_214356;\n                \n                if (cond_214355) {\n                    defunc_0_f_res_214356 = (int64_t) 0;\n                } else {\n                    int64_t i_214357 = add64(gtid_214320, x_214348);\n                    int64_t defunc_0_add_arg_214358;\n                    \n                    defunc_0_add_arg_214358 = ((__global\n                                                int64_t *) ext_mem_229373)[gtid_214317 *\n                                                                           (defunc_0_f_res_203721 *\n                                                                            n_p_203574) +\n                                                                           gtid_214318 *\n                                                                           defunc_0_f_res_203721 +\n                                                                           i_214357];\n                    \n                    int64_t defunc_1_add_res_214359 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_214358);\n                    \n                    defunc_0_f_res_214356 = defunc_1_add_res_214359;\n                }\n                \n                double defunc_0_f_res_214360;\n                \n                if (cond_214355) {\n                   ",
                   " defunc_0_f_res_214360 = 0.0;\n                } else {\n                    int64_t i_214361 = add64(gtid_214320, x_214348);\n                    double defunc_0_add_arg_214362;\n                    \n                    defunc_0_add_arg_214362 = ((__global\n                                                double *) mem_229639)[gtid_214317 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_214318 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_214361];\n                    defunc_0_f_res_214360 = defunc_0_add_arg_214362;\n                }\n                \n                int64_t binop_p_214363 = sub64(defunc_0_f_res_214356,\n                                               defunc_0_m_fun_res_214353);\n                double defunc_0_f_res_214364 = sitofp_i64_f64(binop_p_214363);\n                double abs_res_214365 = fabs(defunc_0_f_res_214364);\n                double tmp1_214366 = abs_res_214365 / x_214349;\n                double x_214367 = tmp1_214366 * tmp1_214366;\n                double y_214368 = tmp1_214366 * x_214367;\n                double tmp2_214369 = 1.0 - y_214368;\n                double x_214370 = tmp2_214369 * tmp2_214369;\n                double tmp3_214371 = tmp2_214369 * x_214370;\n                double tmp4_214372 = defunc_0_f_res_214360 * tmp3_214371;\n                double defunc_1_f_res_214373 = defunc_0_f_res_214364 *\n                       tmp4_214372;\n                double defunc_0_f_res_214374;\n                \n                if (cond_214355) {\n                    defunc_0_f_res_214374 = 0.0;\n                } else {\n                    int64_t i_214375 = add64(gtid_214320, x_214348);\n                    double defunc_0_add_arg_21",
                   "4376;\n                    \n                    defunc_0_add_arg_214376 = ((__global\n                                                double *) mem_229634)[gtid_214317 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_214318 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_214375];\n                    defunc_0_f_res_214374 = defunc_0_add_arg_214376;\n                }\n                \n                double x_214377 = a11_214350 * tmp4_214372;\n                double y_214378 = b11_214351 * defunc_1_f_res_214373;\n                double x_214379 = x_214377 + y_214378;\n                double defunc_9_fit_fun_res_214380 = defunc_0_f_res_214374 *\n                       x_214379;\n                double x_214381 = b11_214351 * tmp4_214372;\n                double y_214382 = c11_214352 * defunc_1_f_res_214373;\n                double x_214383 = x_214381 + y_214382;\n                double defunc_9_slope_fun_res_214384 = defunc_0_f_res_214374 *\n                       x_214383;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_214322 = x_acc_233649;\n                    x_214323 = x_acc_233650;\n                }\n                // load new values\n                {\n                    x_214324 = defunc_9_fit_fun_res_214380;\n                    x_214325 = defunc_9_slope_fun_res_214384;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_214326 = x_214322 + x_214324;\n                    double defunc_1_op_res_214327 = x_214323 + x_214325;\n                    \n                    // store in accu",
                   "mulator\n                    {\n                        x_acc_233649 = defunc_1_op_res_214326;\n                        x_acc_233650 = defunc_1_op_res_214327;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_214322 = x_acc_233649;\n            x_214323 = x_acc_233650;\n            ((__local\n              double *) red_arr_mem_233632)[sext_i32_i64(local_tid_233628)] =\n                x_214322;\n            ((__local\n              double *) red_arr_mem_233634)[sext_i32_i64(local_tid_233628)] =\n                x_214323;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_233659;\n        int32_t skip_waves_233660 = 1;\n        double x_233652;\n        double x_233653;\n        double x_233654;\n        double x_233655;\n        \n        offset_233659 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_233628,\n                      sext_i64_i32(segred_group_sizze_214312))) {\n                x_233652 = ((__local\n                             double *) red_arr_mem_233632)[sext_i32_i64(local_tid_233628 +\n                                                           offset_233659)];\n                x_233653 = ((__local\n                             double *) red_arr_mem_233634)[sext_i32_i64(local_tid_233628 +\n                                                           offset_233659)];\n            }\n        }\n        offset_233659 = 1;\n        while (slt32(offset_233659, wave_sizze_233630)) {\n            if (slt32(local_tid_233628 + offset_233659,\n                      sext_i64_i32(segred_group_sizze_214312)) &&\n                ((local_tid_233628 - squot32(local_tid_233628,\n                                             wave_sizze_233630) *\n                  wave_sizze_233630) & (2 * offset_233659 - 1)) == 0) {\n                // read array element\n                {\n                    x_233654 = ((volatile ",
                   "__local\n                                 double *) red_arr_mem_233632)[sext_i32_i64(local_tid_233628 +\n                                                               offset_233659)];\n                    x_233655 = ((volatile __local\n                                 double *) red_arr_mem_233634)[sext_i32_i64(local_tid_233628 +\n                                                               offset_233659)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233656 = x_233652 + x_233654;\n                    double defunc_1_op_res_233657 = x_233653 + x_233655;\n                    \n                    x_233652 = defunc_1_op_res_233656;\n                    x_233653 = defunc_1_op_res_233657;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233632)[sext_i32_i64(local_tid_233628)] =\n                        x_233652;\n                    ((volatile __local\n                      double *) red_arr_mem_233634)[sext_i32_i64(local_tid_233628)] =\n                        x_233653;\n                }\n            }\n            offset_233659 *= 2;\n        }\n        while (slt32(skip_waves_233660,\n                     squot32(sext_i64_i32(segred_group_sizze_214312) +\n                             wave_sizze_233630 - 1, wave_sizze_233630))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_233659 = skip_waves_233660 * wave_sizze_233630;\n            if (slt32(local_tid_233628 + offset_233659,\n                      sext_i64_i32(segred_group_sizze_214312)) &&\n                ((local_tid_233628 - squot32(local_tid_233628,\n                                             wave_sizze_233630) *\n                  wave_sizze_233630) == 0 && (squot32(local_tid_233628,\n                                                      wave_sizze_233630) & (2 *\n                                                               ",
                   "             skip_waves_233660 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_233654 = ((__local\n                                 double *) red_arr_mem_233632)[sext_i32_i64(local_tid_233628 +\n                                                               offset_233659)];\n                    x_233655 = ((__local\n                                 double *) red_arr_mem_233634)[sext_i32_i64(local_tid_233628 +\n                                                               offset_233659)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233656 = x_233652 + x_233654;\n                    double defunc_1_op_res_233657 = x_233653 + x_233655;\n                    \n                    x_233652 = defunc_1_op_res_233656;\n                    x_233653 = defunc_1_op_res_233657;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_233632)[sext_i32_i64(local_tid_233628)] =\n                        x_233652;\n                    ((__local\n                      double *) red_arr_mem_233634)[sext_i32_i64(local_tid_233628)] =\n                        x_233653;\n                }\n            }\n            skip_waves_233660 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_233628) == (int64_t) 0) {\n                x_acc_233649 = x_233652;\n                x_acc_233650 = x_233653;\n            }\n        }\n        if (groups_per_segment_233616 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_233628 == 0) {\n                    ((__global double *) mem_230128)[gtid_214317 *\n                                 ",
                   "                    (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_214318 *\n                                                     s_n_m_203726 +\n                                                     gtid_214319] =\n                        x_acc_233649;\n                    ((__global double *) mem_230133)[gtid_214317 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_214318 *\n                                                     s_n_m_203726 +\n                                                     gtid_214319] =\n                        x_acc_233650;\n                }\n            }\n        } else {\n            int32_t old_counter_233661;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_233628 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_233621)[sext_i32_i64(virt_group_id_233640)] =\n                        x_acc_233649;\n                    ((__global\n                      double *) segred_tmp_mem_233623)[sext_i32_i64(virt_group_id_233640)] =\n                        x_acc_233650;\n                    mem_fence_global();\n                    old_counter_233661 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233625)[sext_i32_i64(srem32(flat_segment_id_233641,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_233636)[(int64_t) 0] =\n                        old_counter_233661 == groups_per_segment_233616 -\n                        (int64_t) 1;\n                }\n       ",
                   "     }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_233662;\n            \n            is_last_group_233662 = ((__local\n                                     bool *) sync_arr_mem_233636)[(int64_t) 0];\n            if (is_last_group_233662) {\n                if (local_tid_233628 == 0) {\n                    old_counter_233661 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233625)[sext_i32_i64(srem32(flat_segment_id_233641,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_233616));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_233663 =\n                            sdiv_up64(groups_per_segment_233616,\n                                      segred_group_sizze_214312);\n                    \n                    x_214322 = 0.0;\n                    x_214323 = 0.0;\n                    for (int64_t i_233664 = 0; i_233664 <\n                         read_per_thread_233663; i_233664++) {\n                        int64_t group_res_id_233665 =\n                                sext_i32_i64(local_tid_233628) *\n                                read_per_thread_233663 + i_233664;\n                        int64_t index_of_group_res_233666 =\n                                sext_i32_i64(flat_segment_id_233641) *\n                                groups_per_segment_233616 + group_res_id_233665;\n                        \n                        if (slt64(group_res_id_233665,\n                                  groups_per_segment_233616)) {\n                            x_214324 = ((__global\n                                         double *) segred_tmp_mem_233621)[index_of_",
                   "group_res_233666];\n                            x_214325 = ((__global\n                                         double *) segred_tmp_mem_233623)[index_of_group_res_233666];\n                            \n                            double defunc_1_op_res_214326 = x_214322 + x_214324;\n                            double defunc_1_op_res_214327 = x_214323 + x_214325;\n                            \n                            x_214322 = defunc_1_op_res_214326;\n                            x_214323 = defunc_1_op_res_214327;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_233632)[sext_i32_i64(local_tid_233628)] =\n                    x_214322;\n                ((__local\n                  double *) red_arr_mem_233634)[sext_i32_i64(local_tid_233628)] =\n                    x_214323;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_233667;\n                    int32_t skip_waves_233668 = 1;\n                    double x_233652;\n                    double x_233653;\n                    double x_233654;\n                    double x_233655;\n                    \n                    offset_233667 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_233628,\n                                  sext_i64_i32(segred_group_sizze_214312))) {\n                            x_233652 = ((__local\n                                         double *) red_arr_mem_233632)[sext_i32_i64(local_tid_233628 +\n                                                                       offset_233667)];\n                            x_233653 = ((__local\n                                         double *) red_arr_mem_233634)[sext_i32_i64(local_tid_233628 +\n                                                                       offset_233667)];\n                        }",
                   "\n                    }\n                    offset_233667 = 1;\n                    while (slt32(offset_233667, wave_sizze_233630)) {\n                        if (slt32(local_tid_233628 + offset_233667,\n                                  sext_i64_i32(segred_group_sizze_214312)) &&\n                            ((local_tid_233628 - squot32(local_tid_233628,\n                                                         wave_sizze_233630) *\n                              wave_sizze_233630) & (2 * offset_233667 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_233654 = ((volatile __local\n                                             double *) red_arr_mem_233632)[sext_i32_i64(local_tid_233628 +\n                                                                           offset_233667)];\n                                x_233655 = ((volatile __local\n                                             double *) red_arr_mem_233634)[sext_i32_i64(local_tid_233628 +\n                                                                           offset_233667)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233656 = x_233652 +\n                                       x_233654;\n                                double defunc_1_op_res_233657 = x_233653 +\n                                       x_233655;\n                                \n                                x_233652 = defunc_1_op_res_233656;\n                                x_233653 = defunc_1_op_res_233657;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233632)[sext_i32_i64(local_tid_233628)] =\n                                    x_233652;\n           ",
                   "                     ((volatile __local\n                                  double *) red_arr_mem_233634)[sext_i32_i64(local_tid_233628)] =\n                                    x_233653;\n                            }\n                        }\n                        offset_233667 *= 2;\n                    }\n                    while (slt32(skip_waves_233668,\n                                 squot32(sext_i64_i32(segred_group_sizze_214312) +\n                                         wave_sizze_233630 - 1,\n                                         wave_sizze_233630))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_233667 = skip_waves_233668 * wave_sizze_233630;\n                        if (slt32(local_tid_233628 + offset_233667,\n                                  sext_i64_i32(segred_group_sizze_214312)) &&\n                            ((local_tid_233628 - squot32(local_tid_233628,\n                                                         wave_sizze_233630) *\n                              wave_sizze_233630) == 0 &&\n                             (squot32(local_tid_233628, wave_sizze_233630) &\n                              (2 * skip_waves_233668 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_233654 = ((__local\n                                             double *) red_arr_mem_233632)[sext_i32_i64(local_tid_233628 +\n                                                                           offset_233667)];\n                                x_233655 = ((__local\n                                             double *) red_arr_mem_233634)[sext_i32_i64(local_tid_233628 +\n                                                                           offset_233667)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233656 = x_233652 +\n                     ",
                   "                  x_233654;\n                                double defunc_1_op_res_233657 = x_233653 +\n                                       x_233655;\n                                \n                                x_233652 = defunc_1_op_res_233656;\n                                x_233653 = defunc_1_op_res_233657;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_233632)[sext_i32_i64(local_tid_233628)] =\n                                    x_233652;\n                                ((__local\n                                  double *) red_arr_mem_233634)[sext_i32_i64(local_tid_233628)] =\n                                    x_233653;\n                            }\n                        }\n                        skip_waves_233668 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_233628 == 0) {\n                            ((__global double *) mem_230128)[gtid_214317 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_214318 *\n                                                             s_n_m_203726 +\n                                                             gtid_214319] =\n                                x_233652;\n                            ((__global double *) mem_230133)[gtid_214317 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_214318 *\n                                                             s_n_m_203726 +\n                                                   ",
                   "          gtid_214319] =\n                                x_233653;\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_214312\n}\n__kernel void mainzisegred_large_216874(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_233947_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233945_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233943_backing_aligned_2,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233941_backing_aligned_3,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233939_backing_aligned_4,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233937_backing_aligned_5,\n                                        int64_t n_p_203574, int64_t q_s_203575,\n                                        int64_t partition_sizze_203667,\n                                        int64_t defunc_0_f_res_203721,\n                                        int64_t s_n_m_203726,\n                                        int64_t num_groups_216863,\n                                        int64_t groups_per_segment_233915,\n                                        int64_t elements_per_thread_233916,\n                                        int64_t virt_num_groups_233917,\n                                        int64_t threads_per_segment_233919,\n                                        __global unsigned char *ext_mem_229372,\n                                        __g",
                   "lobal unsigned char *ext_mem_229373,\n                                        __global unsigned char *ext_mem_229470,\n                                        __global unsigned char *ext_mem_229471,\n                                        __global unsigned char *mem_229639,\n                                        __global unsigned char *mem_230420,\n                                        __global unsigned char *mem_230430,\n                                        __global unsigned char *mem_230435,\n                                        __global unsigned char *mem_230440,\n                                        __global unsigned char *mem_230445,\n                                        __global unsigned char *mem_230450,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233920,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233922,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233924,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233926,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233928,\n                                        __global\n                                        unsigned char *mainzicounter_mem_233930)\n{\n    #define segred_group_sizze_216862 (mainzisegred_group_sizze_215602)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict sync_arr_mem_233947_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_233947_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_233945_backing_4 =\n                                   (__l",
                   "ocal volatile\n                                    unsigned char *) red_arr_mem_233945_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_233943_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233943_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_233941_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233941_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_233939_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233939_backing_aligned_4;\n    __local volatile unsigned char *restrict red_arr_mem_233937_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233937_backing_aligned_5;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233932;\n    int32_t local_tid_233933;\n    int64_t group_sizze_233936;\n    int32_t wave_sizze_233935;\n    int32_t group_tid_233934;\n    \n    global_tid_233932 = get_global_id(0);\n    local_tid_233933 = get_local_id(0);\n    group_sizze_233936 = get_local_size(0);\n    wave_sizze_233935 = LOCKSTEP_WIDTH;\n    group_tid_233934 = get_group_id(0);\n    \n    int32_t phys_tid_216874 = global_tid_233932;\n    __local unsigned char *red_arr_mem_233937;\n    \n    red_arr_mem_233937 = (__local unsigned char *) red_arr_mem_233937_backing_0;\n    \n    __local unsigned char *red_arr_mem_233939;\n    \n    red_arr_mem_233939 = (__local unsigned char *) red_arr_mem_233939_backing_1;\n    \n    __local unsigned char *red_arr_mem_233941;\n    \n    red_arr_mem_233941 = (__local unsigned char *) red_arr_mem_233941_backing_2;\n    \n    __local unsigned char *red_arr_mem_233943;\n    \n    red_arr_mem_233943 = (__local unsigned char *) red_arr_mem_233943_back",
                   "ing_3;\n    \n    __local unsigned char *red_arr_mem_233945;\n    \n    red_arr_mem_233945 = (__local unsigned char *) red_arr_mem_233945_backing_4;\n    \n    __local unsigned char *sync_arr_mem_233947;\n    \n    sync_arr_mem_233947 = (__local\n                           unsigned char *) sync_arr_mem_233947_backing_5;\n    \n    int32_t phys_group_id_233949;\n    \n    phys_group_id_233949 = get_group_id(0);\n    for (int32_t i_233950 = 0; i_233950 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_233917) - phys_group_id_233949,\n                   sext_i64_i32(num_groups_216863)); i_233950++) {\n        int32_t virt_group_id_233951 = phys_group_id_233949 + i_233950 *\n                sext_i64_i32(num_groups_216863);\n        int32_t flat_segment_id_233952 = squot32(virt_group_id_233951,\n                                                 sext_i64_i32(groups_per_segment_233915));\n        int64_t global_tid_233953 = srem64(sext_i32_i64(virt_group_id_233951) *\n                                           segred_group_sizze_216862 +\n                                           sext_i32_i64(local_tid_233933),\n                                           segred_group_sizze_216862 *\n                                           groups_per_segment_233915);\n        int64_t slice_233954 = s_n_m_203726;\n        int64_t slice_233955 = n_p_203574 * slice_233954;\n        int64_t slice_233956 = partition_sizze_203667 * slice_233955;\n        int64_t gtid_216870 = squot64(sext_i32_i64(flat_segment_id_233952),\n                                      slice_233955);\n        int64_t remnant_233957 = sext_i32_i64(flat_segment_id_233952) -\n                gtid_216870 * slice_233955;\n        int64_t gtid_216871 = squot64(remnant_233957, slice_233954);\n        int64_t remnant_233958 = remnant_233957 - gtid_216871 * slice_233954;\n        int64_t gtid_216872 = remnant_233958;\n        int64_t remnant_233959 = remnant_233958 - gtid_216872;\n        int64_t gtid_216873;\n        double x_acc_233960;\n        double x_acc_23396",
                   "1;\n        double x_acc_233962;\n        double x_acc_233963;\n        double x_acc_233964;\n        int64_t chunk_sizze_233965 = smin64(elements_per_thread_233916,\n                                            sdiv_up64(q_s_203575 -\n                                                      global_tid_233953,\n                                                      threads_per_segment_233919));\n        double x_216875;\n        double x_216876;\n        double x_216877;\n        double x_216878;\n        double x_216879;\n        double x_216880;\n        double x_216881;\n        double x_216882;\n        double x_216883;\n        double x_216884;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_233960 = 0.0;\n            x_acc_233961 = 0.0;\n            x_acc_233962 = 0.0;\n            x_acc_233963 = 0.0;\n            x_acc_233964 = 0.0;\n        }\n        for (int64_t i_233981 = 0; i_233981 < chunk_sizze_233965; i_233981++) {\n            gtid_216873 = global_tid_233953 + threads_per_segment_233919 *\n                i_233981;\n            // apply map function\n            {\n                int64_t x_216898;\n                \n                x_216898 = ((__global int64_t *) ext_mem_229372)[gtid_216870 *\n                                                                 n_p_203574 +\n                                                                 gtid_216871];\n                \n                int64_t x_216902;\n                \n                x_216902 = ((__global int64_t *) ext_mem_229471)[gtid_216870 *\n                                                                 (s_n_m_203726 *\n                                                                  n_p_203574) +\n                                                                 gtid_216871 *\n                                                                 s_n_m_203726 +\n                                                                 gtid_216872];\n                \n                double x_216903;\n                ",
                   "\n                x_216903 = ((__global double *) ext_mem_229470)[gtid_216870 *\n                                                                (s_n_m_203726 *\n                                                                 n_p_203574) +\n                                                                gtid_216871 *\n                                                                s_n_m_203726 +\n                                                                gtid_216872];\n                \n                int64_t defunc_0_m_fun_res_216904;\n                \n                defunc_0_m_fun_res_216904 = ((__global\n                                              int64_t *) mem_230420)[gtid_216870 *\n                                                                     (s_n_m_203726 *\n                                                                      n_p_203574) +\n                                                                     gtid_216871 *\n                                                                     s_n_m_203726 +\n                                                                     gtid_216872];\n                \n                bool cond_216906 = sle64(x_216898, gtid_216873);\n                int64_t defunc_0_f_res_216907;\n                \n                if (cond_216906) {\n                    defunc_0_f_res_216907 = (int64_t) 0;\n                } else {\n                    int64_t i_216908 = add64(gtid_216873, x_216902);\n                    int64_t defunc_0_add_arg_216909;\n                    \n                    defunc_0_add_arg_216909 = ((__global\n                                                int64_t *) ext_mem_229373)[gtid_216870 *\n                                                                           (defunc_0_f_res_203721 *\n                                                                            n_p_203574) +\n                                                                           gtid_216871 *\n                                                      ",
                   "                     defunc_0_f_res_203721 +\n                                                                           i_216908];\n                    \n                    int64_t defunc_1_add_res_216910 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_216909);\n                    \n                    defunc_0_f_res_216907 = defunc_1_add_res_216910;\n                }\n                \n                double defunc_0_f_res_216911;\n                \n                if (cond_216906) {\n                    defunc_0_f_res_216911 = 0.0;\n                } else {\n                    int64_t i_216912 = add64(gtid_216873, x_216902);\n                    double defunc_0_add_arg_216913;\n                    \n                    defunc_0_add_arg_216913 = ((__global\n                                                double *) mem_229639)[gtid_216870 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_216871 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_216912];\n                    defunc_0_f_res_216911 = defunc_0_add_arg_216913;\n                }\n                \n                int64_t binop_p_216914 = sub64(defunc_0_f_res_216907,\n                                               defunc_0_m_fun_res_216904);\n                double defunc_0_f_res_216915 = sitofp_i64_f64(binop_p_216914);\n                double abs_res_216916 = fabs(defunc_0_f_res_216915);\n                double tmp1_216917 = abs_res_216916 / x_216903;\n                double x_216918 = tmp1_216917 * tmp1_216917;\n                double y_216919 = tmp1_216917 * x_216918;\n                double tmp2_216920 = 1.0 - y_216919;\n                double x_216921 = tmp",
                   "2_216920 * tmp2_216920;\n                double tmp3_216922 = tmp2_216920 * x_216921;\n                double w_j_216923 = defunc_0_f_res_216911 * tmp3_216922;\n                double xw_j_216924 = defunc_0_f_res_216915 * w_j_216923;\n                double x2w_j_216925 = defunc_0_f_res_216915 * xw_j_216924;\n                double x3w_j_216926 = defunc_0_f_res_216915 * x2w_j_216925;\n                double x4w_j_216927 = defunc_0_f_res_216915 * x3w_j_216926;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_216875 = x_acc_233960;\n                    x_216876 = x_acc_233961;\n                    x_216877 = x_acc_233962;\n                    x_216878 = x_acc_233963;\n                    x_216879 = x_acc_233964;\n                }\n                // load new values\n                {\n                    x_216880 = w_j_216923;\n                    x_216881 = xw_j_216924;\n                    x_216882 = x2w_j_216925;\n                    x_216883 = x3w_j_216926;\n                    x_216884 = x4w_j_216927;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_216885 = x_216875 + x_216880;\n                    double defunc_1_op_res_216886 = x_216876 + x_216881;\n                    double defunc_1_op_res_216887 = x_216877 + x_216882;\n                    double defunc_1_op_res_216888 = x_216878 + x_216883;\n                    double defunc_1_op_res_216889 = x_216879 + x_216884;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_233960 = defunc_1_op_res_216885;\n                        x_acc_233961 = defunc_1_op_res_216886;\n                        x_acc_233962 = defunc_1_op_res_216887;\n                        x_acc_233963 = defunc_1_op_res_216888;\n                        x_acc_233964 = defunc_1_op_res_216889;\n                    }\n                }\n      ",
                   "      }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_216875 = x_acc_233960;\n            x_216876 = x_acc_233961;\n            x_216877 = x_acc_233962;\n            x_216878 = x_acc_233963;\n            x_216879 = x_acc_233964;\n            ((__local\n              double *) red_arr_mem_233937)[sext_i32_i64(local_tid_233933)] =\n                x_216875;\n            ((__local\n              double *) red_arr_mem_233939)[sext_i32_i64(local_tid_233933)] =\n                x_216876;\n            ((__local\n              double *) red_arr_mem_233941)[sext_i32_i64(local_tid_233933)] =\n                x_216877;\n            ((__local\n              double *) red_arr_mem_233943)[sext_i32_i64(local_tid_233933)] =\n                x_216878;\n            ((__local\n              double *) red_arr_mem_233945)[sext_i32_i64(local_tid_233933)] =\n                x_216879;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_233982;\n        int32_t skip_waves_233983 = 1;\n        double x_233966;\n        double x_233967;\n        double x_233968;\n        double x_233969;\n        double x_233970;\n        double x_233971;\n        double x_233972;\n        double x_233973;\n        double x_233974;\n        double x_233975;\n        \n        offset_233982 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_233933,\n                      sext_i64_i32(segred_group_sizze_216862))) {\n                x_233966 = ((__local\n                             double *) red_arr_mem_233937)[sext_i32_i64(local_tid_233933 +\n                                                           offset_233982)];\n                x_233967 = ((__local\n                             double *) red_arr_mem_233939)[sext_i32_i64(local_tid_233933 +\n                                                           offset_233982)];\n                x_233968 = ((__local\n                             double *) red_arr_mem_23394",
                   "1)[sext_i32_i64(local_tid_233933 +\n                                                           offset_233982)];\n                x_233969 = ((__local\n                             double *) red_arr_mem_233943)[sext_i32_i64(local_tid_233933 +\n                                                           offset_233982)];\n                x_233970 = ((__local\n                             double *) red_arr_mem_233945)[sext_i32_i64(local_tid_233933 +\n                                                           offset_233982)];\n            }\n        }\n        offset_233982 = 1;\n        while (slt32(offset_233982, wave_sizze_233935)) {\n            if (slt32(local_tid_233933 + offset_233982,\n                      sext_i64_i32(segred_group_sizze_216862)) &&\n                ((local_tid_233933 - squot32(local_tid_233933,\n                                             wave_sizze_233935) *\n                  wave_sizze_233935) & (2 * offset_233982 - 1)) == 0) {\n                // read array element\n                {\n                    x_233971 = ((volatile __local\n                                 double *) red_arr_mem_233937)[sext_i32_i64(local_tid_233933 +\n                                                               offset_233982)];\n                    x_233972 = ((volatile __local\n                                 double *) red_arr_mem_233939)[sext_i32_i64(local_tid_233933 +\n                                                               offset_233982)];\n                    x_233973 = ((volatile __local\n                                 double *) red_arr_mem_233941)[sext_i32_i64(local_tid_233933 +\n                                                               offset_233982)];\n                    x_233974 = ((volatile __local\n                                 double *) red_arr_mem_233943)[sext_i32_i64(local_tid_233933 +\n                                                               offset_233982)];\n                    x_233975 = ((volatile __local\n                                 double *) ",
                   "red_arr_mem_233945)[sext_i32_i64(local_tid_233933 +\n                                                               offset_233982)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233976 = x_233966 + x_233971;\n                    double defunc_1_op_res_233977 = x_233967 + x_233972;\n                    double defunc_1_op_res_233978 = x_233968 + x_233973;\n                    double defunc_1_op_res_233979 = x_233969 + x_233974;\n                    double defunc_1_op_res_233980 = x_233970 + x_233975;\n                    \n                    x_233966 = defunc_1_op_res_233976;\n                    x_233967 = defunc_1_op_res_233977;\n                    x_233968 = defunc_1_op_res_233978;\n                    x_233969 = defunc_1_op_res_233979;\n                    x_233970 = defunc_1_op_res_233980;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233937)[sext_i32_i64(local_tid_233933)] =\n                        x_233966;\n                    ((volatile __local\n                      double *) red_arr_mem_233939)[sext_i32_i64(local_tid_233933)] =\n                        x_233967;\n                    ((volatile __local\n                      double *) red_arr_mem_233941)[sext_i32_i64(local_tid_233933)] =\n                        x_233968;\n                    ((volatile __local\n                      double *) red_arr_mem_233943)[sext_i32_i64(local_tid_233933)] =\n                        x_233969;\n                    ((volatile __local\n                      double *) red_arr_mem_233945)[sext_i32_i64(local_tid_233933)] =\n                        x_233970;\n                }\n            }\n            offset_233982 *= 2;\n        }\n        while (slt32(skip_waves_233983,\n                     squot32(sext_i64_i32(segred_group_sizze_216862) +\n                             wave_sizze_233935 - 1, wave_sizze_23",
                   "3935))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_233982 = skip_waves_233983 * wave_sizze_233935;\n            if (slt32(local_tid_233933 + offset_233982,\n                      sext_i64_i32(segred_group_sizze_216862)) &&\n                ((local_tid_233933 - squot32(local_tid_233933,\n                                             wave_sizze_233935) *\n                  wave_sizze_233935) == 0 && (squot32(local_tid_233933,\n                                                      wave_sizze_233935) & (2 *\n                                                                            skip_waves_233983 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_233971 = ((__local\n                                 double *) red_arr_mem_233937)[sext_i32_i64(local_tid_233933 +\n                                                               offset_233982)];\n                    x_233972 = ((__local\n                                 double *) red_arr_mem_233939)[sext_i32_i64(local_tid_233933 +\n                                                               offset_233982)];\n                    x_233973 = ((__local\n                                 double *) red_arr_mem_233941)[sext_i32_i64(local_tid_233933 +\n                                                               offset_233982)];\n                    x_233974 = ((__local\n                                 double *) red_arr_mem_233943)[sext_i32_i64(local_tid_233933 +\n                                                               offset_233982)];\n                    x_233975 = ((__local\n                                 double *) red_arr_mem_233945)[sext_i32_i64(local_tid_233933 +\n                                                               offset_233982)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233976 = x_23396",
                   "6 + x_233971;\n                    double defunc_1_op_res_233977 = x_233967 + x_233972;\n                    double defunc_1_op_res_233978 = x_233968 + x_233973;\n                    double defunc_1_op_res_233979 = x_233969 + x_233974;\n                    double defunc_1_op_res_233980 = x_233970 + x_233975;\n                    \n                    x_233966 = defunc_1_op_res_233976;\n                    x_233967 = defunc_1_op_res_233977;\n                    x_233968 = defunc_1_op_res_233978;\n                    x_233969 = defunc_1_op_res_233979;\n                    x_233970 = defunc_1_op_res_233980;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_233937)[sext_i32_i64(local_tid_233933)] =\n                        x_233966;\n                    ((__local\n                      double *) red_arr_mem_233939)[sext_i32_i64(local_tid_233933)] =\n                        x_233967;\n                    ((__local\n                      double *) red_arr_mem_233941)[sext_i32_i64(local_tid_233933)] =\n                        x_233968;\n                    ((__local\n                      double *) red_arr_mem_233943)[sext_i32_i64(local_tid_233933)] =\n                        x_233969;\n                    ((__local\n                      double *) red_arr_mem_233945)[sext_i32_i64(local_tid_233933)] =\n                        x_233970;\n                }\n            }\n            skip_waves_233983 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_233933) == (int64_t) 0) {\n                x_acc_233960 = x_233966;\n                x_acc_233961 = x_233967;\n                x_acc_233962 = x_233968;\n                x_acc_233963 = x_233969;\n                x_acc_233964 = x_233970;\n            }\n        }\n        if (groups_per_segment_233915 == (int64_t) 1) {\n            // first thread in grou",
                   "p saves final result to memory\n            {\n                if (local_tid_233933 == 0) {\n                    ((__global double *) mem_230430)[gtid_216870 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_216871 *\n                                                     s_n_m_203726 +\n                                                     gtid_216872] =\n                        x_acc_233960;\n                    ((__global double *) mem_230435)[gtid_216870 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_216871 *\n                                                     s_n_m_203726 +\n                                                     gtid_216872] =\n                        x_acc_233961;\n                    ((__global double *) mem_230440)[gtid_216870 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_216871 *\n                                                     s_n_m_203726 +\n                                                     gtid_216872] =\n                        x_acc_233962;\n                    ((__global double *) mem_230445)[gtid_216870 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_216871 *\n                                                     s_n_m_203726 +\n                                                     gtid_216872] =\n                        x_acc_233963;\n                    ((__global double *) mem_230450)[gtid_216870 *\n                                                     (s_n_m_203",
                   "726 *\n                                                      n_p_203574) +\n                                                     gtid_216871 *\n                                                     s_n_m_203726 +\n                                                     gtid_216872] =\n                        x_acc_233964;\n                }\n            }\n        } else {\n            int32_t old_counter_233984;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_233933 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_233920)[sext_i32_i64(virt_group_id_233951)] =\n                        x_acc_233960;\n                    ((__global\n                      double *) segred_tmp_mem_233922)[sext_i32_i64(virt_group_id_233951)] =\n                        x_acc_233961;\n                    ((__global\n                      double *) segred_tmp_mem_233924)[sext_i32_i64(virt_group_id_233951)] =\n                        x_acc_233962;\n                    ((__global\n                      double *) segred_tmp_mem_233926)[sext_i32_i64(virt_group_id_233951)] =\n                        x_acc_233963;\n                    ((__global\n                      double *) segred_tmp_mem_233928)[sext_i32_i64(virt_group_id_233951)] =\n                        x_acc_233964;\n                    mem_fence_global();\n                    old_counter_233984 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233930)[sext_i32_i64(srem32(flat_segment_id_233952,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_233947)[(int64_t) 0] =\n                        old_counter_233984 == groups_per_segment_233915 -\n                        (int64_t) 1;\n              ",
                   "  }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_233985;\n            \n            is_last_group_233985 = ((__local\n                                     bool *) sync_arr_mem_233947)[(int64_t) 0];\n            if (is_last_group_233985) {\n                if (local_tid_233933 == 0) {\n                    old_counter_233984 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233930)[sext_i32_i64(srem32(flat_segment_id_233952,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_233915));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_233986 =\n                            sdiv_up64(groups_per_segment_233915,\n                                      segred_group_sizze_216862);\n                    \n                    x_216875 = 0.0;\n                    x_216876 = 0.0;\n                    x_216877 = 0.0;\n                    x_216878 = 0.0;\n                    x_216879 = 0.0;\n                    for (int64_t i_233987 = 0; i_233987 <\n                         read_per_thread_233986; i_233987++) {\n                        int64_t group_res_id_233988 =\n                                sext_i32_i64(local_tid_233933) *\n                                read_per_thread_233986 + i_233987;\n                        int64_t index_of_group_res_233989 =\n                                sext_i32_i64(flat_segment_id_233952) *\n                                groups_per_segment_233915 + group_res_id_233988;\n                        \n                        if (slt64(group_res_id_233988,\n                                  groups_per_segment_233915)) {\n              ",
                   "              x_216880 = ((__global\n                                         double *) segred_tmp_mem_233920)[index_of_group_res_233989];\n                            x_216881 = ((__global\n                                         double *) segred_tmp_mem_233922)[index_of_group_res_233989];\n                            x_216882 = ((__global\n                                         double *) segred_tmp_mem_233924)[index_of_group_res_233989];\n                            x_216883 = ((__global\n                                         double *) segred_tmp_mem_233926)[index_of_group_res_233989];\n                            x_216884 = ((__global\n                                         double *) segred_tmp_mem_233928)[index_of_group_res_233989];\n                            \n                            double defunc_1_op_res_216885 = x_216875 + x_216880;\n                            double defunc_1_op_res_216886 = x_216876 + x_216881;\n                            double defunc_1_op_res_216887 = x_216877 + x_216882;\n                            double defunc_1_op_res_216888 = x_216878 + x_216883;\n                            double defunc_1_op_res_216889 = x_216879 + x_216884;\n                            \n                            x_216875 = defunc_1_op_res_216885;\n                            x_216876 = defunc_1_op_res_216886;\n                            x_216877 = defunc_1_op_res_216887;\n                            x_216878 = defunc_1_op_res_216888;\n                            x_216879 = defunc_1_op_res_216889;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_233937)[sext_i32_i64(local_tid_233933)] =\n                    x_216875;\n                ((__local\n                  double *) red_arr_mem_233939)[sext_i32_i64(local_tid_233933)] =\n                    x_216876;\n                ((__local\n                  double *) red_arr_mem_233941)[sext_i32_i64(local_tid_233933)] =\n                    x_2168",
                   "77;\n                ((__local\n                  double *) red_arr_mem_233943)[sext_i32_i64(local_tid_233933)] =\n                    x_216878;\n                ((__local\n                  double *) red_arr_mem_233945)[sext_i32_i64(local_tid_233933)] =\n                    x_216879;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_233990;\n                    int32_t skip_waves_233991 = 1;\n                    double x_233966;\n                    double x_233967;\n                    double x_233968;\n                    double x_233969;\n                    double x_233970;\n                    double x_233971;\n                    double x_233972;\n                    double x_233973;\n                    double x_233974;\n                    double x_233975;\n                    \n                    offset_233990 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_233933,\n                                  sext_i64_i32(segred_group_sizze_216862))) {\n                            x_233966 = ((__local\n                                         double *) red_arr_mem_233937)[sext_i32_i64(local_tid_233933 +\n                                                                       offset_233990)];\n                            x_233967 = ((__local\n                                         double *) red_arr_mem_233939)[sext_i32_i64(local_tid_233933 +\n                                                                       offset_233990)];\n                            x_233968 = ((__local\n                                         double *) red_arr_mem_233941)[sext_i32_i64(local_tid_233933 +\n                                                                       offset_233990)];\n                            x_233969 = ((__local\n                                         double *) red_arr_mem_233943)[sext_i32_i64(local_tid",
                   "_233933 +\n                                                                       offset_233990)];\n                            x_233970 = ((__local\n                                         double *) red_arr_mem_233945)[sext_i32_i64(local_tid_233933 +\n                                                                       offset_233990)];\n                        }\n                    }\n                    offset_233990 = 1;\n                    while (slt32(offset_233990, wave_sizze_233935)) {\n                        if (slt32(local_tid_233933 + offset_233990,\n                                  sext_i64_i32(segred_group_sizze_216862)) &&\n                            ((local_tid_233933 - squot32(local_tid_233933,\n                                                         wave_sizze_233935) *\n                              wave_sizze_233935) & (2 * offset_233990 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_233971 = ((volatile __local\n                                             double *) red_arr_mem_233937)[sext_i32_i64(local_tid_233933 +\n                                                                           offset_233990)];\n                                x_233972 = ((volatile __local\n                                             double *) red_arr_mem_233939)[sext_i32_i64(local_tid_233933 +\n                                                                           offset_233990)];\n                                x_233973 = ((volatile __local\n                                             double *) red_arr_mem_233941)[sext_i32_i64(local_tid_233933 +\n                                                                           offset_233990)];\n                                x_233974 = ((volatile __local\n                                             double *) red_arr_mem_233943)[sext_i32_i64(local_tid_233933 +\n                                                              ",
                   "             offset_233990)];\n                                x_233975 = ((volatile __local\n                                             double *) red_arr_mem_233945)[sext_i32_i64(local_tid_233933 +\n                                                                           offset_233990)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233976 = x_233966 +\n                                       x_233971;\n                                double defunc_1_op_res_233977 = x_233967 +\n                                       x_233972;\n                                double defunc_1_op_res_233978 = x_233968 +\n                                       x_233973;\n                                double defunc_1_op_res_233979 = x_233969 +\n                                       x_233974;\n                                double defunc_1_op_res_233980 = x_233970 +\n                                       x_233975;\n                                \n                                x_233966 = defunc_1_op_res_233976;\n                                x_233967 = defunc_1_op_res_233977;\n                                x_233968 = defunc_1_op_res_233978;\n                                x_233969 = defunc_1_op_res_233979;\n                                x_233970 = defunc_1_op_res_233980;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233937)[sext_i32_i64(local_tid_233933)] =\n                                    x_233966;\n                                ((volatile __local\n                                  double *) red_arr_mem_233939)[sext_i32_i64(local_tid_233933)] =\n                                    x_233967;\n                                ((volatile __local\n                                  double *) re",
                   "d_arr_mem_233941)[sext_i32_i64(local_tid_233933)] =\n                                    x_233968;\n                                ((volatile __local\n                                  double *) red_arr_mem_233943)[sext_i32_i64(local_tid_233933)] =\n                                    x_233969;\n                                ((volatile __local\n                                  double *) red_arr_mem_233945)[sext_i32_i64(local_tid_233933)] =\n                                    x_233970;\n                            }\n                        }\n                        offset_233990 *= 2;\n                    }\n                    while (slt32(skip_waves_233991,\n                                 squot32(sext_i64_i32(segred_group_sizze_216862) +\n                                         wave_sizze_233935 - 1,\n                                         wave_sizze_233935))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_233990 = skip_waves_233991 * wave_sizze_233935;\n                        if (slt32(local_tid_233933 + offset_233990,\n                                  sext_i64_i32(segred_group_sizze_216862)) &&\n                            ((local_tid_233933 - squot32(local_tid_233933,\n                                                         wave_sizze_233935) *\n                              wave_sizze_233935) == 0 &&\n                             (squot32(local_tid_233933, wave_sizze_233935) &\n                              (2 * skip_waves_233991 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_233971 = ((__local\n                                             double *) red_arr_mem_233937)[sext_i32_i64(local_tid_233933 +\n                                                                           offset_233990)];\n                                x_233972 = ((__local\n                                             double *) red_arr_mem_233939)[sext_i32_i64(local_tid_233933 +\n ",
                   "                                                                          offset_233990)];\n                                x_233973 = ((__local\n                                             double *) red_arr_mem_233941)[sext_i32_i64(local_tid_233933 +\n                                                                           offset_233990)];\n                                x_233974 = ((__local\n                                             double *) red_arr_mem_233943)[sext_i32_i64(local_tid_233933 +\n                                                                           offset_233990)];\n                                x_233975 = ((__local\n                                             double *) red_arr_mem_233945)[sext_i32_i64(local_tid_233933 +\n                                                                           offset_233990)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233976 = x_233966 +\n                                       x_233971;\n                                double defunc_1_op_res_233977 = x_233967 +\n                                       x_233972;\n                                double defunc_1_op_res_233978 = x_233968 +\n                                       x_233973;\n                                double defunc_1_op_res_233979 = x_233969 +\n                                       x_233974;\n                                double defunc_1_op_res_233980 = x_233970 +\n                                       x_233975;\n                                \n                                x_233966 = defunc_1_op_res_233976;\n                                x_233967 = defunc_1_op_res_233977;\n                                x_233968 = defunc_1_op_res_233978;\n                                x_233969 = defunc_1_op_res_233979;\n                                x_233970 = defunc_1_op_res_233980;\n                            }\n                  ",
                   "          // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_233937)[sext_i32_i64(local_tid_233933)] =\n                                    x_233966;\n                                ((__local\n                                  double *) red_arr_mem_233939)[sext_i32_i64(local_tid_233933)] =\n                                    x_233967;\n                                ((__local\n                                  double *) red_arr_mem_233941)[sext_i32_i64(local_tid_233933)] =\n                                    x_233968;\n                                ((__local\n                                  double *) red_arr_mem_233943)[sext_i32_i64(local_tid_233933)] =\n                                    x_233969;\n                                ((__local\n                                  double *) red_arr_mem_233945)[sext_i32_i64(local_tid_233933)] =\n                                    x_233970;\n                            }\n                        }\n                        skip_waves_233991 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_233933 == 0) {\n                            ((__global double *) mem_230430)[gtid_216870 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_216871 *\n                                                             s_n_m_203726 +\n                                                             gtid_216872] =\n                                x_233966;\n                            ((__global double *) mem_230435)[gtid_216870 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n           ",
                   "                                                  gtid_216871 *\n                                                             s_n_m_203726 +\n                                                             gtid_216872] =\n                                x_233967;\n                            ((__global double *) mem_230440)[gtid_216870 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_216871 *\n                                                             s_n_m_203726 +\n                                                             gtid_216872] =\n                                x_233968;\n                            ((__global double *) mem_230445)[gtid_216870 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_216871 *\n                                                             s_n_m_203726 +\n                                                             gtid_216872] =\n                                x_233969;\n                            ((__global double *) mem_230450)[gtid_216870 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_216871 *\n                                                             s_n_m_203726 +\n                                                             gtid_216872] =\n                                x_233970;\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_216862\n}\n__kernel void mainzisegred_",
                   "large_216997(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_234061_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234059_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234057_backing_aligned_2,\n                                        int64_t n_p_203574, int64_t q_s_203575,\n                                        int64_t partition_sizze_203667,\n                                        int64_t defunc_0_f_res_203721,\n                                        int64_t s_n_m_203726,\n                                        int64_t num_groups_216989,\n                                        int64_t groups_per_segment_234041,\n                                        int64_t elements_per_thread_234042,\n                                        int64_t virt_num_groups_234043,\n                                        int64_t threads_per_segment_234045,\n                                        __global unsigned char *ext_mem_229372,\n                                        __global unsigned char *ext_mem_229373,\n                                        __global unsigned char *ext_mem_229470,\n                                        __global unsigned char *ext_mem_229471,\n                                        __global unsigned char *mem_229634,\n                                        __global unsigned char *mem_229639,\n                                        __global unsigned char *mem_230456,\n                                        __global unsigned char *mem_230461,\n                                        __global unsigned char *mem_230466,\n                                        __global unsigned char *mem_230471,\n                                        __global unsigned char *mem_230476,\n                     ",
                   "                   __global unsigned char *mem_230481,\n                                        __global unsigned char *mem_230487,\n                                        __global unsigned char *mem_230492,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234046,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234048,\n                                        __global\n                                        unsigned char *mainzicounter_mem_234050)\n{\n    #define segred_group_sizze_216988 (mainzisegred_group_sizze_215433)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict sync_arr_mem_234061_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_234061_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_234059_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234059_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_234057_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234057_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234052;\n    int32_t local_tid_234053;\n    int64_t group_sizze_234056;\n    int32_t wave_sizze_234055;\n    int32_t group_tid_234054;\n    \n    global_tid_234052 = get_global_id(0);\n    local_tid_234053 = get_local_id(0);\n    group_sizze_234056 = get_local_size(0);\n    wave_sizze_234055 = LOCKSTEP_WIDTH;\n    group_tid_234054 = get_group_id(0);\n    \n    int32_t phys_tid_216997 = global_tid_234052;\n    __local unsigned char *red_arr_mem_234057;\n    \n    red_arr_mem_234057 = (__local unsigned char *) ",
                   "red_arr_mem_234057_backing_0;\n    \n    __local unsigned char *red_arr_mem_234059;\n    \n    red_arr_mem_234059 = (__local unsigned char *) red_arr_mem_234059_backing_1;\n    \n    __local unsigned char *sync_arr_mem_234061;\n    \n    sync_arr_mem_234061 = (__local\n                           unsigned char *) sync_arr_mem_234061_backing_2;\n    \n    int32_t phys_group_id_234063;\n    \n    phys_group_id_234063 = get_group_id(0);\n    for (int32_t i_234064 = 0; i_234064 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_234043) - phys_group_id_234063,\n                   sext_i64_i32(num_groups_216989)); i_234064++) {\n        int32_t virt_group_id_234065 = phys_group_id_234063 + i_234064 *\n                sext_i64_i32(num_groups_216989);\n        int32_t flat_segment_id_234066 = squot32(virt_group_id_234065,\n                                                 sext_i64_i32(groups_per_segment_234041));\n        int64_t global_tid_234067 = srem64(sext_i32_i64(virt_group_id_234065) *\n                                           segred_group_sizze_216988 +\n                                           sext_i32_i64(local_tid_234053),\n                                           segred_group_sizze_216988 *\n                                           groups_per_segment_234041);\n        int64_t slice_234068 = s_n_m_203726;\n        int64_t slice_234069 = n_p_203574 * slice_234068;\n        int64_t slice_234070 = partition_sizze_203667 * slice_234069;\n        int64_t gtid_216993 = squot64(sext_i32_i64(flat_segment_id_234066),\n                                      slice_234069);\n        int64_t remnant_234071 = sext_i32_i64(flat_segment_id_234066) -\n                gtid_216993 * slice_234069;\n        int64_t gtid_216994 = squot64(remnant_234071, slice_234068);\n        int64_t remnant_234072 = remnant_234071 - gtid_216994 * slice_234068;\n        int64_t gtid_216995 = remnant_234072;\n        int64_t remnant_234073 = remnant_234072 - gtid_216995;\n        int64_t gtid_216996;\n        double x_acc_234074;\n   ",
                   "     double x_acc_234075;\n        int64_t chunk_sizze_234076 = smin64(elements_per_thread_234042,\n                                            sdiv_up64(q_s_203575 -\n                                                      global_tid_234067,\n                                                      threads_per_segment_234045));\n        double x_216998;\n        double x_216999;\n        double x_217000;\n        double x_217001;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_234074 = 0.0;\n            x_acc_234075 = 0.0;\n        }\n        for (int64_t i_234083 = 0; i_234083 < chunk_sizze_234076; i_234083++) {\n            gtid_216996 = global_tid_234067 + threads_per_segment_234045 *\n                i_234083;\n            // apply map function\n            {\n                int64_t x_217019;\n                \n                x_217019 = ((__global int64_t *) ext_mem_229372)[gtid_216993 *\n                                                                 n_p_203574 +\n                                                                 gtid_216994];\n                \n                int64_t x_217028;\n                \n                x_217028 = ((__global int64_t *) ext_mem_229471)[gtid_216993 *\n                                                                 (s_n_m_203726 *\n                                                                  n_p_203574) +\n                                                                 gtid_216994 *\n                                                                 s_n_m_203726 +\n                                                                 gtid_216995];\n                \n                double x_217029;\n                \n                x_217029 = ((__global double *) ext_mem_229470)[gtid_216993 *\n                                                                (s_n_m_203726 *\n                                                                 n_p_203574) +\n                                                                gtid_216",
                   "994 *\n                                                                s_n_m_203726 +\n                                                                gtid_216995];\n                \n                double a12_217030;\n                \n                a12_217030 = ((__global double *) mem_230456)[gtid_216993 *\n                                                              (s_n_m_203726 *\n                                                               n_p_203574) +\n                                                              gtid_216994 *\n                                                              s_n_m_203726 +\n                                                              gtid_216995];\n                \n                double b12_217031;\n                \n                b12_217031 = ((__global double *) mem_230461)[gtid_216993 *\n                                                              (s_n_m_203726 *\n                                                               n_p_203574) +\n                                                              gtid_216994 *\n                                                              s_n_m_203726 +\n                                                              gtid_216995];\n                \n                double c12_217032;\n                \n                c12_217032 = ((__global double *) mem_230466)[gtid_216993 *\n                                                              (s_n_m_203726 *\n                                                               n_p_203574) +\n                                                              gtid_216994 *\n                                                              s_n_m_203726 +\n                                                              gtid_216995];\n                \n                double b2_217033;\n                \n                b2_217033 = ((__global double *) mem_230471)[gtid_216993 *\n                                                             (s_n_m_203726 *\n                              ",
                   "                                n_p_203574) +\n                                                             gtid_216994 *\n                                                             s_n_m_203726 +\n                                                             gtid_216995];\n                \n                double c2_217034;\n                \n                c2_217034 = ((__global double *) mem_230476)[gtid_216993 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_216994 *\n                                                             s_n_m_203726 +\n                                                             gtid_216995];\n                \n                int64_t defunc_0_m_fun_res_217035;\n                \n                defunc_0_m_fun_res_217035 = ((__global\n                                              int64_t *) mem_230481)[gtid_216993 *\n                                                                     (s_n_m_203726 *\n                                                                      n_p_203574) +\n                                                                     gtid_216994 *\n                                                                     s_n_m_203726 +\n                                                                     gtid_216995];\n                \n                bool cond_217037 = sle64(x_217019, gtid_216996);\n                int64_t defunc_0_f_res_217038;\n                \n                if (cond_217037) {\n                    defunc_0_f_res_217038 = (int64_t) 0;\n                } else {\n                    int64_t i_217039 = add64(gtid_216996, x_217028);\n                    int64_t defunc_0_add_arg_217040;\n                    \n                    defunc_0_add_arg_217040 = ((__global\n                                                int64_t *) ext_mem_229373)[gtid_216993 *\n            ",
                   "                                                               (defunc_0_f_res_203721 *\n                                                                            n_p_203574) +\n                                                                           gtid_216994 *\n                                                                           defunc_0_f_res_203721 +\n                                                                           i_217039];\n                    \n                    int64_t defunc_1_add_res_217041 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_217040);\n                    \n                    defunc_0_f_res_217038 = defunc_1_add_res_217041;\n                }\n                \n                double defunc_0_f_res_217042;\n                \n                if (cond_217037) {\n                    defunc_0_f_res_217042 = 0.0;\n                } else {\n                    int64_t i_217043 = add64(gtid_216996, x_217028);\n                    double defunc_0_add_arg_217044;\n                    \n                    defunc_0_add_arg_217044 = ((__global\n                                                double *) mem_229639)[gtid_216993 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_216994 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_217043];\n                    defunc_0_f_res_217042 = defunc_0_add_arg_217044;\n                }\n                \n                int64_t binop_p_217045 = sub64(defunc_0_f_res_217038,\n                                               defunc_0_m_fun_res_217035);\n                double defunc_0_f_res_217046 = sitofp_i64_f64(binop_p_217045);\n                doubl",
                   "e abs_res_217047 = fabs(defunc_0_f_res_217046);\n                double tmp1_217048 = abs_res_217047 / x_217029;\n                double x_217049 = tmp1_217048 * tmp1_217048;\n                double y_217050 = tmp1_217048 * x_217049;\n                double tmp2_217051 = 1.0 - y_217050;\n                double x_217052 = tmp2_217051 * tmp2_217051;\n                double tmp3_217053 = tmp2_217051 * x_217052;\n                double tmp4_217054 = defunc_0_f_res_217042 * tmp3_217053;\n                double defunc_1_f_res_217055 = defunc_0_f_res_217046 *\n                       tmp4_217054;\n                double defunc_1_f_res_217056 = defunc_0_f_res_217046 *\n                       defunc_1_f_res_217055;\n                double defunc_0_f_res_217057;\n                \n                if (cond_217037) {\n                    defunc_0_f_res_217057 = 0.0;\n                } else {\n                    int64_t i_217058 = add64(gtid_216996, x_217028);\n                    double defunc_0_add_arg_217059;\n                    \n                    defunc_0_add_arg_217059 = ((__global\n                                                double *) mem_229634)[gtid_216993 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_216994 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_217058];\n                    defunc_0_f_res_217057 = defunc_0_add_arg_217059;\n                }\n                \n                double x_217060 = a12_217030 * tmp4_217054;\n                double y_217061 = b12_217031 * defunc_1_f_res_217055;\n                double x_217062 = x_217060 + y_217061;\n                double y_217063 = c12_217032 * defunc_1_f_res_217056;\n                double x_217064 = x_217062 ",
                   "+ y_217063;\n                double defunc_9_fit_fun_res_217065 = defunc_0_f_res_217057 *\n                       x_217064;\n                double x_217066 = b12_217031 * tmp4_217054;\n                double y_217067 = b2_217033 * defunc_1_f_res_217055;\n                double x_217068 = x_217066 + y_217067;\n                double y_217069 = c2_217034 * defunc_1_f_res_217056;\n                double x_217070 = x_217068 + y_217069;\n                double defunc_9_slope_fun_res_217071 = defunc_0_f_res_217057 *\n                       x_217070;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_216998 = x_acc_234074;\n                    x_216999 = x_acc_234075;\n                }\n                // load new values\n                {\n                    x_217000 = defunc_9_fit_fun_res_217065;\n                    x_217001 = defunc_9_slope_fun_res_217071;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_217002 = x_216998 + x_217000;\n                    double defunc_1_op_res_217003 = x_216999 + x_217001;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_234074 = defunc_1_op_res_217002;\n                        x_acc_234075 = defunc_1_op_res_217003;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_216998 = x_acc_234074;\n            x_216999 = x_acc_234075;\n            ((__local\n              double *) red_arr_mem_234057)[sext_i32_i64(local_tid_234053)] =\n                x_216998;\n            ((__local\n              double *) red_arr_mem_234059)[sext_i32_i64(local_tid_234053)] =\n                x_216999;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_234084;\n        int32_t skip_waves_234085 = 1;\n        d",
                   "ouble x_234077;\n        double x_234078;\n        double x_234079;\n        double x_234080;\n        \n        offset_234084 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_234053,\n                      sext_i64_i32(segred_group_sizze_216988))) {\n                x_234077 = ((__local\n                             double *) red_arr_mem_234057)[sext_i32_i64(local_tid_234053 +\n                                                           offset_234084)];\n                x_234078 = ((__local\n                             double *) red_arr_mem_234059)[sext_i32_i64(local_tid_234053 +\n                                                           offset_234084)];\n            }\n        }\n        offset_234084 = 1;\n        while (slt32(offset_234084, wave_sizze_234055)) {\n            if (slt32(local_tid_234053 + offset_234084,\n                      sext_i64_i32(segred_group_sizze_216988)) &&\n                ((local_tid_234053 - squot32(local_tid_234053,\n                                             wave_sizze_234055) *\n                  wave_sizze_234055) & (2 * offset_234084 - 1)) == 0) {\n                // read array element\n                {\n                    x_234079 = ((volatile __local\n                                 double *) red_arr_mem_234057)[sext_i32_i64(local_tid_234053 +\n                                                               offset_234084)];\n                    x_234080 = ((volatile __local\n                                 double *) red_arr_mem_234059)[sext_i32_i64(local_tid_234053 +\n                                                               offset_234084)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234081 = x_234077 + x_234079;\n                    double defunc_1_op_res_234082 = x_234078 + x_234080;\n                    \n                    x_234077 = defunc_1_op_res_234081;\n                    x_234078 = defunc_1_op_res_234",
                   "082;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_234057)[sext_i32_i64(local_tid_234053)] =\n                        x_234077;\n                    ((volatile __local\n                      double *) red_arr_mem_234059)[sext_i32_i64(local_tid_234053)] =\n                        x_234078;\n                }\n            }\n            offset_234084 *= 2;\n        }\n        while (slt32(skip_waves_234085,\n                     squot32(sext_i64_i32(segred_group_sizze_216988) +\n                             wave_sizze_234055 - 1, wave_sizze_234055))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_234084 = skip_waves_234085 * wave_sizze_234055;\n            if (slt32(local_tid_234053 + offset_234084,\n                      sext_i64_i32(segred_group_sizze_216988)) &&\n                ((local_tid_234053 - squot32(local_tid_234053,\n                                             wave_sizze_234055) *\n                  wave_sizze_234055) == 0 && (squot32(local_tid_234053,\n                                                      wave_sizze_234055) & (2 *\n                                                                            skip_waves_234085 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_234079 = ((__local\n                                 double *) red_arr_mem_234057)[sext_i32_i64(local_tid_234053 +\n                                                               offset_234084)];\n                    x_234080 = ((__local\n                                 double *) red_arr_mem_234059)[sext_i32_i64(local_tid_234053 +\n                                                               offset_234084)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234081 = x",
                   "_234077 + x_234079;\n                    double defunc_1_op_res_234082 = x_234078 + x_234080;\n                    \n                    x_234077 = defunc_1_op_res_234081;\n                    x_234078 = defunc_1_op_res_234082;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_234057)[sext_i32_i64(local_tid_234053)] =\n                        x_234077;\n                    ((__local\n                      double *) red_arr_mem_234059)[sext_i32_i64(local_tid_234053)] =\n                        x_234078;\n                }\n            }\n            skip_waves_234085 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_234053) == (int64_t) 0) {\n                x_acc_234074 = x_234077;\n                x_acc_234075 = x_234078;\n            }\n        }\n        if (groups_per_segment_234041 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_234053 == 0) {\n                    ((__global double *) mem_230487)[gtid_216993 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_216994 *\n                                                     s_n_m_203726 +\n                                                     gtid_216995] =\n                        x_acc_234074;\n                    ((__global double *) mem_230492)[gtid_216993 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_216994 *\n                                                     s_n_m_203726 +\n                                                     gtid_216995] =\n         ",
                   "               x_acc_234075;\n                }\n            }\n        } else {\n            int32_t old_counter_234086;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_234053 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_234046)[sext_i32_i64(virt_group_id_234065)] =\n                        x_acc_234074;\n                    ((__global\n                      double *) segred_tmp_mem_234048)[sext_i32_i64(virt_group_id_234065)] =\n                        x_acc_234075;\n                    mem_fence_global();\n                    old_counter_234086 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234050)[sext_i32_i64(srem32(flat_segment_id_234066,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_234061)[(int64_t) 0] =\n                        old_counter_234086 == groups_per_segment_234041 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_234087;\n            \n            is_last_group_234087 = ((__local\n                                     bool *) sync_arr_mem_234061)[(int64_t) 0];\n            if (is_last_group_234087) {\n                if (local_tid_234053 == 0) {\n                    old_counter_234086 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234050)[sext_i32_i64(srem32(flat_segment_id_234066,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n ",
                   "                                                    groups_per_segment_234041));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_234088 =\n                            sdiv_up64(groups_per_segment_234041,\n                                      segred_group_sizze_216988);\n                    \n                    x_216998 = 0.0;\n                    x_216999 = 0.0;\n                    for (int64_t i_234089 = 0; i_234089 <\n                         read_per_thread_234088; i_234089++) {\n                        int64_t group_res_id_234090 =\n                                sext_i32_i64(local_tid_234053) *\n                                read_per_thread_234088 + i_234089;\n                        int64_t index_of_group_res_234091 =\n                                sext_i32_i64(flat_segment_id_234066) *\n                                groups_per_segment_234041 + group_res_id_234090;\n                        \n                        if (slt64(group_res_id_234090,\n                                  groups_per_segment_234041)) {\n                            x_217000 = ((__global\n                                         double *) segred_tmp_mem_234046)[index_of_group_res_234091];\n                            x_217001 = ((__global\n                                         double *) segred_tmp_mem_234048)[index_of_group_res_234091];\n                            \n                            double defunc_1_op_res_217002 = x_216998 + x_217000;\n                            double defunc_1_op_res_217003 = x_216999 + x_217001;\n                            \n                            x_216998 = defunc_1_op_res_217002;\n                            x_216999 = defunc_1_op_res_217003;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_234057)[sext_i32_i64(local_tid_234053)] =\n                    x_216998;\n                ((__local\n              ",
                   "    double *) red_arr_mem_234059)[sext_i32_i64(local_tid_234053)] =\n                    x_216999;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_234092;\n                    int32_t skip_waves_234093 = 1;\n                    double x_234077;\n                    double x_234078;\n                    double x_234079;\n                    double x_234080;\n                    \n                    offset_234092 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_234053,\n                                  sext_i64_i32(segred_group_sizze_216988))) {\n                            x_234077 = ((__local\n                                         double *) red_arr_mem_234057)[sext_i32_i64(local_tid_234053 +\n                                                                       offset_234092)];\n                            x_234078 = ((__local\n                                         double *) red_arr_mem_234059)[sext_i32_i64(local_tid_234053 +\n                                                                       offset_234092)];\n                        }\n                    }\n                    offset_234092 = 1;\n                    while (slt32(offset_234092, wave_sizze_234055)) {\n                        if (slt32(local_tid_234053 + offset_234092,\n                                  sext_i64_i32(segred_group_sizze_216988)) &&\n                            ((local_tid_234053 - squot32(local_tid_234053,\n                                                         wave_sizze_234055) *\n                              wave_sizze_234055) & (2 * offset_234092 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_234079 = ((volatile __local\n                                             double *) red_arr_mem_234057)[s",
                   "ext_i32_i64(local_tid_234053 +\n                                                                           offset_234092)];\n                                x_234080 = ((volatile __local\n                                             double *) red_arr_mem_234059)[sext_i32_i64(local_tid_234053 +\n                                                                           offset_234092)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234081 = x_234077 +\n                                       x_234079;\n                                double defunc_1_op_res_234082 = x_234078 +\n                                       x_234080;\n                                \n                                x_234077 = defunc_1_op_res_234081;\n                                x_234078 = defunc_1_op_res_234082;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234057)[sext_i32_i64(local_tid_234053)] =\n                                    x_234077;\n                                ((volatile __local\n                                  double *) red_arr_mem_234059)[sext_i32_i64(local_tid_234053)] =\n                                    x_234078;\n                            }\n                        }\n                        offset_234092 *= 2;\n                    }\n                    while (slt32(skip_waves_234093,\n                                 squot32(sext_i64_i32(segred_group_sizze_216988) +\n                                         wave_sizze_234055 - 1,\n                                         wave_sizze_234055))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_234092 = skip_waves_234093 * wave_sizze_234055;\n                        if (slt32(local_tid_234053 + offset",
                   "_234092,\n                                  sext_i64_i32(segred_group_sizze_216988)) &&\n                            ((local_tid_234053 - squot32(local_tid_234053,\n                                                         wave_sizze_234055) *\n                              wave_sizze_234055) == 0 &&\n                             (squot32(local_tid_234053, wave_sizze_234055) &\n                              (2 * skip_waves_234093 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_234079 = ((__local\n                                             double *) red_arr_mem_234057)[sext_i32_i64(local_tid_234053 +\n                                                                           offset_234092)];\n                                x_234080 = ((__local\n                                             double *) red_arr_mem_234059)[sext_i32_i64(local_tid_234053 +\n                                                                           offset_234092)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234081 = x_234077 +\n                                       x_234079;\n                                double defunc_1_op_res_234082 = x_234078 +\n                                       x_234080;\n                                \n                                x_234077 = defunc_1_op_res_234081;\n                                x_234078 = defunc_1_op_res_234082;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_234057)[sext_i32_i64(local_tid_234053)] =\n                                    x_234077;\n                                ((__local\n                                  double *) red_arr_mem_234059)[sext_i32_i64(local_tid_234053)] =",
                   "\n                                    x_234078;\n                            }\n                        }\n                        skip_waves_234093 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_234053 == 0) {\n                            ((__global double *) mem_230487)[gtid_216993 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_216994 *\n                                                             s_n_m_203726 +\n                                                             gtid_216995] =\n                                x_234077;\n                            ((__global double *) mem_230492)[gtid_216993 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_216994 *\n                                                             s_n_m_203726 +\n                                                             gtid_216995] =\n                                x_234078;\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_216988\n}\n__kernel void mainzisegred_large_218721(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_234254_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234252_backing_aligned_1,\n                                        int64_t n_p_203574,\n                                        int64_t par",
                   "tition_sizze_203667,\n                                        int64_t C_len_203724,\n                                        int64_t num_groups_218716,\n                                        int64_t groups_per_segment_234238,\n                                        int64_t elements_per_thread_234239,\n                                        int64_t virt_num_groups_234240,\n                                        int64_t threads_per_segment_234242,\n                                        __global unsigned char *mem_230608,\n                                        __global unsigned char *mem_230619,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234243,\n                                        __global\n                                        unsigned char *mainzicounter_mem_234245)\n{\n    #define segred_group_sizze_218715 (mainzisegred_group_sizze_218698)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict sync_arr_mem_234254_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_234254_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_234252_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234252_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234247;\n    int32_t local_tid_234248;\n    int64_t group_sizze_234251;\n    int32_t wave_sizze_234250;\n    int32_t group_tid_234249;\n    \n    global_tid_234247 = get_global_id(0);\n    local_tid_234248 = get_local_id(0);\n    group_sizze_234251 = get_local_size(0);\n    wave_sizze_234250 = LOCKSTEP_WIDTH;\n    group_tid_234249 = get_group_id(0);\n    \n    int32_t phys_tid_218721 = global_tid_234247;\n    __local unsigned char *red_arr_mem_234252;\n    \n    ",
                   "red_arr_mem_234252 = (__local unsigned char *) red_arr_mem_234252_backing_0;\n    \n    __local unsigned char *sync_arr_mem_234254;\n    \n    sync_arr_mem_234254 = (__local\n                           unsigned char *) sync_arr_mem_234254_backing_1;\n    \n    int32_t phys_group_id_234256;\n    \n    phys_group_id_234256 = get_group_id(0);\n    for (int32_t i_234257 = 0; i_234257 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_234240) - phys_group_id_234256,\n                   sext_i64_i32(num_groups_218716)); i_234257++) {\n        int32_t virt_group_id_234258 = phys_group_id_234256 + i_234257 *\n                sext_i64_i32(num_groups_218716);\n        int32_t flat_segment_id_234259 = squot32(virt_group_id_234258,\n                                                 sext_i64_i32(groups_per_segment_234238));\n        int64_t global_tid_234260 = srem64(sext_i32_i64(virt_group_id_234258) *\n                                           segred_group_sizze_218715 +\n                                           sext_i32_i64(local_tid_234248),\n                                           segred_group_sizze_218715 *\n                                           groups_per_segment_234238);\n        int64_t slice_234261 = partition_sizze_203667;\n        int64_t gtid_218719 = sext_i32_i64(flat_segment_id_234259);\n        int64_t remnant_234262 = sext_i32_i64(flat_segment_id_234259) -\n                gtid_218719;\n        int64_t gtid_218720;\n        double x_acc_234263;\n        int64_t chunk_sizze_234264 = smin64(elements_per_thread_234239,\n                                            sdiv_up64(n_p_203574 -\n                                                      global_tid_234260,\n                                                      threads_per_segment_234242));\n        double x_218722;\n        double x_218723;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_234263 = 0.0;\n        }\n        for (int64_t i_234268 = 0; i_234268 < chunk_sizze_234264; i_234268++) {\n          ",
                   "  gtid_218720 = global_tid_234260 + threads_per_segment_234242 *\n                i_234268;\n            // apply map function\n            {\n                double x_218726;\n                \n                x_218726 = ((__global double *) mem_230608)[gtid_218719 *\n                                                            C_len_203724 +\n                                                            gtid_218720];\n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_218722 = x_acc_234263;\n                }\n                // load new values\n                {\n                    x_218723 = x_218726;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_218724 = x_218722 + x_218723;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_234263 = defunc_1_op_res_218724;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_218722 = x_acc_234263;\n            ((__local\n              double *) red_arr_mem_234252)[sext_i32_i64(local_tid_234248)] =\n                x_218722;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_234269;\n        int32_t skip_waves_234270 = 1;\n        double x_234265;\n        double x_234266;\n        \n        offset_234269 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_234248,\n                      sext_i64_i32(segred_group_sizze_218715))) {\n                x_234265 = ((__local\n                             double *) red_arr_mem_234252)[sext_i32_i64(local_tid_234248 +\n                                                           offset_234269)];\n            }\n        }\n        offset_234269 = 1;\n        while (slt32(offset_234269, wave_sizze_234250)) {\n        ",
                   "    if (slt32(local_tid_234248 + offset_234269,\n                      sext_i64_i32(segred_group_sizze_218715)) &&\n                ((local_tid_234248 - squot32(local_tid_234248,\n                                             wave_sizze_234250) *\n                  wave_sizze_234250) & (2 * offset_234269 - 1)) == 0) {\n                // read array element\n                {\n                    x_234266 = ((volatile __local\n                                 double *) red_arr_mem_234252)[sext_i32_i64(local_tid_234248 +\n                                                               offset_234269)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234267 = x_234265 + x_234266;\n                    \n                    x_234265 = defunc_1_op_res_234267;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_234252)[sext_i32_i64(local_tid_234248)] =\n                        x_234265;\n                }\n            }\n            offset_234269 *= 2;\n        }\n        while (slt32(skip_waves_234270,\n                     squot32(sext_i64_i32(segred_group_sizze_218715) +\n                             wave_sizze_234250 - 1, wave_sizze_234250))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_234269 = skip_waves_234270 * wave_sizze_234250;\n            if (slt32(local_tid_234248 + offset_234269,\n                      sext_i64_i32(segred_group_sizze_218715)) &&\n                ((local_tid_234248 - squot32(local_tid_234248,\n                                             wave_sizze_234250) *\n                  wave_sizze_234250) == 0 && (squot32(local_tid_234248,\n                                                      wave_sizze_234250) & (2 *\n                                                                            skip_waves_234270 -\n                                                                  ",
                   "          1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_234266 = ((__local\n                                 double *) red_arr_mem_234252)[sext_i32_i64(local_tid_234248 +\n                                                               offset_234269)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234267 = x_234265 + x_234266;\n                    \n                    x_234265 = defunc_1_op_res_234267;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_234252)[sext_i32_i64(local_tid_234248)] =\n                        x_234265;\n                }\n            }\n            skip_waves_234270 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_234248) == (int64_t) 0) {\n                x_acc_234263 = x_234265;\n            }\n        }\n        if (groups_per_segment_234238 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_234248 == 0) {\n                    ((__global double *) mem_230619)[gtid_218719] =\n                        x_acc_234263;\n                }\n            }\n        } else {\n            int32_t old_counter_234271;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_234248 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_234243)[sext_i32_i64(virt_group_id_234258)] =\n                        x_acc_234263;\n                    mem_fence_global();\n                    old_counter_234271 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234245)[se",
                   "xt_i32_i64(srem32(flat_segment_id_234259,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_234254)[(int64_t) 0] =\n                        old_counter_234271 == groups_per_segment_234238 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_234272;\n            \n            is_last_group_234272 = ((__local\n                                     bool *) sync_arr_mem_234254)[(int64_t) 0];\n            if (is_last_group_234272) {\n                if (local_tid_234248 == 0) {\n                    old_counter_234271 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234245)[sext_i32_i64(srem32(flat_segment_id_234259,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_234238));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_234273 =\n                            sdiv_up64(groups_per_segment_234238,\n                                      segred_group_sizze_218715);\n                    \n                    x_218722 = 0.0;\n                    for (int64_t i_234274 = 0; i_234274 <\n                         read_per_thread_234273; i_234274++) {\n                        int64_t group_res_id_234275 =\n                                sext_i32_i64(local_tid_234248) *\n                                read_per_thread_234273 + i_234274;\n                        int64_t index_of_group_res_234276 =\n                                sext_i32_i64(",
                   "flat_segment_id_234259) *\n                                groups_per_segment_234238 + group_res_id_234275;\n                        \n                        if (slt64(group_res_id_234275,\n                                  groups_per_segment_234238)) {\n                            x_218723 = ((__global\n                                         double *) segred_tmp_mem_234243)[index_of_group_res_234276];\n                            \n                            double defunc_1_op_res_218724 = x_218722 + x_218723;\n                            \n                            x_218722 = defunc_1_op_res_218724;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_234252)[sext_i32_i64(local_tid_234248)] =\n                    x_218722;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_234277;\n                    int32_t skip_waves_234278 = 1;\n                    double x_234265;\n                    double x_234266;\n                    \n                    offset_234277 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_234248,\n                                  sext_i64_i32(segred_group_sizze_218715))) {\n                            x_234265 = ((__local\n                                         double *) red_arr_mem_234252)[sext_i32_i64(local_tid_234248 +\n                                                                       offset_234277)];\n                        }\n                    }\n                    offset_234277 = 1;\n                    while (slt32(offset_234277, wave_sizze_234250)) {\n                        if (slt32(local_tid_234248 + offset_234277,\n                                  sext_i64_i32(segred_group_sizze_218715)) &&\n                            ((local_tid_234248 - squot32(local_tid_234248,\n           ",
                   "                                              wave_sizze_234250) *\n                              wave_sizze_234250) & (2 * offset_234277 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_234266 = ((volatile __local\n                                             double *) red_arr_mem_234252)[sext_i32_i64(local_tid_234248 +\n                                                                           offset_234277)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234267 = x_234265 +\n                                       x_234266;\n                                \n                                x_234265 = defunc_1_op_res_234267;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234252)[sext_i32_i64(local_tid_234248)] =\n                                    x_234265;\n                            }\n                        }\n                        offset_234277 *= 2;\n                    }\n                    while (slt32(skip_waves_234278,\n                                 squot32(sext_i64_i32(segred_group_sizze_218715) +\n                                         wave_sizze_234250 - 1,\n                                         wave_sizze_234250))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_234277 = skip_waves_234278 * wave_sizze_234250;\n                        if (slt32(local_tid_234248 + offset_234277,\n                                  sext_i64_i32(segred_group_sizze_218715)) &&\n                            ((local_tid_234248 - squot32(local_tid_234248,\n                                                         wave_sizze_234250) *\n          ",
                   "                    wave_sizze_234250) == 0 &&\n                             (squot32(local_tid_234248, wave_sizze_234250) &\n                              (2 * skip_waves_234278 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_234266 = ((__local\n                                             double *) red_arr_mem_234252)[sext_i32_i64(local_tid_234248 +\n                                                                           offset_234277)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234267 = x_234265 +\n                                       x_234266;\n                                \n                                x_234265 = defunc_1_op_res_234267;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_234252)[sext_i32_i64(local_tid_234248)] =\n                                    x_234265;\n                            }\n                        }\n                        skip_waves_234278 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_234248 == 0) {\n                            ((__global double *) mem_230619)[gtid_218719] =\n                                x_234265;\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_218715\n}\n__kernel void mainzisegred_large_218852(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_234397_backing_aligned_0,\n          ",
                   "                              __local volatile\n                                        int64_t *red_arr_mem_234395_backing_aligned_1,\n                                        int64_t n_p_203574,\n                                        int64_t partition_sizze_203667,\n                                        int64_t lifted_single_ma_l_arg_204224,\n                                        int64_t num_groups_218847,\n                                        int64_t groups_per_segment_234381,\n                                        int64_t elements_per_thread_234382,\n                                        int64_t virt_num_groups_234383,\n                                        int64_t threads_per_segment_234385,\n                                        __global unsigned char *mem_230625,\n                                        __global unsigned char *mem_230636,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234386,\n                                        __global\n                                        unsigned char *mainzicounter_mem_234388)\n{\n    #define segred_group_sizze_218846 (mainzisegred_group_sizze_218829)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict sync_arr_mem_234397_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_234397_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_234395_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234395_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234390;\n    int32_t local_tid_234391;\n    int64_t group_sizze_234394;\n    int32_t wave_sizze_234393;\n    int32_t group_tid_234392;\n    \n    global_tid_234390 = get_global_id(0);\n    local_ti",
                   "d_234391 = get_local_id(0);\n    group_sizze_234394 = get_local_size(0);\n    wave_sizze_234393 = LOCKSTEP_WIDTH;\n    group_tid_234392 = get_group_id(0);\n    \n    int32_t phys_tid_218852 = global_tid_234390;\n    __local unsigned char *red_arr_mem_234395;\n    \n    red_arr_mem_234395 = (__local unsigned char *) red_arr_mem_234395_backing_0;\n    \n    __local unsigned char *sync_arr_mem_234397;\n    \n    sync_arr_mem_234397 = (__local\n                           unsigned char *) sync_arr_mem_234397_backing_1;\n    \n    int32_t phys_group_id_234399;\n    \n    phys_group_id_234399 = get_group_id(0);\n    for (int32_t i_234400 = 0; i_234400 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_234383) - phys_group_id_234399,\n                   sext_i64_i32(num_groups_218847)); i_234400++) {\n        int32_t virt_group_id_234401 = phys_group_id_234399 + i_234400 *\n                sext_i64_i32(num_groups_218847);\n        int32_t flat_segment_id_234402 = squot32(virt_group_id_234401,\n                                                 sext_i64_i32(groups_per_segment_234381));\n        int64_t global_tid_234403 = srem64(sext_i32_i64(virt_group_id_234401) *\n                                           segred_group_sizze_218846 +\n                                           sext_i32_i64(local_tid_234391),\n                                           segred_group_sizze_218846 *\n                                           groups_per_segment_234381);\n        int64_t slice_234404 = partition_sizze_203667;\n        int64_t gtid_218850 = sext_i32_i64(flat_segment_id_234402);\n        int64_t remnant_234405 = sext_i32_i64(flat_segment_id_234402) -\n                gtid_218850;\n        int64_t gtid_218851;\n        double x_acc_234406;\n        int64_t chunk_sizze_234407 = smin64(elements_per_thread_234382,\n                                            sdiv_up64(n_p_203574 -\n                                                      global_tid_234403,\n                                                      threads_per_segm",
                   "ent_234385));\n        double x_218853;\n        double x_218854;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_234406 = 0.0;\n        }\n        for (int64_t i_234411 = 0; i_234411 < chunk_sizze_234407; i_234411++) {\n            gtid_218851 = global_tid_234403 + threads_per_segment_234385 *\n                i_234411;\n            // apply map function\n            {\n                double x_218857;\n                \n                x_218857 = ((__global double *) mem_230625)[gtid_218850 *\n                                                            lifted_single_ma_l_arg_204224 +\n                                                            gtid_218851];\n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_218853 = x_acc_234406;\n                }\n                // load new values\n                {\n                    x_218854 = x_218857;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_218855 = x_218853 + x_218854;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_234406 = defunc_1_op_res_218855;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_218853 = x_acc_234406;\n            ((__local\n              double *) red_arr_mem_234395)[sext_i32_i64(local_tid_234391)] =\n                x_218853;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_234412;\n        int32_t skip_waves_234413 = 1;\n        double x_234408;\n        double x_234409;\n        \n        offset_234412 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_234391,\n                      sext_i64_i32(segred_group_sizze_218846))) {\n                x_234408 = ((__local\n     ",
                   "                        double *) red_arr_mem_234395)[sext_i32_i64(local_tid_234391 +\n                                                           offset_234412)];\n            }\n        }\n        offset_234412 = 1;\n        while (slt32(offset_234412, wave_sizze_234393)) {\n            if (slt32(local_tid_234391 + offset_234412,\n                      sext_i64_i32(segred_group_sizze_218846)) &&\n                ((local_tid_234391 - squot32(local_tid_234391,\n                                             wave_sizze_234393) *\n                  wave_sizze_234393) & (2 * offset_234412 - 1)) == 0) {\n                // read array element\n                {\n                    x_234409 = ((volatile __local\n                                 double *) red_arr_mem_234395)[sext_i32_i64(local_tid_234391 +\n                                                               offset_234412)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234410 = x_234408 + x_234409;\n                    \n                    x_234408 = defunc_1_op_res_234410;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_234395)[sext_i32_i64(local_tid_234391)] =\n                        x_234408;\n                }\n            }\n            offset_234412 *= 2;\n        }\n        while (slt32(skip_waves_234413,\n                     squot32(sext_i64_i32(segred_group_sizze_218846) +\n                             wave_sizze_234393 - 1, wave_sizze_234393))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_234412 = skip_waves_234413 * wave_sizze_234393;\n            if (slt32(local_tid_234391 + offset_234412,\n                      sext_i64_i32(segred_group_sizze_218846)) &&\n                ((local_tid_234391 - squot32(local_tid_234391,\n                                             wave_sizze_234393) *\n                  wave_sizze_234393",
                   ") == 0 && (squot32(local_tid_234391,\n                                                      wave_sizze_234393) & (2 *\n                                                                            skip_waves_234413 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_234409 = ((__local\n                                 double *) red_arr_mem_234395)[sext_i32_i64(local_tid_234391 +\n                                                               offset_234412)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234410 = x_234408 + x_234409;\n                    \n                    x_234408 = defunc_1_op_res_234410;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_234395)[sext_i32_i64(local_tid_234391)] =\n                        x_234408;\n                }\n            }\n            skip_waves_234413 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_234391) == (int64_t) 0) {\n                x_acc_234406 = x_234408;\n            }\n        }\n        if (groups_per_segment_234381 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_234391 == 0) {\n                    ((__global double *) mem_230636)[gtid_218850] =\n                        x_acc_234406;\n                }\n            }\n        } else {\n            int32_t old_counter_234414;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_234391 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_234386)[sext_i32_i64(virt_group_id_23",
                   "4401)] =\n                        x_acc_234406;\n                    mem_fence_global();\n                    old_counter_234414 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234388)[sext_i32_i64(srem32(flat_segment_id_234402,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_234397)[(int64_t) 0] =\n                        old_counter_234414 == groups_per_segment_234381 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_234415;\n            \n            is_last_group_234415 = ((__local\n                                     bool *) sync_arr_mem_234397)[(int64_t) 0];\n            if (is_last_group_234415) {\n                if (local_tid_234391 == 0) {\n                    old_counter_234414 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234388)[sext_i32_i64(srem32(flat_segment_id_234402,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_234381));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_234416 =\n                            sdiv_up64(groups_per_segment_234381,\n                                      segred_group_sizze_218846);\n                    \n                    x_218853 = 0.0;\n                    for (int64_t i_234417 = 0; i_234417 <\n                         read_per_thread_234416; i_234417++) {\n            ",
                   "            int64_t group_res_id_234418 =\n                                sext_i32_i64(local_tid_234391) *\n                                read_per_thread_234416 + i_234417;\n                        int64_t index_of_group_res_234419 =\n                                sext_i32_i64(flat_segment_id_234402) *\n                                groups_per_segment_234381 + group_res_id_234418;\n                        \n                        if (slt64(group_res_id_234418,\n                                  groups_per_segment_234381)) {\n                            x_218854 = ((__global\n                                         double *) segred_tmp_mem_234386)[index_of_group_res_234419];\n                            \n                            double defunc_1_op_res_218855 = x_218853 + x_218854;\n                            \n                            x_218853 = defunc_1_op_res_218855;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_234395)[sext_i32_i64(local_tid_234391)] =\n                    x_218853;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_234420;\n                    int32_t skip_waves_234421 = 1;\n                    double x_234408;\n                    double x_234409;\n                    \n                    offset_234420 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_234391,\n                                  sext_i64_i32(segred_group_sizze_218846))) {\n                            x_234408 = ((__local\n                                         double *) red_arr_mem_234395)[sext_i32_i64(local_tid_234391 +\n                                                                       offset_234420)];\n                        }\n                    }\n                    offset_234420 = 1;\n                    whi",
                   "le (slt32(offset_234420, wave_sizze_234393)) {\n                        if (slt32(local_tid_234391 + offset_234420,\n                                  sext_i64_i32(segred_group_sizze_218846)) &&\n                            ((local_tid_234391 - squot32(local_tid_234391,\n                                                         wave_sizze_234393) *\n                              wave_sizze_234393) & (2 * offset_234420 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_234409 = ((volatile __local\n                                             double *) red_arr_mem_234395)[sext_i32_i64(local_tid_234391 +\n                                                                           offset_234420)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234410 = x_234408 +\n                                       x_234409;\n                                \n                                x_234408 = defunc_1_op_res_234410;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234395)[sext_i32_i64(local_tid_234391)] =\n                                    x_234408;\n                            }\n                        }\n                        offset_234420 *= 2;\n                    }\n                    while (slt32(skip_waves_234421,\n                                 squot32(sext_i64_i32(segred_group_sizze_218846) +\n                                         wave_sizze_234393 - 1,\n                                         wave_sizze_234393))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_234420 = skip_waves_234421 * wave_sizze_234393;\n                        if (sl",
                   "t32(local_tid_234391 + offset_234420,\n                                  sext_i64_i32(segred_group_sizze_218846)) &&\n                            ((local_tid_234391 - squot32(local_tid_234391,\n                                                         wave_sizze_234393) *\n                              wave_sizze_234393) == 0 &&\n                             (squot32(local_tid_234391, wave_sizze_234393) &\n                              (2 * skip_waves_234421 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_234409 = ((__local\n                                             double *) red_arr_mem_234395)[sext_i32_i64(local_tid_234391 +\n                                                                           offset_234420)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234410 = x_234408 +\n                                       x_234409;\n                                \n                                x_234408 = defunc_1_op_res_234410;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_234395)[sext_i32_i64(local_tid_234391)] =\n                                    x_234408;\n                            }\n                        }\n                        skip_waves_234421 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_234391 == 0) {\n                            ((__global double *) mem_230636)[gtid_218850] =\n                                x_234408;\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_218846\n}\n__kernel void mainzisegred_large_218983(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_234540_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234538_backing_aligned_1,\n                                        int64_t partition_sizze_203667,\n                                        int64_t dyn_lifted_single_ma_l_arg_204234,\n                                        int64_t num_groups_218978,\n                                        int64_t groups_per_segment_234524,\n                                        int64_t elements_per_thread_234525,\n                                        int64_t virt_num_groups_234526,\n                                        int64_t threads_per_segment_234528,\n                                        __global unsigned char *mem_230642,\n                                        __global unsigned char *mem_230653,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234529,\n                                        __global\n                                        unsigned char *mainzicounter_mem_234531)\n{\n    #define segred_group_sizze_218977 (mainzisegred_group_sizze_218960)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict sync_arr_mem_234540_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_234540_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_234538_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234538_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        ret",
                   "urn;\n    \n    int32_t global_tid_234533;\n    int32_t local_tid_234534;\n    int64_t group_sizze_234537;\n    int32_t wave_sizze_234536;\n    int32_t group_tid_234535;\n    \n    global_tid_234533 = get_global_id(0);\n    local_tid_234534 = get_local_id(0);\n    group_sizze_234537 = get_local_size(0);\n    wave_sizze_234536 = LOCKSTEP_WIDTH;\n    group_tid_234535 = get_group_id(0);\n    \n    int32_t phys_tid_218983 = global_tid_234533;\n    __local unsigned char *red_arr_mem_234538;\n    \n    red_arr_mem_234538 = (__local unsigned char *) red_arr_mem_234538_backing_0;\n    \n    __local unsigned char *sync_arr_mem_234540;\n    \n    sync_arr_mem_234540 = (__local\n                           unsigned char *) sync_arr_mem_234540_backing_1;\n    \n    int32_t phys_group_id_234542;\n    \n    phys_group_id_234542 = get_group_id(0);\n    for (int32_t i_234543 = 0; i_234543 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_234526) - phys_group_id_234542,\n                   sext_i64_i32(num_groups_218978)); i_234543++) {\n        int32_t virt_group_id_234544 = phys_group_id_234542 + i_234543 *\n                sext_i64_i32(num_groups_218978);\n        int32_t flat_segment_id_234545 = squot32(virt_group_id_234544,\n                                                 sext_i64_i32(groups_per_segment_234524));\n        int64_t global_tid_234546 = srem64(sext_i32_i64(virt_group_id_234544) *\n                                           segred_group_sizze_218977 +\n                                           sext_i32_i64(local_tid_234534),\n                                           segred_group_sizze_218977 *\n                                           groups_per_segment_234524);\n        int64_t slice_234547 = partition_sizze_203667;\n        int64_t gtid_218981 = sext_i32_i64(flat_segment_id_234545);\n        int64_t remnant_234548 = sext_i32_i64(flat_segment_id_234545) -\n                gtid_218981;\n        int64_t gtid_218982;\n        double x_acc_234549;\n        int64_t chunk_sizze_234550 = smin64(elements_per_th",
                   "read_234525,\n                                            sdiv_up64((int64_t) 3 -\n                                                      global_tid_234546,\n                                                      threads_per_segment_234528));\n        double x_218984;\n        double x_218985;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_234549 = 0.0;\n        }\n        for (int64_t i_234554 = 0; i_234554 < chunk_sizze_234550; i_234554++) {\n            gtid_218982 = global_tid_234546 + threads_per_segment_234528 *\n                i_234554;\n            // apply map function\n            {\n                double x_218988;\n                \n                x_218988 = ((__global double *) mem_230642)[gtid_218981 *\n                                                            dyn_lifted_single_ma_l_arg_204234 +\n                                                            gtid_218982];\n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_218984 = x_acc_234549;\n                }\n                // load new values\n                {\n                    x_218985 = x_218988;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_218986 = x_218984 + x_218985;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_234549 = defunc_1_op_res_218986;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_218984 = x_acc_234549;\n            ((__local\n              double *) red_arr_mem_234538)[sext_i32_i64(local_tid_234534)] =\n                x_218984;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_234555;\n        int32_t skip_waves_234556 = 1;\n        double x_234551;\n        double x_234552;\n        \n        offset_",
                   "234555 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_234534,\n                      sext_i64_i32(segred_group_sizze_218977))) {\n                x_234551 = ((__local\n                             double *) red_arr_mem_234538)[sext_i32_i64(local_tid_234534 +\n                                                           offset_234555)];\n            }\n        }\n        offset_234555 = 1;\n        while (slt32(offset_234555, wave_sizze_234536)) {\n            if (slt32(local_tid_234534 + offset_234555,\n                      sext_i64_i32(segred_group_sizze_218977)) &&\n                ((local_tid_234534 - squot32(local_tid_234534,\n                                             wave_sizze_234536) *\n                  wave_sizze_234536) & (2 * offset_234555 - 1)) == 0) {\n                // read array element\n                {\n                    x_234552 = ((volatile __local\n                                 double *) red_arr_mem_234538)[sext_i32_i64(local_tid_234534 +\n                                                               offset_234555)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234553 = x_234551 + x_234552;\n                    \n                    x_234551 = defunc_1_op_res_234553;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_234538)[sext_i32_i64(local_tid_234534)] =\n                        x_234551;\n                }\n            }\n            offset_234555 *= 2;\n        }\n        while (slt32(skip_waves_234556,\n                     squot32(sext_i64_i32(segred_group_sizze_218977) +\n                             wave_sizze_234536 - 1, wave_sizze_234536))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_234555 = skip_waves_234556 * wave_sizze_234536;\n            if (slt32(local_tid_234534 + offset_234555,\n  ",
                   "                    sext_i64_i32(segred_group_sizze_218977)) &&\n                ((local_tid_234534 - squot32(local_tid_234534,\n                                             wave_sizze_234536) *\n                  wave_sizze_234536) == 0 && (squot32(local_tid_234534,\n                                                      wave_sizze_234536) & (2 *\n                                                                            skip_waves_234556 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_234552 = ((__local\n                                 double *) red_arr_mem_234538)[sext_i32_i64(local_tid_234534 +\n                                                               offset_234555)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234553 = x_234551 + x_234552;\n                    \n                    x_234551 = defunc_1_op_res_234553;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_234538)[sext_i32_i64(local_tid_234534)] =\n                        x_234551;\n                }\n            }\n            skip_waves_234556 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_234534) == (int64_t) 0) {\n                x_acc_234549 = x_234551;\n            }\n        }\n        if (groups_per_segment_234524 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_234534 == 0) {\n                    ((__global double *) mem_230653)[gtid_218981] =\n                        x_acc_234549;\n                }\n            }\n        } else {\n            int32_t old_counter_234557;\n            \n            // firs",
                   "t thread in group saves group result to global memory\n            {\n                if (local_tid_234534 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_234529)[sext_i32_i64(virt_group_id_234544)] =\n                        x_acc_234549;\n                    mem_fence_global();\n                    old_counter_234557 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234531)[sext_i32_i64(srem32(flat_segment_id_234545,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_234540)[(int64_t) 0] =\n                        old_counter_234557 == groups_per_segment_234524 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_234558;\n            \n            is_last_group_234558 = ((__local\n                                     bool *) sync_arr_mem_234540)[(int64_t) 0];\n            if (is_last_group_234558) {\n                if (local_tid_234534 == 0) {\n                    old_counter_234557 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234531)[sext_i32_i64(srem32(flat_segment_id_234545,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_234524));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_234559 =\n                            sdiv_up64(groups_per_segment_234524,\n                            ",
                   "          segred_group_sizze_218977);\n                    \n                    x_218984 = 0.0;\n                    for (int64_t i_234560 = 0; i_234560 <\n                         read_per_thread_234559; i_234560++) {\n                        int64_t group_res_id_234561 =\n                                sext_i32_i64(local_tid_234534) *\n                                read_per_thread_234559 + i_234560;\n                        int64_t index_of_group_res_234562 =\n                                sext_i32_i64(flat_segment_id_234545) *\n                                groups_per_segment_234524 + group_res_id_234561;\n                        \n                        if (slt64(group_res_id_234561,\n                                  groups_per_segment_234524)) {\n                            x_218985 = ((__global\n                                         double *) segred_tmp_mem_234529)[index_of_group_res_234562];\n                            \n                            double defunc_1_op_res_218986 = x_218984 + x_218985;\n                            \n                            x_218984 = defunc_1_op_res_218986;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_234538)[sext_i32_i64(local_tid_234534)] =\n                    x_218984;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_234563;\n                    int32_t skip_waves_234564 = 1;\n                    double x_234551;\n                    double x_234552;\n                    \n                    offset_234563 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_234534,\n                                  sext_i64_i32(segred_group_sizze_218977))) {\n                            x_234551 = ((__local\n                                         double *) red_arr_mem_234538)[se",
                   "xt_i32_i64(local_tid_234534 +\n                                                                       offset_234563)];\n                        }\n                    }\n                    offset_234563 = 1;\n                    while (slt32(offset_234563, wave_sizze_234536)) {\n                        if (slt32(local_tid_234534 + offset_234563,\n                                  sext_i64_i32(segred_group_sizze_218977)) &&\n                            ((local_tid_234534 - squot32(local_tid_234534,\n                                                         wave_sizze_234536) *\n                              wave_sizze_234536) & (2 * offset_234563 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_234552 = ((volatile __local\n                                             double *) red_arr_mem_234538)[sext_i32_i64(local_tid_234534 +\n                                                                           offset_234563)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234553 = x_234551 +\n                                       x_234552;\n                                \n                                x_234551 = defunc_1_op_res_234553;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234538)[sext_i32_i64(local_tid_234534)] =\n                                    x_234551;\n                            }\n                        }\n                        offset_234563 *= 2;\n                    }\n                    while (slt32(skip_waves_234564,\n                                 squot32(sext_i64_i32(segred_group_sizze_218977) +\n                                         wave_sizze_234536 - 1,",
                   "\n                                         wave_sizze_234536))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_234563 = skip_waves_234564 * wave_sizze_234536;\n                        if (slt32(local_tid_234534 + offset_234563,\n                                  sext_i64_i32(segred_group_sizze_218977)) &&\n                            ((local_tid_234534 - squot32(local_tid_234534,\n                                                         wave_sizze_234536) *\n                              wave_sizze_234536) == 0 &&\n                             (squot32(local_tid_234534, wave_sizze_234536) &\n                              (2 * skip_waves_234564 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_234552 = ((__local\n                                             double *) red_arr_mem_234538)[sext_i32_i64(local_tid_234534 +\n                                                                           offset_234563)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234553 = x_234551 +\n                                       x_234552;\n                                \n                                x_234551 = defunc_1_op_res_234553;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_234538)[sext_i32_i64(local_tid_234534)] =\n                                    x_234551;\n                            }\n                        }\n                        skip_waves_234564 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_234534 == 0) {\n                            ((__global double *) mem_230653)",
                   "[gtid_218981] =\n                                x_234551;\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_218977\n}\n__kernel void mainzisegred_large_219605(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_234719_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234717_backing_aligned_1,\n                                        int64_t n_203572, int64_t q_l_203577,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t l_n_m_203733, int64_t i_203760,\n                                        int64_t num_groups_219599,\n                                        int64_t ctx_param_ext_229596,\n                                        int64_t ctx_param_ext_229597,\n                                        int64_t ctx_param_ext_229599,\n                                        int64_t groups_per_segment_234703,\n                                        int64_t elements_per_thread_234704,\n                                        int64_t virt_num_groups_234705,\n                                        int64_t threads_per_segment_234707,\n                                        __global unsigned char *ext_mem_229519,\n                                        __global unsigned char *ext_mem_229520,\n                                        __global\n                                        unsigned char *mem_param_229601,\n                                        __global unsigned char *mem_230704,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234708,\n     ",
                   "                                   __global\n                                        unsigned char *mainzicounter_mem_234710)\n{\n    #define segred_group_sizze_219598 (mainzisegred_group_sizze_219350)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict sync_arr_mem_234719_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_234719_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_234717_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234717_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234712;\n    int32_t local_tid_234713;\n    int64_t group_sizze_234716;\n    int32_t wave_sizze_234715;\n    int32_t group_tid_234714;\n    \n    global_tid_234712 = get_global_id(0);\n    local_tid_234713 = get_local_id(0);\n    group_sizze_234716 = get_local_size(0);\n    wave_sizze_234715 = LOCKSTEP_WIDTH;\n    group_tid_234714 = get_group_id(0);\n    \n    int32_t phys_tid_219605 = global_tid_234712;\n    __local unsigned char *red_arr_mem_234717;\n    \n    red_arr_mem_234717 = (__local unsigned char *) red_arr_mem_234717_backing_0;\n    \n    __local unsigned char *sync_arr_mem_234719;\n    \n    sync_arr_mem_234719 = (__local\n                           unsigned char *) sync_arr_mem_234719_backing_1;\n    \n    int32_t phys_group_id_234721;\n    \n    phys_group_id_234721 = get_group_id(0);\n    for (int32_t i_234722 = 0; i_234722 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_234705) - phys_group_id_234721,\n                   sext_i64_i32(num_groups_219599)); i_234722++) {\n        int32_t virt_group_id_234723 = phys_group_id_234721 + i_234722 *\n                sext_i64_i32(num_groups_219599);\n        int32_t flat_segment_id_234724 = squot32(virt_group_id_234723,\n                  ",
                   "                               sext_i64_i32(groups_per_segment_234703));\n        int64_t global_tid_234725 = srem64(sext_i32_i64(virt_group_id_234723) *\n                                           segred_group_sizze_219598 +\n                                           sext_i32_i64(local_tid_234713),\n                                           segred_group_sizze_219598 *\n                                           groups_per_segment_234703);\n        int64_t slice_234726 = l_n_m_203733;\n        int64_t slice_234727 = partition_sizze_203667 * slice_234726;\n        int64_t gtid_219602 = squot64(sext_i32_i64(flat_segment_id_234724),\n                                      slice_234726);\n        int64_t remnant_234728 = sext_i32_i64(flat_segment_id_234724) -\n                gtid_219602 * slice_234726;\n        int64_t gtid_219603 = remnant_234728;\n        int64_t remnant_234729 = remnant_234728 - gtid_219603;\n        int64_t gtid_219604;\n        double x_acc_234730;\n        int64_t chunk_sizze_234731 = smin64(elements_per_thread_234704,\n                                            sdiv_up64(q_l_203577 -\n                                                      global_tid_234725,\n                                                      threads_per_segment_234707));\n        double x_219606;\n        double x_219607;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_234730 = 0.0;\n        }\n        for (int64_t i_234735 = 0; i_234735 < chunk_sizze_234731; i_234735++) {\n            gtid_219604 = global_tid_234725 + threads_per_segment_234707 *\n                i_234735;\n            // apply map function\n            {\n                int64_t x_219613;\n                \n                x_219613 = ((__global int64_t *) ext_mem_229520)[gtid_219602 *\n                                                                 l_n_m_203733 +\n                                                                 gtid_219603];\n                \n                double x_219614;\n          ",
                   "      \n                x_219614 = ((__global double *) ext_mem_229519)[gtid_219602 *\n                                                                l_n_m_203733 +\n                                                                gtid_219603];\n                \n                int64_t binop_y_228780 = mul64(jump_t_203582, gtid_219603);\n                int64_t binop_y_228781 = smin64(i_203760, binop_y_228780);\n                int64_t index_primexp_228782 = add64((int64_t) 1,\n                                                     binop_y_228781);\n                bool cond_219617 = sle64(n_203572, gtid_219604);\n                int64_t defunc_0_f_res_219618;\n                \n                if (cond_219617) {\n                    defunc_0_f_res_219618 = (int64_t) 0;\n                } else {\n                    int64_t i_219619 = add64(gtid_219604, x_219613);\n                    int64_t defunc_1_add_res_219620 = add64((int64_t) 1,\n                                                            i_219619);\n                    \n                    defunc_0_f_res_219618 = defunc_1_add_res_219620;\n                }\n                \n                double defunc_0_f_res_219621;\n                \n                if (cond_219617) {\n                    defunc_0_f_res_219621 = 0.0;\n                } else {\n                    int64_t i_219622 = add64(gtid_219604, x_219613);\n                    double defunc_0_add_arg_219623;\n                    \n                    defunc_0_add_arg_219623 = ((__global\n                                                double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                            (gtid_219602 *\n                                                                             ctx_param_ext_229597 +\n                                                                             i_219622 *\n                                                                             ctx_param_ext_229599)];\n                    ",
                   "defunc_0_f_res_219621 = defunc_0_add_arg_219623;\n                }\n                \n                int64_t binop_p_219624 = sub64(defunc_0_f_res_219618,\n                                               index_primexp_228782);\n                double defunc_0_f_res_219625 = sitofp_i64_f64(binop_p_219624);\n                double abs_res_219626 = fabs(defunc_0_f_res_219625);\n                double tmp1_219627 = abs_res_219626 / x_219614;\n                double x_219628 = tmp1_219627 * tmp1_219627;\n                double y_219629 = tmp1_219627 * x_219628;\n                double tmp2_219630 = 1.0 - y_219629;\n                double x_219631 = tmp2_219630 * tmp2_219630;\n                double tmp3_219632 = tmp2_219630 * x_219631;\n                double w_j_219633 = defunc_0_f_res_219621 * tmp3_219632;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_219606 = x_acc_234730;\n                }\n                // load new values\n                {\n                    x_219607 = w_j_219633;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_219608 = x_219606 + x_219607;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_234730 = defunc_1_op_res_219608;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_219606 = x_acc_234730;\n            ((__local\n              double *) red_arr_mem_234717)[sext_i32_i64(local_tid_234713)] =\n                x_219606;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_234736;\n        int32_t skip_waves_234737 = 1;\n        double x_234732;\n        double x_234733;\n        \n        offset_234736 = 0;\n        // participating threads read initial accumulator\n        {\n            if (s",
                   "lt32(local_tid_234713,\n                      sext_i64_i32(segred_group_sizze_219598))) {\n                x_234732 = ((__local\n                             double *) red_arr_mem_234717)[sext_i32_i64(local_tid_234713 +\n                                                           offset_234736)];\n            }\n        }\n        offset_234736 = 1;\n        while (slt32(offset_234736, wave_sizze_234715)) {\n            if (slt32(local_tid_234713 + offset_234736,\n                      sext_i64_i32(segred_group_sizze_219598)) &&\n                ((local_tid_234713 - squot32(local_tid_234713,\n                                             wave_sizze_234715) *\n                  wave_sizze_234715) & (2 * offset_234736 - 1)) == 0) {\n                // read array element\n                {\n                    x_234733 = ((volatile __local\n                                 double *) red_arr_mem_234717)[sext_i32_i64(local_tid_234713 +\n                                                               offset_234736)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234734 = x_234732 + x_234733;\n                    \n                    x_234732 = defunc_1_op_res_234734;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_234717)[sext_i32_i64(local_tid_234713)] =\n                        x_234732;\n                }\n            }\n            offset_234736 *= 2;\n        }\n        while (slt32(skip_waves_234737,\n                     squot32(sext_i64_i32(segred_group_sizze_219598) +\n                             wave_sizze_234715 - 1, wave_sizze_234715))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_234736 = skip_waves_234737 * wave_sizze_234715;\n            if (slt32(local_tid_234713 + offset_234736,\n                      sext_i64_i32(segred_group_sizze_219598)) &&\n                ((local_tid_23471",
                   "3 - squot32(local_tid_234713,\n                                             wave_sizze_234715) *\n                  wave_sizze_234715) == 0 && (squot32(local_tid_234713,\n                                                      wave_sizze_234715) & (2 *\n                                                                            skip_waves_234737 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_234733 = ((__local\n                                 double *) red_arr_mem_234717)[sext_i32_i64(local_tid_234713 +\n                                                               offset_234736)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234734 = x_234732 + x_234733;\n                    \n                    x_234732 = defunc_1_op_res_234734;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_234717)[sext_i32_i64(local_tid_234713)] =\n                        x_234732;\n                }\n            }\n            skip_waves_234737 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_234713) == (int64_t) 0) {\n                x_acc_234730 = x_234732;\n            }\n        }\n        if (groups_per_segment_234703 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_234713 == 0) {\n                    ((__global double *) mem_230704)[gtid_219602 *\n                                                     l_n_m_203733 +\n                                                     gtid_219603] =\n                        x_acc_234730;\n                }\n            }\n        } else {\n            int32_t old_counter_23",
                   "4738;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_234713 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_234708)[sext_i32_i64(virt_group_id_234723)] =\n                        x_acc_234730;\n                    mem_fence_global();\n                    old_counter_234738 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234710)[sext_i32_i64(srem32(flat_segment_id_234724,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_234719)[(int64_t) 0] =\n                        old_counter_234738 == groups_per_segment_234703 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_234739;\n            \n            is_last_group_234739 = ((__local\n                                     bool *) sync_arr_mem_234719)[(int64_t) 0];\n            if (is_last_group_234739) {\n                if (local_tid_234713 == 0) {\n                    old_counter_234738 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234710)[sext_i32_i64(srem32(flat_segment_id_234724,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_234703));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_234740 =\n                            sdiv_up64(groups_per_segmen",
                   "t_234703,\n                                      segred_group_sizze_219598);\n                    \n                    x_219606 = 0.0;\n                    for (int64_t i_234741 = 0; i_234741 <\n                         read_per_thread_234740; i_234741++) {\n                        int64_t group_res_id_234742 =\n                                sext_i32_i64(local_tid_234713) *\n                                read_per_thread_234740 + i_234741;\n                        int64_t index_of_group_res_234743 =\n                                sext_i32_i64(flat_segment_id_234724) *\n                                groups_per_segment_234703 + group_res_id_234742;\n                        \n                        if (slt64(group_res_id_234742,\n                                  groups_per_segment_234703)) {\n                            x_219607 = ((__global\n                                         double *) segred_tmp_mem_234708)[index_of_group_res_234743];\n                            \n                            double defunc_1_op_res_219608 = x_219606 + x_219607;\n                            \n                            x_219606 = defunc_1_op_res_219608;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_234717)[sext_i32_i64(local_tid_234713)] =\n                    x_219606;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_234744;\n                    int32_t skip_waves_234745 = 1;\n                    double x_234732;\n                    double x_234733;\n                    \n                    offset_234744 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_234713,\n                                  sext_i64_i32(segred_group_sizze_219598))) {\n                            x_234732 = ((__local\n                                   ",
                   "      double *) red_arr_mem_234717)[sext_i32_i64(local_tid_234713 +\n                                                                       offset_234744)];\n                        }\n                    }\n                    offset_234744 = 1;\n                    while (slt32(offset_234744, wave_sizze_234715)) {\n                        if (slt32(local_tid_234713 + offset_234744,\n                                  sext_i64_i32(segred_group_sizze_219598)) &&\n                            ((local_tid_234713 - squot32(local_tid_234713,\n                                                         wave_sizze_234715) *\n                              wave_sizze_234715) & (2 * offset_234744 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_234733 = ((volatile __local\n                                             double *) red_arr_mem_234717)[sext_i32_i64(local_tid_234713 +\n                                                                           offset_234744)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234734 = x_234732 +\n                                       x_234733;\n                                \n                                x_234732 = defunc_1_op_res_234734;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234717)[sext_i32_i64(local_tid_234713)] =\n                                    x_234732;\n                            }\n                        }\n                        offset_234744 *= 2;\n                    }\n                    while (slt32(skip_waves_234745,\n                                 squot32(sext_i64_i32(segred_group_sizze_219598) +\n                         ",
                   "                wave_sizze_234715 - 1,\n                                         wave_sizze_234715))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_234744 = skip_waves_234745 * wave_sizze_234715;\n                        if (slt32(local_tid_234713 + offset_234744,\n                                  sext_i64_i32(segred_group_sizze_219598)) &&\n                            ((local_tid_234713 - squot32(local_tid_234713,\n                                                         wave_sizze_234715) *\n                              wave_sizze_234715) == 0 &&\n                             (squot32(local_tid_234713, wave_sizze_234715) &\n                              (2 * skip_waves_234745 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_234733 = ((__local\n                                             double *) red_arr_mem_234717)[sext_i32_i64(local_tid_234713 +\n                                                                           offset_234744)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234734 = x_234732 +\n                                       x_234733;\n                                \n                                x_234732 = defunc_1_op_res_234734;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_234717)[sext_i32_i64(local_tid_234713)] =\n                                    x_234732;\n                            }\n                        }\n                        skip_waves_234745 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_234713 == 0) {\n                      ",
                   "      ((__global double *) mem_230704)[gtid_219602 *\n                                                             l_n_m_203733 +\n                                                             gtid_219603] =\n                                x_234732;\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_219598\n}\n__kernel void mainzisegred_large_219654(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_234801_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234799_backing_aligned_1,\n                                        int64_t n_203572, int64_t q_l_203577,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t l_n_m_203733, int64_t i_203760,\n                                        int64_t num_groups_219648,\n                                        int64_t ctx_param_ext_229596,\n                                        int64_t ctx_param_ext_229597,\n                                        int64_t ctx_param_ext_229599,\n                                        int64_t groups_per_segment_234785,\n                                        int64_t elements_per_thread_234786,\n                                        int64_t virt_num_groups_234787,\n                                        int64_t threads_per_segment_234789,\n                                        __global unsigned char *ext_mem_229519,\n                                        __global unsigned char *ext_mem_229520,\n                                        __global\n                                        unsigned char *mem_param_229601,\n                   ",
                   "                     __global unsigned char *mem_230659,\n                                        __global unsigned char *mem_230709,\n                                        __global unsigned char *mem_230714,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234790,\n                                        __global\n                                        unsigned char *mainzicounter_mem_234792)\n{\n    #define segred_group_sizze_219647 (mainzisegred_group_sizze_219283)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict sync_arr_mem_234801_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_234801_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_234799_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234799_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234794;\n    int32_t local_tid_234795;\n    int64_t group_sizze_234798;\n    int32_t wave_sizze_234797;\n    int32_t group_tid_234796;\n    \n    global_tid_234794 = get_global_id(0);\n    local_tid_234795 = get_local_id(0);\n    group_sizze_234798 = get_local_size(0);\n    wave_sizze_234797 = LOCKSTEP_WIDTH;\n    group_tid_234796 = get_group_id(0);\n    \n    int32_t phys_tid_219654 = global_tid_234794;\n    __local unsigned char *red_arr_mem_234799;\n    \n    red_arr_mem_234799 = (__local unsigned char *) red_arr_mem_234799_backing_0;\n    \n    __local unsigned char *sync_arr_mem_234801;\n    \n    sync_arr_mem_234801 = (__local\n                           unsigned char *) sync_arr_mem_234801_backing_1;\n    \n    int32_t phys_group_id_234803;\n    \n    phys_group_id_234803 = get_group_id(0);\n    for (int32_t i_234804 = 0; i_234804 <\n         sdiv_up3",
                   "2(sext_i64_i32(virt_num_groups_234787) - phys_group_id_234803,\n                   sext_i64_i32(num_groups_219648)); i_234804++) {\n        int32_t virt_group_id_234805 = phys_group_id_234803 + i_234804 *\n                sext_i64_i32(num_groups_219648);\n        int32_t flat_segment_id_234806 = squot32(virt_group_id_234805,\n                                                 sext_i64_i32(groups_per_segment_234785));\n        int64_t global_tid_234807 = srem64(sext_i32_i64(virt_group_id_234805) *\n                                           segred_group_sizze_219647 +\n                                           sext_i32_i64(local_tid_234795),\n                                           segred_group_sizze_219647 *\n                                           groups_per_segment_234785);\n        int64_t slice_234808 = l_n_m_203733;\n        int64_t slice_234809 = partition_sizze_203667 * slice_234808;\n        int64_t gtid_219651 = squot64(sext_i32_i64(flat_segment_id_234806),\n                                      slice_234808);\n        int64_t remnant_234810 = sext_i32_i64(flat_segment_id_234806) -\n                gtid_219651 * slice_234808;\n        int64_t gtid_219652 = remnant_234810;\n        int64_t remnant_234811 = remnant_234810 - gtid_219652;\n        int64_t gtid_219653;\n        double x_acc_234812;\n        int64_t chunk_sizze_234813 = smin64(elements_per_thread_234786,\n                                            sdiv_up64(q_l_203577 -\n                                                      global_tid_234807,\n                                                      threads_per_segment_234789));\n        double x_219655;\n        double x_219656;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_234812 = 0.0;\n        }\n        for (int64_t i_234817 = 0; i_234817 < chunk_sizze_234813; i_234817++) {\n            gtid_219653 = global_tid_234807 + threads_per_segment_234789 *\n                i_234817;\n            // apply map function\n            {\n        ",
                   "        int64_t x_219664;\n                \n                x_219664 = ((__global int64_t *) ext_mem_229520)[gtid_219651 *\n                                                                 l_n_m_203733 +\n                                                                 gtid_219652];\n                \n                double x_219665;\n                \n                x_219665 = ((__global double *) ext_mem_229519)[gtid_219651 *\n                                                                l_n_m_203733 +\n                                                                gtid_219652];\n                \n                int64_t binop_y_228775 = mul64(jump_t_203582, gtid_219652);\n                int64_t binop_y_228776 = smin64(i_203760, binop_y_228775);\n                int64_t index_primexp_228777 = add64((int64_t) 1,\n                                                     binop_y_228776);\n                double a0_219667;\n                \n                a0_219667 = ((__global double *) mem_230709)[gtid_219651 *\n                                                             l_n_m_203733 +\n                                                             gtid_219652];\n                \n                bool cond_219669 = sle64(n_203572, gtid_219653);\n                int64_t defunc_0_f_res_219670;\n                \n                if (cond_219669) {\n                    defunc_0_f_res_219670 = (int64_t) 0;\n                } else {\n                    int64_t i_219671 = add64(gtid_219653, x_219664);\n                    int64_t defunc_1_add_res_219672 = add64((int64_t) 1,\n                                                            i_219671);\n                    \n                    defunc_0_f_res_219670 = defunc_1_add_res_219672;\n                }\n                \n                double defunc_0_f_res_219673;\n                \n                if (cond_219669) {\n                    defunc_0_f_res_219673 = 0.0;\n                } else {\n                    int64_t i_219674 = add64(gtid_219653, x_219",
                   "664);\n                    double defunc_0_add_arg_219675;\n                    \n                    defunc_0_add_arg_219675 = ((__global\n                                                double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                            (gtid_219651 *\n                                                                             ctx_param_ext_229597 +\n                                                                             i_219674 *\n                                                                             ctx_param_ext_229599)];\n                    defunc_0_f_res_219673 = defunc_0_add_arg_219675;\n                }\n                \n                int64_t binop_p_219676 = sub64(defunc_0_f_res_219670,\n                                               index_primexp_228777);\n                double defunc_0_f_res_219677 = sitofp_i64_f64(binop_p_219676);\n                double abs_res_219678 = fabs(defunc_0_f_res_219677);\n                double tmp1_219679 = abs_res_219678 / x_219665;\n                double x_219680 = tmp1_219679 * tmp1_219679;\n                double y_219681 = tmp1_219679 * x_219680;\n                double tmp2_219682 = 1.0 - y_219681;\n                double x_219683 = tmp2_219682 * tmp2_219682;\n                double tmp3_219684 = tmp2_219682 * x_219683;\n                double tmp4_219685 = defunc_0_f_res_219673 * tmp3_219684;\n                double defunc_0_f_res_219686;\n                \n                if (cond_219669) {\n                    defunc_0_f_res_219686 = 0.0;\n                } else {\n                    int64_t i_219687 = add64(gtid_219653, x_219664);\n                    double defunc_0_add_arg_219688;\n                    \n                    defunc_0_add_arg_219688 = ((__global\n                                                double *) mem_230659)[gtid_219651 *\n                                                                      n_203572 +\n                         ",
                   "                                             i_219687];\n                    defunc_0_f_res_219686 = defunc_0_add_arg_219688;\n                }\n                \n                double x_219689 = a0_219667 * tmp4_219685;\n                double defunc_9_fit_fun_res_219690 = defunc_0_f_res_219686 *\n                       x_219689;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_219655 = x_acc_234812;\n                }\n                // load new values\n                {\n                    x_219656 = defunc_9_fit_fun_res_219690;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_219657 = x_219655 + x_219656;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_234812 = defunc_1_op_res_219657;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_219655 = x_acc_234812;\n            ((__local\n              double *) red_arr_mem_234799)[sext_i32_i64(local_tid_234795)] =\n                x_219655;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_234818;\n        int32_t skip_waves_234819 = 1;\n        double x_234814;\n        double x_234815;\n        \n        offset_234818 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_234795,\n                      sext_i64_i32(segred_group_sizze_219647))) {\n                x_234814 = ((__local\n                             double *) red_arr_mem_234799)[sext_i32_i64(local_tid_234795 +\n                                                           offset_234818)];\n            }\n        }\n        offset_234818 = 1;\n        while (slt32(offset_234818, wave_sizze_234797)) {\n            if (slt32(local_tid_234795 + offset_234818,",
                   "\n                      sext_i64_i32(segred_group_sizze_219647)) &&\n                ((local_tid_234795 - squot32(local_tid_234795,\n                                             wave_sizze_234797) *\n                  wave_sizze_234797) & (2 * offset_234818 - 1)) == 0) {\n                // read array element\n                {\n                    x_234815 = ((volatile __local\n                                 double *) red_arr_mem_234799)[sext_i32_i64(local_tid_234795 +\n                                                               offset_234818)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234816 = x_234814 + x_234815;\n                    \n                    x_234814 = defunc_1_op_res_234816;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_234799)[sext_i32_i64(local_tid_234795)] =\n                        x_234814;\n                }\n            }\n            offset_234818 *= 2;\n        }\n        while (slt32(skip_waves_234819,\n                     squot32(sext_i64_i32(segred_group_sizze_219647) +\n                             wave_sizze_234797 - 1, wave_sizze_234797))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_234818 = skip_waves_234819 * wave_sizze_234797;\n            if (slt32(local_tid_234795 + offset_234818,\n                      sext_i64_i32(segred_group_sizze_219647)) &&\n                ((local_tid_234795 - squot32(local_tid_234795,\n                                             wave_sizze_234797) *\n                  wave_sizze_234797) == 0 && (squot32(local_tid_234795,\n                                                      wave_sizze_234797) & (2 *\n                                                                            skip_waves_234819 -\n                                                                            1)) ==\n                 0)) {\n       ",
                   "         // read array element\n                {\n                    x_234815 = ((__local\n                                 double *) red_arr_mem_234799)[sext_i32_i64(local_tid_234795 +\n                                                               offset_234818)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234816 = x_234814 + x_234815;\n                    \n                    x_234814 = defunc_1_op_res_234816;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_234799)[sext_i32_i64(local_tid_234795)] =\n                        x_234814;\n                }\n            }\n            skip_waves_234819 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_234795) == (int64_t) 0) {\n                x_acc_234812 = x_234814;\n            }\n        }\n        if (groups_per_segment_234785 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_234795 == 0) {\n                    ((__global double *) mem_230714)[gtid_219651 *\n                                                     l_n_m_203733 +\n                                                     gtid_219652] =\n                        x_acc_234812;\n                }\n            }\n        } else {\n            int32_t old_counter_234820;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_234795 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_234790)[sext_i32_i64(virt_group_id_234805)] =\n                        x_acc_234812;\n                    mem_fence_global();\n                    old_counter_234820 =\n                        atomic_add_i32_global(&((volatile __glo",
                   "bal\n                                                 int *) mainzicounter_mem_234792)[sext_i32_i64(srem32(flat_segment_id_234806,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_234801)[(int64_t) 0] =\n                        old_counter_234820 == groups_per_segment_234785 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_234821;\n            \n            is_last_group_234821 = ((__local\n                                     bool *) sync_arr_mem_234801)[(int64_t) 0];\n            if (is_last_group_234821) {\n                if (local_tid_234795 == 0) {\n                    old_counter_234820 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234792)[sext_i32_i64(srem32(flat_segment_id_234806,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_234785));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_234822 =\n                            sdiv_up64(groups_per_segment_234785,\n                                      segred_group_sizze_219647);\n                    \n                    x_219655 = 0.0;\n                    for (int64_t i_234823 = 0; i_234823 <\n                         read_per_thread_234822; i_234823++) {\n                        int64_t group_res_id_234824 =\n                                sext_i32_i64(local_tid_234795) *\n                                read_per_thread_234822 + i_234823;\n                 ",
                   "       int64_t index_of_group_res_234825 =\n                                sext_i32_i64(flat_segment_id_234806) *\n                                groups_per_segment_234785 + group_res_id_234824;\n                        \n                        if (slt64(group_res_id_234824,\n                                  groups_per_segment_234785)) {\n                            x_219656 = ((__global\n                                         double *) segred_tmp_mem_234790)[index_of_group_res_234825];\n                            \n                            double defunc_1_op_res_219657 = x_219655 + x_219656;\n                            \n                            x_219655 = defunc_1_op_res_219657;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_234799)[sext_i32_i64(local_tid_234795)] =\n                    x_219655;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_234826;\n                    int32_t skip_waves_234827 = 1;\n                    double x_234814;\n                    double x_234815;\n                    \n                    offset_234826 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_234795,\n                                  sext_i64_i32(segred_group_sizze_219647))) {\n                            x_234814 = ((__local\n                                         double *) red_arr_mem_234799)[sext_i32_i64(local_tid_234795 +\n                                                                       offset_234826)];\n                        }\n                    }\n                    offset_234826 = 1;\n                    while (slt32(offset_234826, wave_sizze_234797)) {\n                        if (slt32(local_tid_234795 + offset_234826,\n                                  sext_i64_i32(segred_group_sizze_219647)) &",
                   "&\n                            ((local_tid_234795 - squot32(local_tid_234795,\n                                                         wave_sizze_234797) *\n                              wave_sizze_234797) & (2 * offset_234826 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_234815 = ((volatile __local\n                                             double *) red_arr_mem_234799)[sext_i32_i64(local_tid_234795 +\n                                                                           offset_234826)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234816 = x_234814 +\n                                       x_234815;\n                                \n                                x_234814 = defunc_1_op_res_234816;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234799)[sext_i32_i64(local_tid_234795)] =\n                                    x_234814;\n                            }\n                        }\n                        offset_234826 *= 2;\n                    }\n                    while (slt32(skip_waves_234827,\n                                 squot32(sext_i64_i32(segred_group_sizze_219647) +\n                                         wave_sizze_234797 - 1,\n                                         wave_sizze_234797))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_234826 = skip_waves_234827 * wave_sizze_234797;\n                        if (slt32(local_tid_234795 + offset_234826,\n                                  sext_i64_i32(segred_group_sizze_219647)) &&\n                            ((local_tid_234795 - squot32(local_tid_234795,\n",
                   "                                                         wave_sizze_234797) *\n                              wave_sizze_234797) == 0 &&\n                             (squot32(local_tid_234795, wave_sizze_234797) &\n                              (2 * skip_waves_234827 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_234815 = ((__local\n                                             double *) red_arr_mem_234799)[sext_i32_i64(local_tid_234795 +\n                                                                           offset_234826)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234816 = x_234814 +\n                                       x_234815;\n                                \n                                x_234814 = defunc_1_op_res_234816;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_234799)[sext_i32_i64(local_tid_234795)] =\n                                    x_234814;\n                            }\n                        }\n                        skip_waves_234827 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_234795 == 0) {\n                            ((__global double *) mem_230714)[gtid_219651 *\n                                                             l_n_m_203733 +\n                                                             gtid_219652] =\n                                x_234814;\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_s",
                   "izze_219647\n}\n__kernel void mainzisegred_large_220434(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_234947_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234945_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234943_backing_aligned_2,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234941_backing_aligned_3,\n                                        int64_t n_203572, int64_t q_l_203577,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t l_n_m_203733, int64_t i_203760,\n                                        int64_t num_groups_220426,\n                                        int64_t ctx_param_ext_229596,\n                                        int64_t ctx_param_ext_229597,\n                                        int64_t ctx_param_ext_229599,\n                                        int64_t groups_per_segment_234923,\n                                        int64_t elements_per_thread_234924,\n                                        int64_t virt_num_groups_234925,\n                                        int64_t threads_per_segment_234927,\n                                        __global unsigned char *ext_mem_229519,\n                                        __global unsigned char *ext_mem_229520,\n                                        __global\n                                        unsigned char *mem_param_229601,\n                                        __global unsigned char *mem_230784,\n                                        __global unsigned char *mem_230788,\n                                    ",
                   "    __global unsigned char *mem_230792,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234928,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234930,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234932,\n                                        __global\n                                        unsigned char *mainzicounter_mem_234934)\n{\n    #define segred_group_sizze_220425 (mainzisegred_group_sizze_220102)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict sync_arr_mem_234947_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_234947_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_234945_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234945_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_234943_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234943_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_234941_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234941_backing_aligned_3;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234936;\n    int32_t local_tid_234937;\n    int64_t group_sizze_234940;\n    int32_t wave_sizze_234939;\n    int32_t group_tid_234938;\n    \n    global_tid_234936 = get_global_id(0);\n    local_tid_234937 = get_local_id(0);\n    group_sizze_234940 = get_local_size(0);\n    wave_sizze_234939 = LOCKSTEP_WIDTH;\n    group_tid_234",
                   "938 = get_group_id(0);\n    \n    int32_t phys_tid_220434 = global_tid_234936;\n    __local unsigned char *red_arr_mem_234941;\n    \n    red_arr_mem_234941 = (__local unsigned char *) red_arr_mem_234941_backing_0;\n    \n    __local unsigned char *red_arr_mem_234943;\n    \n    red_arr_mem_234943 = (__local unsigned char *) red_arr_mem_234943_backing_1;\n    \n    __local unsigned char *red_arr_mem_234945;\n    \n    red_arr_mem_234945 = (__local unsigned char *) red_arr_mem_234945_backing_2;\n    \n    __local unsigned char *sync_arr_mem_234947;\n    \n    sync_arr_mem_234947 = (__local\n                           unsigned char *) sync_arr_mem_234947_backing_3;\n    \n    int32_t phys_group_id_234949;\n    \n    phys_group_id_234949 = get_group_id(0);\n    for (int32_t i_234950 = 0; i_234950 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_234925) - phys_group_id_234949,\n                   sext_i64_i32(num_groups_220426)); i_234950++) {\n        int32_t virt_group_id_234951 = phys_group_id_234949 + i_234950 *\n                sext_i64_i32(num_groups_220426);\n        int32_t flat_segment_id_234952 = squot32(virt_group_id_234951,\n                                                 sext_i64_i32(groups_per_segment_234923));\n        int64_t global_tid_234953 = srem64(sext_i32_i64(virt_group_id_234951) *\n                                           segred_group_sizze_220425 +\n                                           sext_i32_i64(local_tid_234937),\n                                           segred_group_sizze_220425 *\n                                           groups_per_segment_234923);\n        int64_t slice_234954 = l_n_m_203733;\n        int64_t slice_234955 = partition_sizze_203667 * slice_234954;\n        int64_t gtid_220431 = squot64(sext_i32_i64(flat_segment_id_234952),\n                                      slice_234954);\n        int64_t remnant_234956 = sext_i32_i64(flat_segment_id_234952) -\n                gtid_220431 * slice_234954;\n        int64_t gtid_220432 = remnant_234956;\n        int",
                   "64_t remnant_234957 = remnant_234956 - gtid_220432;\n        int64_t gtid_220433;\n        double x_acc_234958;\n        double x_acc_234959;\n        double x_acc_234960;\n        int64_t chunk_sizze_234961 = smin64(elements_per_thread_234924,\n                                            sdiv_up64(q_l_203577 -\n                                                      global_tid_234953,\n                                                      threads_per_segment_234927));\n        double x_220435;\n        double x_220436;\n        double x_220437;\n        double x_220438;\n        double x_220439;\n        double x_220440;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_234958 = 0.0;\n            x_acc_234959 = 0.0;\n            x_acc_234960 = 0.0;\n        }\n        for (int64_t i_234971 = 0; i_234971 < chunk_sizze_234961; i_234971++) {\n            gtid_220433 = global_tid_234953 + threads_per_segment_234927 *\n                i_234971;\n            // apply map function\n            {\n                int64_t x_220448;\n                \n                x_220448 = ((__global int64_t *) ext_mem_229520)[gtid_220431 *\n                                                                 l_n_m_203733 +\n                                                                 gtid_220432];\n                \n                double x_220449;\n                \n                x_220449 = ((__global double *) ext_mem_229519)[gtid_220431 *\n                                                                l_n_m_203733 +\n                                                                gtid_220432];\n                \n                int64_t binop_y_228790 = mul64(jump_t_203582, gtid_220432);\n                int64_t binop_y_228791 = smin64(i_203760, binop_y_228790);\n                int64_t index_primexp_228792 = add64((int64_t) 1,\n                                                     binop_y_228791);\n                bool cond_220452 = sle64(n_203572, gtid_220433);\n                int64_t d",
                   "efunc_0_f_res_220453;\n                \n                if (cond_220452) {\n                    defunc_0_f_res_220453 = (int64_t) 0;\n                } else {\n                    int64_t i_220454 = add64(gtid_220433, x_220448);\n                    int64_t defunc_1_add_res_220455 = add64((int64_t) 1,\n                                                            i_220454);\n                    \n                    defunc_0_f_res_220453 = defunc_1_add_res_220455;\n                }\n                \n                double defunc_0_f_res_220456;\n                \n                if (cond_220452) {\n                    defunc_0_f_res_220456 = 0.0;\n                } else {\n                    int64_t i_220457 = add64(gtid_220433, x_220448);\n                    double defunc_0_add_arg_220458;\n                    \n                    defunc_0_add_arg_220458 = ((__global\n                                                double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                            (gtid_220431 *\n                                                                             ctx_param_ext_229597 +\n                                                                             i_220457 *\n                                                                             ctx_param_ext_229599)];\n                    defunc_0_f_res_220456 = defunc_0_add_arg_220458;\n                }\n                \n                int64_t binop_p_220459 = sub64(defunc_0_f_res_220453,\n                                               index_primexp_228792);\n                double defunc_0_f_res_220460 = sitofp_i64_f64(binop_p_220459);\n                double abs_res_220461 = fabs(defunc_0_f_res_220460);\n                double tmp1_220462 = abs_res_220461 / x_220449;\n                double x_220463 = tmp1_220462 * tmp1_220462;\n                double y_220464 = tmp1_220462 * x_220463;\n                double tmp2_220465 = 1.0 - y_220464;\n                double x_220",
                   "466 = tmp2_220465 * tmp2_220465;\n                double tmp3_220467 = tmp2_220465 * x_220466;\n                double w_j_220468 = defunc_0_f_res_220456 * tmp3_220467;\n                double xw_j_220469 = defunc_0_f_res_220460 * w_j_220468;\n                double x2w_j_220470 = defunc_0_f_res_220460 * xw_j_220469;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_220435 = x_acc_234958;\n                    x_220436 = x_acc_234959;\n                    x_220437 = x_acc_234960;\n                }\n                // load new values\n                {\n                    x_220438 = w_j_220468;\n                    x_220439 = xw_j_220469;\n                    x_220440 = x2w_j_220470;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_220441 = x_220435 + x_220438;\n                    double defunc_1_op_res_220442 = x_220436 + x_220439;\n                    double defunc_1_op_res_220443 = x_220437 + x_220440;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_234958 = defunc_1_op_res_220441;\n                        x_acc_234959 = defunc_1_op_res_220442;\n                        x_acc_234960 = defunc_1_op_res_220443;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_220435 = x_acc_234958;\n            x_220436 = x_acc_234959;\n            x_220437 = x_acc_234960;\n            ((__local\n              double *) red_arr_mem_234941)[sext_i32_i64(local_tid_234937)] =\n                x_220435;\n            ((__local\n              double *) red_arr_mem_234943)[sext_i32_i64(local_tid_234937)] =\n                x_220436;\n            ((__local\n              double *) red_arr_mem_234945)[sext_i32_i64(local_tid_234937)] =\n                x_220437;\n        }",
                   "\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_234972;\n        int32_t skip_waves_234973 = 1;\n        double x_234962;\n        double x_234963;\n        double x_234964;\n        double x_234965;\n        double x_234966;\n        double x_234967;\n        \n        offset_234972 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_234937,\n                      sext_i64_i32(segred_group_sizze_220425))) {\n                x_234962 = ((__local\n                             double *) red_arr_mem_234941)[sext_i32_i64(local_tid_234937 +\n                                                           offset_234972)];\n                x_234963 = ((__local\n                             double *) red_arr_mem_234943)[sext_i32_i64(local_tid_234937 +\n                                                           offset_234972)];\n                x_234964 = ((__local\n                             double *) red_arr_mem_234945)[sext_i32_i64(local_tid_234937 +\n                                                           offset_234972)];\n            }\n        }\n        offset_234972 = 1;\n        while (slt32(offset_234972, wave_sizze_234939)) {\n            if (slt32(local_tid_234937 + offset_234972,\n                      sext_i64_i32(segred_group_sizze_220425)) &&\n                ((local_tid_234937 - squot32(local_tid_234937,\n                                             wave_sizze_234939) *\n                  wave_sizze_234939) & (2 * offset_234972 - 1)) == 0) {\n                // read array element\n                {\n                    x_234965 = ((volatile __local\n                                 double *) red_arr_mem_234941)[sext_i32_i64(local_tid_234937 +\n                                                               offset_234972)];\n                    x_234966 = ((volatile __local\n                                 double *) red_arr_mem_234943)[sext_i32_i64(local_tid_234937 +\n                                                    ",
                   "           offset_234972)];\n                    x_234967 = ((volatile __local\n                                 double *) red_arr_mem_234945)[sext_i32_i64(local_tid_234937 +\n                                                               offset_234972)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234968 = x_234962 + x_234965;\n                    double defunc_1_op_res_234969 = x_234963 + x_234966;\n                    double defunc_1_op_res_234970 = x_234964 + x_234967;\n                    \n                    x_234962 = defunc_1_op_res_234968;\n                    x_234963 = defunc_1_op_res_234969;\n                    x_234964 = defunc_1_op_res_234970;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_234941)[sext_i32_i64(local_tid_234937)] =\n                        x_234962;\n                    ((volatile __local\n                      double *) red_arr_mem_234943)[sext_i32_i64(local_tid_234937)] =\n                        x_234963;\n                    ((volatile __local\n                      double *) red_arr_mem_234945)[sext_i32_i64(local_tid_234937)] =\n                        x_234964;\n                }\n            }\n            offset_234972 *= 2;\n        }\n        while (slt32(skip_waves_234973,\n                     squot32(sext_i64_i32(segred_group_sizze_220425) +\n                             wave_sizze_234939 - 1, wave_sizze_234939))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_234972 = skip_waves_234973 * wave_sizze_234939;\n            if (slt32(local_tid_234937 + offset_234972,\n                      sext_i64_i32(segred_group_sizze_220425)) &&\n                ((local_tid_234937 - squot32(local_tid_234937,\n                                             wave_sizze_234939) *\n                  wave_sizze_234939) == 0 && (squot32(local_tid_234937,\n           ",
                   "                                           wave_sizze_234939) & (2 *\n                                                                            skip_waves_234973 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_234965 = ((__local\n                                 double *) red_arr_mem_234941)[sext_i32_i64(local_tid_234937 +\n                                                               offset_234972)];\n                    x_234966 = ((__local\n                                 double *) red_arr_mem_234943)[sext_i32_i64(local_tid_234937 +\n                                                               offset_234972)];\n                    x_234967 = ((__local\n                                 double *) red_arr_mem_234945)[sext_i32_i64(local_tid_234937 +\n                                                               offset_234972)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234968 = x_234962 + x_234965;\n                    double defunc_1_op_res_234969 = x_234963 + x_234966;\n                    double defunc_1_op_res_234970 = x_234964 + x_234967;\n                    \n                    x_234962 = defunc_1_op_res_234968;\n                    x_234963 = defunc_1_op_res_234969;\n                    x_234964 = defunc_1_op_res_234970;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_234941)[sext_i32_i64(local_tid_234937)] =\n                        x_234962;\n                    ((__local\n                      double *) red_arr_mem_234943)[sext_i32_i64(local_tid_234937)] =\n                        x_234963;\n                    ((__local\n                      double *) red_arr_mem_234945)[sext_i32_i64(local_tid_234937)] =\n                        x_234964;\n        ",
                   "        }\n            }\n            skip_waves_234973 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_234937) == (int64_t) 0) {\n                x_acc_234958 = x_234962;\n                x_acc_234959 = x_234963;\n                x_acc_234960 = x_234964;\n            }\n        }\n        if (groups_per_segment_234923 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_234937 == 0) {\n                    ((__global double *) mem_230784)[gtid_220431 *\n                                                     l_n_m_203733 +\n                                                     gtid_220432] =\n                        x_acc_234958;\n                    ((__global double *) mem_230788)[gtid_220431 *\n                                                     l_n_m_203733 +\n                                                     gtid_220432] =\n                        x_acc_234959;\n                    ((__global double *) mem_230792)[gtid_220431 *\n                                                     l_n_m_203733 +\n                                                     gtid_220432] =\n                        x_acc_234960;\n                }\n            }\n        } else {\n            int32_t old_counter_234974;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_234937 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_234928)[sext_i32_i64(virt_group_id_234951)] =\n                        x_acc_234958;\n                    ((__global\n                      double *) segred_tmp_mem_234930)[sext_i32_i64(virt_group_id_234951)] =\n                        x_acc_234959;\n                    ((__global\n                      double *) segred_tmp_mem_234932)[sext_i32_i64(virt_group_id_234951)] =\n                        x_ac",
                   "c_234960;\n                    mem_fence_global();\n                    old_counter_234974 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234934)[sext_i32_i64(srem32(flat_segment_id_234952,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_234947)[(int64_t) 0] =\n                        old_counter_234974 == groups_per_segment_234923 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_234975;\n            \n            is_last_group_234975 = ((__local\n                                     bool *) sync_arr_mem_234947)[(int64_t) 0];\n            if (is_last_group_234975) {\n                if (local_tid_234937 == 0) {\n                    old_counter_234974 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234934)[sext_i32_i64(srem32(flat_segment_id_234952,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_234923));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_234976 =\n                            sdiv_up64(groups_per_segment_234923,\n                                      segred_group_sizze_220425);\n                    \n                    x_220435 = 0.0;\n                    x_220436 = 0.0;\n                    x_220437 = 0.0;\n                    for (int64_t i_234977 = 0; i_234977 <\n                         read_per_thread",
                   "_234976; i_234977++) {\n                        int64_t group_res_id_234978 =\n                                sext_i32_i64(local_tid_234937) *\n                                read_per_thread_234976 + i_234977;\n                        int64_t index_of_group_res_234979 =\n                                sext_i32_i64(flat_segment_id_234952) *\n                                groups_per_segment_234923 + group_res_id_234978;\n                        \n                        if (slt64(group_res_id_234978,\n                                  groups_per_segment_234923)) {\n                            x_220438 = ((__global\n                                         double *) segred_tmp_mem_234928)[index_of_group_res_234979];\n                            x_220439 = ((__global\n                                         double *) segred_tmp_mem_234930)[index_of_group_res_234979];\n                            x_220440 = ((__global\n                                         double *) segred_tmp_mem_234932)[index_of_group_res_234979];\n                            \n                            double defunc_1_op_res_220441 = x_220435 + x_220438;\n                            double defunc_1_op_res_220442 = x_220436 + x_220439;\n                            double defunc_1_op_res_220443 = x_220437 + x_220440;\n                            \n                            x_220435 = defunc_1_op_res_220441;\n                            x_220436 = defunc_1_op_res_220442;\n                            x_220437 = defunc_1_op_res_220443;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_234941)[sext_i32_i64(local_tid_234937)] =\n                    x_220435;\n                ((__local\n                  double *) red_arr_mem_234943)[sext_i32_i64(local_tid_234937)] =\n                    x_220436;\n                ((__local\n                  double *) red_arr_mem_234945)[sext_i32_i64(local_tid_234937)] =\n                    x_220437;\n         ",
                   "       barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_234980;\n                    int32_t skip_waves_234981 = 1;\n                    double x_234962;\n                    double x_234963;\n                    double x_234964;\n                    double x_234965;\n                    double x_234966;\n                    double x_234967;\n                    \n                    offset_234980 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_234937,\n                                  sext_i64_i32(segred_group_sizze_220425))) {\n                            x_234962 = ((__local\n                                         double *) red_arr_mem_234941)[sext_i32_i64(local_tid_234937 +\n                                                                       offset_234980)];\n                            x_234963 = ((__local\n                                         double *) red_arr_mem_234943)[sext_i32_i64(local_tid_234937 +\n                                                                       offset_234980)];\n                            x_234964 = ((__local\n                                         double *) red_arr_mem_234945)[sext_i32_i64(local_tid_234937 +\n                                                                       offset_234980)];\n                        }\n                    }\n                    offset_234980 = 1;\n                    while (slt32(offset_234980, wave_sizze_234939)) {\n                        if (slt32(local_tid_234937 + offset_234980,\n                                  sext_i64_i32(segred_group_sizze_220425)) &&\n                            ((local_tid_234937 - squot32(local_tid_234937,\n                                                         wave_sizze_234939) *\n                              wave_sizze_234939) & (2 * offset_234980 - 1)) ==\n                            0) {\n           ",
                   "                 // read array element\n                            {\n                                x_234965 = ((volatile __local\n                                             double *) red_arr_mem_234941)[sext_i32_i64(local_tid_234937 +\n                                                                           offset_234980)];\n                                x_234966 = ((volatile __local\n                                             double *) red_arr_mem_234943)[sext_i32_i64(local_tid_234937 +\n                                                                           offset_234980)];\n                                x_234967 = ((volatile __local\n                                             double *) red_arr_mem_234945)[sext_i32_i64(local_tid_234937 +\n                                                                           offset_234980)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234968 = x_234962 +\n                                       x_234965;\n                                double defunc_1_op_res_234969 = x_234963 +\n                                       x_234966;\n                                double defunc_1_op_res_234970 = x_234964 +\n                                       x_234967;\n                                \n                                x_234962 = defunc_1_op_res_234968;\n                                x_234963 = defunc_1_op_res_234969;\n                                x_234964 = defunc_1_op_res_234970;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234941)[sext_i32_i64(local_tid_234937)] =\n                                    x_234962;\n                                ((volatile __local\n                                  double *) red_arr_mem_234943",
                   ")[sext_i32_i64(local_tid_234937)] =\n                                    x_234963;\n                                ((volatile __local\n                                  double *) red_arr_mem_234945)[sext_i32_i64(local_tid_234937)] =\n                                    x_234964;\n                            }\n                        }\n                        offset_234980 *= 2;\n                    }\n                    while (slt32(skip_waves_234981,\n                                 squot32(sext_i64_i32(segred_group_sizze_220425) +\n                                         wave_sizze_234939 - 1,\n                                         wave_sizze_234939))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_234980 = skip_waves_234981 * wave_sizze_234939;\n                        if (slt32(local_tid_234937 + offset_234980,\n                                  sext_i64_i32(segred_group_sizze_220425)) &&\n                            ((local_tid_234937 - squot32(local_tid_234937,\n                                                         wave_sizze_234939) *\n                              wave_sizze_234939) == 0 &&\n                             (squot32(local_tid_234937, wave_sizze_234939) &\n                              (2 * skip_waves_234981 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_234965 = ((__local\n                                             double *) red_arr_mem_234941)[sext_i32_i64(local_tid_234937 +\n                                                                           offset_234980)];\n                                x_234966 = ((__local\n                                             double *) red_arr_mem_234943)[sext_i32_i64(local_tid_234937 +\n                                                                           offset_234980)];\n                                x_234967 = ((__local\n                                             double *) red_arr_mem_",
                   "234945)[sext_i32_i64(local_tid_234937 +\n                                                                           offset_234980)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234968 = x_234962 +\n                                       x_234965;\n                                double defunc_1_op_res_234969 = x_234963 +\n                                       x_234966;\n                                double defunc_1_op_res_234970 = x_234964 +\n                                       x_234967;\n                                \n                                x_234962 = defunc_1_op_res_234968;\n                                x_234963 = defunc_1_op_res_234969;\n                                x_234964 = defunc_1_op_res_234970;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_234941)[sext_i32_i64(local_tid_234937)] =\n                                    x_234962;\n                                ((__local\n                                  double *) red_arr_mem_234943)[sext_i32_i64(local_tid_234937)] =\n                                    x_234963;\n                                ((__local\n                                  double *) red_arr_mem_234945)[sext_i32_i64(local_tid_234937)] =\n                                    x_234964;\n                            }\n                        }\n                        skip_waves_234981 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_234937 == 0) {\n                            ((__global double *) mem_230784)[gtid_220431 *\n                                                             l_n_m_203733 +\n                                                      ",
                   "       gtid_220432] =\n                                x_234962;\n                            ((__global double *) mem_230788)[gtid_220431 *\n                                                             l_n_m_203733 +\n                                                             gtid_220432] =\n                                x_234963;\n                            ((__global double *) mem_230792)[gtid_220431 *\n                                                             l_n_m_203733 +\n                                                             gtid_220432] =\n                                x_234964;\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_220425\n}\n__kernel void mainzisegred_large_220503(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_235047_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235045_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235043_backing_aligned_2,\n                                        int64_t n_203572, int64_t q_l_203577,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t l_n_m_203733, int64_t i_203760,\n                                        int64_t num_groups_220496,\n                                        int64_t ctx_param_ext_229596,\n                                        int64_t ctx_param_ext_229597,\n                                        int64_t ctx_param_ext_229599,\n                                        int64_t groups_per_segment_235027,\n                          ",
                   "              int64_t elements_per_thread_235028,\n                                        int64_t virt_num_groups_235029,\n                                        int64_t threads_per_segment_235031,\n                                        __global unsigned char *ext_mem_229519,\n                                        __global unsigned char *ext_mem_229520,\n                                        __global\n                                        unsigned char *mem_param_229601,\n                                        __global unsigned char *mem_230659,\n                                        __global unsigned char *mem_230797,\n                                        __global unsigned char *mem_230801,\n                                        __global unsigned char *mem_230805,\n                                        __global unsigned char *mem_230810,\n                                        __global unsigned char *mem_230814,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235032,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235034,\n                                        __global\n                                        unsigned char *mainzicounter_mem_235036)\n{\n    #define segred_group_sizze_220495 (mainzisegred_group_sizze_220008)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict sync_arr_mem_235047_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_235047_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_235045_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235045_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_235043_backi",
                   "ng_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235043_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235038;\n    int32_t local_tid_235039;\n    int64_t group_sizze_235042;\n    int32_t wave_sizze_235041;\n    int32_t group_tid_235040;\n    \n    global_tid_235038 = get_global_id(0);\n    local_tid_235039 = get_local_id(0);\n    group_sizze_235042 = get_local_size(0);\n    wave_sizze_235041 = LOCKSTEP_WIDTH;\n    group_tid_235040 = get_group_id(0);\n    \n    int32_t phys_tid_220503 = global_tid_235038;\n    __local unsigned char *red_arr_mem_235043;\n    \n    red_arr_mem_235043 = (__local unsigned char *) red_arr_mem_235043_backing_0;\n    \n    __local unsigned char *red_arr_mem_235045;\n    \n    red_arr_mem_235045 = (__local unsigned char *) red_arr_mem_235045_backing_1;\n    \n    __local unsigned char *sync_arr_mem_235047;\n    \n    sync_arr_mem_235047 = (__local\n                           unsigned char *) sync_arr_mem_235047_backing_2;\n    \n    int32_t phys_group_id_235049;\n    \n    phys_group_id_235049 = get_group_id(0);\n    for (int32_t i_235050 = 0; i_235050 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_235029) - phys_group_id_235049,\n                   sext_i64_i32(num_groups_220496)); i_235050++) {\n        int32_t virt_group_id_235051 = phys_group_id_235049 + i_235050 *\n                sext_i64_i32(num_groups_220496);\n        int32_t flat_segment_id_235052 = squot32(virt_group_id_235051,\n                                                 sext_i64_i32(groups_per_segment_235027));\n        int64_t global_tid_235053 = srem64(sext_i32_i64(virt_group_id_235051) *\n                                           segred_group_sizze_220495 +\n                                           sext_i32_i64(local_tid_235039),\n                                           segred_group_sizze_220495 *\n                                           groups_per_segment_235027);\n      ",
                   "  int64_t slice_235054 = l_n_m_203733;\n        int64_t slice_235055 = partition_sizze_203667 * slice_235054;\n        int64_t gtid_220500 = squot64(sext_i32_i64(flat_segment_id_235052),\n                                      slice_235054);\n        int64_t remnant_235056 = sext_i32_i64(flat_segment_id_235052) -\n                gtid_220500 * slice_235054;\n        int64_t gtid_220501 = remnant_235056;\n        int64_t remnant_235057 = remnant_235056 - gtid_220501;\n        int64_t gtid_220502;\n        double x_acc_235058;\n        double x_acc_235059;\n        int64_t chunk_sizze_235060 = smin64(elements_per_thread_235028,\n                                            sdiv_up64(q_l_203577 -\n                                                      global_tid_235053,\n                                                      threads_per_segment_235031));\n        double x_220504;\n        double x_220505;\n        double x_220506;\n        double x_220507;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_235058 = 0.0;\n            x_acc_235059 = 0.0;\n        }\n        for (int64_t i_235067 = 0; i_235067 < chunk_sizze_235060; i_235067++) {\n            gtid_220502 = global_tid_235053 + threads_per_segment_235031 *\n                i_235067;\n            // apply map function\n            {\n                int64_t x_220518;\n                \n                x_220518 = ((__global int64_t *) ext_mem_229520)[gtid_220500 *\n                                                                 l_n_m_203733 +\n                                                                 gtid_220501];\n                \n                double x_220519;\n                \n                x_220519 = ((__global double *) ext_mem_229519)[gtid_220500 *\n                                                                l_n_m_203733 +\n                                                                gtid_220501];\n                \n                int64_t binop_y_228785 = mul64(jump_t_203582, gtid_220501);\n ",
                   "               int64_t binop_y_228786 = smin64(i_203760, binop_y_228785);\n                int64_t index_primexp_228787 = add64((int64_t) 1,\n                                                     binop_y_228786);\n                double a11_220521;\n                \n                a11_220521 = ((__global double *) mem_230797)[gtid_220500 *\n                                                              l_n_m_203733 +\n                                                              gtid_220501];\n                \n                double b11_220522;\n                \n                b11_220522 = ((__global double *) mem_230801)[gtid_220500 *\n                                                              l_n_m_203733 +\n                                                              gtid_220501];\n                \n                double c11_220523;\n                \n                c11_220523 = ((__global double *) mem_230805)[gtid_220500 *\n                                                              l_n_m_203733 +\n                                                              gtid_220501];\n                \n                bool cond_220525 = sle64(n_203572, gtid_220502);\n                int64_t defunc_0_f_res_220526;\n                \n                if (cond_220525) {\n                    defunc_0_f_res_220526 = (int64_t) 0;\n                } else {\n                    int64_t i_220527 = add64(gtid_220502, x_220518);\n                    int64_t defunc_1_add_res_220528 = add64((int64_t) 1,\n                                                            i_220527);\n                    \n                    defunc_0_f_res_220526 = defunc_1_add_res_220528;\n                }\n                \n                double defunc_0_f_res_220529;\n                \n                if (cond_220525) {\n                    defunc_0_f_res_220529 = 0.0;\n                } else {\n                    int64_t i_220530 = add64(gtid_220502, x_220518);\n                    double defunc_0_add_arg_220531;\n                   ",
                   " \n                    defunc_0_add_arg_220531 = ((__global\n                                                double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                            (gtid_220500 *\n                                                                             ctx_param_ext_229597 +\n                                                                             i_220530 *\n                                                                             ctx_param_ext_229599)];\n                    defunc_0_f_res_220529 = defunc_0_add_arg_220531;\n                }\n                \n                int64_t binop_p_220532 = sub64(defunc_0_f_res_220526,\n                                               index_primexp_228787);\n                double defunc_0_f_res_220533 = sitofp_i64_f64(binop_p_220532);\n                double abs_res_220534 = fabs(defunc_0_f_res_220533);\n                double tmp1_220535 = abs_res_220534 / x_220519;\n                double x_220536 = tmp1_220535 * tmp1_220535;\n                double y_220537 = tmp1_220535 * x_220536;\n                double tmp2_220538 = 1.0 - y_220537;\n                double x_220539 = tmp2_220538 * tmp2_220538;\n                double tmp3_220540 = tmp2_220538 * x_220539;\n                double tmp4_220541 = defunc_0_f_res_220529 * tmp3_220540;\n                double defunc_1_f_res_220542 = defunc_0_f_res_220533 *\n                       tmp4_220541;\n                double defunc_0_f_res_220543;\n                \n                if (cond_220525) {\n                    defunc_0_f_res_220543 = 0.0;\n                } else {\n                    int64_t i_220544 = add64(gtid_220502, x_220518);\n                    double defunc_0_add_arg_220545;\n                    \n                    defunc_0_add_arg_220545 = ((__global\n                                                double *) mem_230659)[gtid_220500 *\n                                                                      n_2035",
                   "72 +\n                                                                      i_220544];\n                    defunc_0_f_res_220543 = defunc_0_add_arg_220545;\n                }\n                \n                double x_220546 = a11_220521 * tmp4_220541;\n                double y_220547 = b11_220522 * defunc_1_f_res_220542;\n                double x_220548 = x_220546 + y_220547;\n                double defunc_9_fit_fun_res_220549 = defunc_0_f_res_220543 *\n                       x_220548;\n                double x_220550 = b11_220522 * tmp4_220541;\n                double y_220551 = c11_220523 * defunc_1_f_res_220542;\n                double x_220552 = x_220550 + y_220551;\n                double defunc_9_slope_fun_res_220553 = defunc_0_f_res_220543 *\n                       x_220552;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_220504 = x_acc_235058;\n                    x_220505 = x_acc_235059;\n                }\n                // load new values\n                {\n                    x_220506 = defunc_9_fit_fun_res_220549;\n                    x_220507 = defunc_9_slope_fun_res_220553;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_220508 = x_220504 + x_220506;\n                    double defunc_1_op_res_220509 = x_220505 + x_220507;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_235058 = defunc_1_op_res_220508;\n                        x_acc_235059 = defunc_1_op_res_220509;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_220504 = x_acc_235058;\n            x_220505 = x_acc_235059;\n            ((__local\n              double *) red_arr_mem_235043)[sext_i32_i64(local_tid_235039)] =\n                x_220504;\n            ((__local\n",
                   "              double *) red_arr_mem_235045)[sext_i32_i64(local_tid_235039)] =\n                x_220505;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_235068;\n        int32_t skip_waves_235069 = 1;\n        double x_235061;\n        double x_235062;\n        double x_235063;\n        double x_235064;\n        \n        offset_235068 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_235039,\n                      sext_i64_i32(segred_group_sizze_220495))) {\n                x_235061 = ((__local\n                             double *) red_arr_mem_235043)[sext_i32_i64(local_tid_235039 +\n                                                           offset_235068)];\n                x_235062 = ((__local\n                             double *) red_arr_mem_235045)[sext_i32_i64(local_tid_235039 +\n                                                           offset_235068)];\n            }\n        }\n        offset_235068 = 1;\n        while (slt32(offset_235068, wave_sizze_235041)) {\n            if (slt32(local_tid_235039 + offset_235068,\n                      sext_i64_i32(segred_group_sizze_220495)) &&\n                ((local_tid_235039 - squot32(local_tid_235039,\n                                             wave_sizze_235041) *\n                  wave_sizze_235041) & (2 * offset_235068 - 1)) == 0) {\n                // read array element\n                {\n                    x_235063 = ((volatile __local\n                                 double *) red_arr_mem_235043)[sext_i32_i64(local_tid_235039 +\n                                                               offset_235068)];\n                    x_235064 = ((volatile __local\n                                 double *) red_arr_mem_235045)[sext_i32_i64(local_tid_235039 +\n                                                               offset_235068)];\n                }\n                // apply reduction operation\n                {\n                    double defun",
                   "c_1_op_res_235065 = x_235061 + x_235063;\n                    double defunc_1_op_res_235066 = x_235062 + x_235064;\n                    \n                    x_235061 = defunc_1_op_res_235065;\n                    x_235062 = defunc_1_op_res_235066;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_235043)[sext_i32_i64(local_tid_235039)] =\n                        x_235061;\n                    ((volatile __local\n                      double *) red_arr_mem_235045)[sext_i32_i64(local_tid_235039)] =\n                        x_235062;\n                }\n            }\n            offset_235068 *= 2;\n        }\n        while (slt32(skip_waves_235069,\n                     squot32(sext_i64_i32(segred_group_sizze_220495) +\n                             wave_sizze_235041 - 1, wave_sizze_235041))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_235068 = skip_waves_235069 * wave_sizze_235041;\n            if (slt32(local_tid_235039 + offset_235068,\n                      sext_i64_i32(segred_group_sizze_220495)) &&\n                ((local_tid_235039 - squot32(local_tid_235039,\n                                             wave_sizze_235041) *\n                  wave_sizze_235041) == 0 && (squot32(local_tid_235039,\n                                                      wave_sizze_235041) & (2 *\n                                                                            skip_waves_235069 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_235063 = ((__local\n                                 double *) red_arr_mem_235043)[sext_i32_i64(local_tid_235039 +\n                                                               offset_235068)];\n                    x_235064 = ((__local\n                                 double *) red_arr_mem_235045)[sext_i",
                   "32_i64(local_tid_235039 +\n                                                               offset_235068)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235065 = x_235061 + x_235063;\n                    double defunc_1_op_res_235066 = x_235062 + x_235064;\n                    \n                    x_235061 = defunc_1_op_res_235065;\n                    x_235062 = defunc_1_op_res_235066;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_235043)[sext_i32_i64(local_tid_235039)] =\n                        x_235061;\n                    ((__local\n                      double *) red_arr_mem_235045)[sext_i32_i64(local_tid_235039)] =\n                        x_235062;\n                }\n            }\n            skip_waves_235069 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_235039) == (int64_t) 0) {\n                x_acc_235058 = x_235061;\n                x_acc_235059 = x_235062;\n            }\n        }\n        if (groups_per_segment_235027 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_235039 == 0) {\n                    ((__global double *) mem_230810)[gtid_220500 *\n                                                     l_n_m_203733 +\n                                                     gtid_220501] =\n                        x_acc_235058;\n                    ((__global double *) mem_230814)[gtid_220500 *\n                                                     l_n_m_203733 +\n                                                     gtid_220501] =\n                        x_acc_235059;\n                }\n            }\n        } else {\n            int32_t old_counter_235070;\n            \n            // first thread in group ",
                   "saves group result to global memory\n            {\n                if (local_tid_235039 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_235032)[sext_i32_i64(virt_group_id_235051)] =\n                        x_acc_235058;\n                    ((__global\n                      double *) segred_tmp_mem_235034)[sext_i32_i64(virt_group_id_235051)] =\n                        x_acc_235059;\n                    mem_fence_global();\n                    old_counter_235070 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235036)[sext_i32_i64(srem32(flat_segment_id_235052,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_235047)[(int64_t) 0] =\n                        old_counter_235070 == groups_per_segment_235027 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_235071;\n            \n            is_last_group_235071 = ((__local\n                                     bool *) sync_arr_mem_235047)[(int64_t) 0];\n            if (is_last_group_235071) {\n                if (local_tid_235039 == 0) {\n                    old_counter_235070 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235036)[sext_i32_i64(srem32(flat_segment_id_235052,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_235027));\n                }\n                // read in the per-group-results\n                {\n  ",
                   "                  int64_t read_per_thread_235072 =\n                            sdiv_up64(groups_per_segment_235027,\n                                      segred_group_sizze_220495);\n                    \n                    x_220504 = 0.0;\n                    x_220505 = 0.0;\n                    for (int64_t i_235073 = 0; i_235073 <\n                         read_per_thread_235072; i_235073++) {\n                        int64_t group_res_id_235074 =\n                                sext_i32_i64(local_tid_235039) *\n                                read_per_thread_235072 + i_235073;\n                        int64_t index_of_group_res_235075 =\n                                sext_i32_i64(flat_segment_id_235052) *\n                                groups_per_segment_235027 + group_res_id_235074;\n                        \n                        if (slt64(group_res_id_235074,\n                                  groups_per_segment_235027)) {\n                            x_220506 = ((__global\n                                         double *) segred_tmp_mem_235032)[index_of_group_res_235075];\n                            x_220507 = ((__global\n                                         double *) segred_tmp_mem_235034)[index_of_group_res_235075];\n                            \n                            double defunc_1_op_res_220508 = x_220504 + x_220506;\n                            double defunc_1_op_res_220509 = x_220505 + x_220507;\n                            \n                            x_220504 = defunc_1_op_res_220508;\n                            x_220505 = defunc_1_op_res_220509;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_235043)[sext_i32_i64(local_tid_235039)] =\n                    x_220504;\n                ((__local\n                  double *) red_arr_mem_235045)[sext_i32_i64(local_tid_235039)] =\n                    x_220505;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduc",
                   "e the per-group results\n                {\n                    int32_t offset_235076;\n                    int32_t skip_waves_235077 = 1;\n                    double x_235061;\n                    double x_235062;\n                    double x_235063;\n                    double x_235064;\n                    \n                    offset_235076 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_235039,\n                                  sext_i64_i32(segred_group_sizze_220495))) {\n                            x_235061 = ((__local\n                                         double *) red_arr_mem_235043)[sext_i32_i64(local_tid_235039 +\n                                                                       offset_235076)];\n                            x_235062 = ((__local\n                                         double *) red_arr_mem_235045)[sext_i32_i64(local_tid_235039 +\n                                                                       offset_235076)];\n                        }\n                    }\n                    offset_235076 = 1;\n                    while (slt32(offset_235076, wave_sizze_235041)) {\n                        if (slt32(local_tid_235039 + offset_235076,\n                                  sext_i64_i32(segred_group_sizze_220495)) &&\n                            ((local_tid_235039 - squot32(local_tid_235039,\n                                                         wave_sizze_235041) *\n                              wave_sizze_235041) & (2 * offset_235076 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_235063 = ((volatile __local\n                                             double *) red_arr_mem_235043)[sext_i32_i64(local_tid_235039 +\n                                                                           offset_235076)];\n                                x_235064 = ((",
                   "volatile __local\n                                             double *) red_arr_mem_235045)[sext_i32_i64(local_tid_235039 +\n                                                                           offset_235076)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235065 = x_235061 +\n                                       x_235063;\n                                double defunc_1_op_res_235066 = x_235062 +\n                                       x_235064;\n                                \n                                x_235061 = defunc_1_op_res_235065;\n                                x_235062 = defunc_1_op_res_235066;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235043)[sext_i32_i64(local_tid_235039)] =\n                                    x_235061;\n                                ((volatile __local\n                                  double *) red_arr_mem_235045)[sext_i32_i64(local_tid_235039)] =\n                                    x_235062;\n                            }\n                        }\n                        offset_235076 *= 2;\n                    }\n                    while (slt32(skip_waves_235077,\n                                 squot32(sext_i64_i32(segred_group_sizze_220495) +\n                                         wave_sizze_235041 - 1,\n                                         wave_sizze_235041))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_235076 = skip_waves_235077 * wave_sizze_235041;\n                        if (slt32(local_tid_235039 + offset_235076,\n                                  sext_i64_i32(segred_group_sizze_220495)) &&\n                            ((local_tid_235039 - squot32(local_tid_235039,\n      ",
                   "                                                   wave_sizze_235041) *\n                              wave_sizze_235041) == 0 &&\n                             (squot32(local_tid_235039, wave_sizze_235041) &\n                              (2 * skip_waves_235077 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_235063 = ((__local\n                                             double *) red_arr_mem_235043)[sext_i32_i64(local_tid_235039 +\n                                                                           offset_235076)];\n                                x_235064 = ((__local\n                                             double *) red_arr_mem_235045)[sext_i32_i64(local_tid_235039 +\n                                                                           offset_235076)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235065 = x_235061 +\n                                       x_235063;\n                                double defunc_1_op_res_235066 = x_235062 +\n                                       x_235064;\n                                \n                                x_235061 = defunc_1_op_res_235065;\n                                x_235062 = defunc_1_op_res_235066;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_235043)[sext_i32_i64(local_tid_235039)] =\n                                    x_235061;\n                                ((__local\n                                  double *) red_arr_mem_235045)[sext_i32_i64(local_tid_235039)] =\n                                    x_235062;\n                            }\n                        }\n                        skip_waves_235077 *= 2;\n                 ",
                   "   }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_235039 == 0) {\n                            ((__global double *) mem_230810)[gtid_220500 *\n                                                             l_n_m_203733 +\n                                                             gtid_220501] =\n                                x_235061;\n                            ((__global double *) mem_230814)[gtid_220500 *\n                                                             l_n_m_203733 +\n                                                             gtid_220501] =\n                                x_235062;\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_220495\n}\n__kernel void mainzisegred_large_221513(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_235221_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235219_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235217_backing_aligned_2,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235215_backing_aligned_3,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235213_backing_aligned_4,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235211_backing_aligned_5,\n                                        int64_t n_203572, int64_t q_l_203577,\n                                        int64_t jump_t_203582,\n                  ",
                   "                      int64_t partition_sizze_203667,\n                                        int64_t l_n_m_203733, int64_t i_203760,\n                                        int64_t num_groups_221503,\n                                        int64_t ctx_param_ext_229596,\n                                        int64_t ctx_param_ext_229597,\n                                        int64_t ctx_param_ext_229599,\n                                        int64_t groups_per_segment_235189,\n                                        int64_t elements_per_thread_235190,\n                                        int64_t virt_num_groups_235191,\n                                        int64_t threads_per_segment_235193,\n                                        __global unsigned char *ext_mem_229519,\n                                        __global unsigned char *ext_mem_229520,\n                                        __global\n                                        unsigned char *mem_param_229601,\n                                        __global unsigned char *mem_230891,\n                                        __global unsigned char *mem_230895,\n                                        __global unsigned char *mem_230899,\n                                        __global unsigned char *mem_230903,\n                                        __global unsigned char *mem_230907,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235194,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235196,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235198,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235200,\n                                        __global\n                                        unsigned char *segred_tmp_mem_2",
                   "35202,\n                                        __global\n                                        unsigned char *mainzicounter_mem_235204)\n{\n    #define segred_group_sizze_221502 (mainzisegred_group_sizze_221099)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict sync_arr_mem_235221_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_235221_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_235219_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235219_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_235217_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235217_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_235215_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235215_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_235213_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235213_backing_aligned_4;\n    __local volatile unsigned char *restrict red_arr_mem_235211_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235211_backing_aligned_5;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235206;\n    int32_t local_tid_235207;\n    int64_t group_sizze_235210;\n    int32_t wave_sizze_235209;\n    int32_t group_tid_235208;\n    \n    global_tid_235206 = get_global_id(0);\n    local_tid_235207 = get_local_id(0);\n    group_sizze_235210 = get_local_size(0);\n    wave_sizze_235209 = LOCKSTE",
                   "P_WIDTH;\n    group_tid_235208 = get_group_id(0);\n    \n    int32_t phys_tid_221513 = global_tid_235206;\n    __local unsigned char *red_arr_mem_235211;\n    \n    red_arr_mem_235211 = (__local unsigned char *) red_arr_mem_235211_backing_0;\n    \n    __local unsigned char *red_arr_mem_235213;\n    \n    red_arr_mem_235213 = (__local unsigned char *) red_arr_mem_235213_backing_1;\n    \n    __local unsigned char *red_arr_mem_235215;\n    \n    red_arr_mem_235215 = (__local unsigned char *) red_arr_mem_235215_backing_2;\n    \n    __local unsigned char *red_arr_mem_235217;\n    \n    red_arr_mem_235217 = (__local unsigned char *) red_arr_mem_235217_backing_3;\n    \n    __local unsigned char *red_arr_mem_235219;\n    \n    red_arr_mem_235219 = (__local unsigned char *) red_arr_mem_235219_backing_4;\n    \n    __local unsigned char *sync_arr_mem_235221;\n    \n    sync_arr_mem_235221 = (__local\n                           unsigned char *) sync_arr_mem_235221_backing_5;\n    \n    int32_t phys_group_id_235223;\n    \n    phys_group_id_235223 = get_group_id(0);\n    for (int32_t i_235224 = 0; i_235224 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_235191) - phys_group_id_235223,\n                   sext_i64_i32(num_groups_221503)); i_235224++) {\n        int32_t virt_group_id_235225 = phys_group_id_235223 + i_235224 *\n                sext_i64_i32(num_groups_221503);\n        int32_t flat_segment_id_235226 = squot32(virt_group_id_235225,\n                                                 sext_i64_i32(groups_per_segment_235189));\n        int64_t global_tid_235227 = srem64(sext_i32_i64(virt_group_id_235225) *\n                                           segred_group_sizze_221502 +\n                                           sext_i32_i64(local_tid_235207),\n                                           segred_group_sizze_221502 *\n                                           groups_per_segment_235189);\n        int64_t slice_235228 = l_n_m_203733;\n        int64_t slice_235229 = partition_sizze_203667 * slice_235228;\n",
                   "        int64_t gtid_221510 = squot64(sext_i32_i64(flat_segment_id_235226),\n                                      slice_235228);\n        int64_t remnant_235230 = sext_i32_i64(flat_segment_id_235226) -\n                gtid_221510 * slice_235228;\n        int64_t gtid_221511 = remnant_235230;\n        int64_t remnant_235231 = remnant_235230 - gtid_221511;\n        int64_t gtid_221512;\n        double x_acc_235232;\n        double x_acc_235233;\n        double x_acc_235234;\n        double x_acc_235235;\n        double x_acc_235236;\n        int64_t chunk_sizze_235237 = smin64(elements_per_thread_235190,\n                                            sdiv_up64(q_l_203577 -\n                                                      global_tid_235227,\n                                                      threads_per_segment_235193));\n        double x_221514;\n        double x_221515;\n        double x_221516;\n        double x_221517;\n        double x_221518;\n        double x_221519;\n        double x_221520;\n        double x_221521;\n        double x_221522;\n        double x_221523;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_235232 = 0.0;\n            x_acc_235233 = 0.0;\n            x_acc_235234 = 0.0;\n            x_acc_235235 = 0.0;\n            x_acc_235236 = 0.0;\n        }\n        for (int64_t i_235253 = 0; i_235253 < chunk_sizze_235237; i_235253++) {\n            gtid_221512 = global_tid_235227 + threads_per_segment_235193 *\n                i_235253;\n            // apply map function\n            {\n                int64_t x_221533;\n                \n                x_221533 = ((__global int64_t *) ext_mem_229520)[gtid_221510 *\n                                                                 l_n_m_203733 +\n                                                                 gtid_221511];\n                \n                double x_221534;\n                \n                x_221534 = ((__global double *) ext_mem_229519)[gtid_221510 *\n                           ",
                   "                                     l_n_m_203733 +\n                                                                gtid_221511];\n                \n                int64_t binop_y_228800 = mul64(jump_t_203582, gtid_221511);\n                int64_t binop_y_228801 = smin64(i_203760, binop_y_228800);\n                int64_t index_primexp_228802 = add64((int64_t) 1,\n                                                     binop_y_228801);\n                bool cond_221537 = sle64(n_203572, gtid_221512);\n                int64_t defunc_0_f_res_221538;\n                \n                if (cond_221537) {\n                    defunc_0_f_res_221538 = (int64_t) 0;\n                } else {\n                    int64_t i_221539 = add64(gtid_221512, x_221533);\n                    int64_t defunc_1_add_res_221540 = add64((int64_t) 1,\n                                                            i_221539);\n                    \n                    defunc_0_f_res_221538 = defunc_1_add_res_221540;\n                }\n                \n                double defunc_0_f_res_221541;\n                \n                if (cond_221537) {\n                    defunc_0_f_res_221541 = 0.0;\n                } else {\n                    int64_t i_221542 = add64(gtid_221512, x_221533);\n                    double defunc_0_add_arg_221543;\n                    \n                    defunc_0_add_arg_221543 = ((__global\n                                                double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                            (gtid_221510 *\n                                                                             ctx_param_ext_229597 +\n                                                                             i_221542 *\n                                                                             ctx_param_ext_229599)];\n                    defunc_0_f_res_221541 = defunc_0_add_arg_221543;\n                }\n                \n                int64_t bino",
                   "p_p_221544 = sub64(defunc_0_f_res_221538,\n                                               index_primexp_228802);\n                double defunc_0_f_res_221545 = sitofp_i64_f64(binop_p_221544);\n                double abs_res_221546 = fabs(defunc_0_f_res_221545);\n                double tmp1_221547 = abs_res_221546 / x_221534;\n                double x_221548 = tmp1_221547 * tmp1_221547;\n                double y_221549 = tmp1_221547 * x_221548;\n                double tmp2_221550 = 1.0 - y_221549;\n                double x_221551 = tmp2_221550 * tmp2_221550;\n                double tmp3_221552 = tmp2_221550 * x_221551;\n                double w_j_221553 = defunc_0_f_res_221541 * tmp3_221552;\n                double xw_j_221554 = defunc_0_f_res_221545 * w_j_221553;\n                double x2w_j_221555 = defunc_0_f_res_221545 * xw_j_221554;\n                double x3w_j_221556 = defunc_0_f_res_221545 * x2w_j_221555;\n                double x4w_j_221557 = defunc_0_f_res_221545 * x3w_j_221556;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_221514 = x_acc_235232;\n                    x_221515 = x_acc_235233;\n                    x_221516 = x_acc_235234;\n                    x_221517 = x_acc_235235;\n                    x_221518 = x_acc_235236;\n                }\n                // load new values\n                {\n                    x_221519 = w_j_221553;\n                    x_221520 = xw_j_221554;\n                    x_221521 = x2w_j_221555;\n                    x_221522 = x3w_j_221556;\n                    x_221523 = x4w_j_221557;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_221524 = x_221514 + x_221519;\n                    double defunc_1_op_res_221525 = x_221515 + x_221520;\n                    double defunc_1_op_res_221526 = x_221516 + x_221521;\n                    double defunc_1_op_res_221527 = x_221517 ",
                   "+ x_221522;\n                    double defunc_1_op_res_221528 = x_221518 + x_221523;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_235232 = defunc_1_op_res_221524;\n                        x_acc_235233 = defunc_1_op_res_221525;\n                        x_acc_235234 = defunc_1_op_res_221526;\n                        x_acc_235235 = defunc_1_op_res_221527;\n                        x_acc_235236 = defunc_1_op_res_221528;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_221514 = x_acc_235232;\n            x_221515 = x_acc_235233;\n            x_221516 = x_acc_235234;\n            x_221517 = x_acc_235235;\n            x_221518 = x_acc_235236;\n            ((__local\n              double *) red_arr_mem_235211)[sext_i32_i64(local_tid_235207)] =\n                x_221514;\n            ((__local\n              double *) red_arr_mem_235213)[sext_i32_i64(local_tid_235207)] =\n                x_221515;\n            ((__local\n              double *) red_arr_mem_235215)[sext_i32_i64(local_tid_235207)] =\n                x_221516;\n            ((__local\n              double *) red_arr_mem_235217)[sext_i32_i64(local_tid_235207)] =\n                x_221517;\n            ((__local\n              double *) red_arr_mem_235219)[sext_i32_i64(local_tid_235207)] =\n                x_221518;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_235254;\n        int32_t skip_waves_235255 = 1;\n        double x_235238;\n        double x_235239;\n        double x_235240;\n        double x_235241;\n        double x_235242;\n        double x_235243;\n        double x_235244;\n        double x_235245;\n        double x_235246;\n        double x_235247;\n        \n        offset_235254 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_235207,\n                      sext_i64_i32",
                   "(segred_group_sizze_221502))) {\n                x_235238 = ((__local\n                             double *) red_arr_mem_235211)[sext_i32_i64(local_tid_235207 +\n                                                           offset_235254)];\n                x_235239 = ((__local\n                             double *) red_arr_mem_235213)[sext_i32_i64(local_tid_235207 +\n                                                           offset_235254)];\n                x_235240 = ((__local\n                             double *) red_arr_mem_235215)[sext_i32_i64(local_tid_235207 +\n                                                           offset_235254)];\n                x_235241 = ((__local\n                             double *) red_arr_mem_235217)[sext_i32_i64(local_tid_235207 +\n                                                           offset_235254)];\n                x_235242 = ((__local\n                             double *) red_arr_mem_235219)[sext_i32_i64(local_tid_235207 +\n                                                           offset_235254)];\n            }\n        }\n        offset_235254 = 1;\n        while (slt32(offset_235254, wave_sizze_235209)) {\n            if (slt32(local_tid_235207 + offset_235254,\n                      sext_i64_i32(segred_group_sizze_221502)) &&\n                ((local_tid_235207 - squot32(local_tid_235207,\n                                             wave_sizze_235209) *\n                  wave_sizze_235209) & (2 * offset_235254 - 1)) == 0) {\n                // read array element\n                {\n                    x_235243 = ((volatile __local\n                                 double *) red_arr_mem_235211)[sext_i32_i64(local_tid_235207 +\n                                                               offset_235254)];\n                    x_235244 = ((volatile __local\n                                 double *) red_arr_mem_235213)[sext_i32_i64(local_tid_235207 +\n                                                               offset_235254)];\n          ",
                   "          x_235245 = ((volatile __local\n                                 double *) red_arr_mem_235215)[sext_i32_i64(local_tid_235207 +\n                                                               offset_235254)];\n                    x_235246 = ((volatile __local\n                                 double *) red_arr_mem_235217)[sext_i32_i64(local_tid_235207 +\n                                                               offset_235254)];\n                    x_235247 = ((volatile __local\n                                 double *) red_arr_mem_235219)[sext_i32_i64(local_tid_235207 +\n                                                               offset_235254)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235248 = x_235238 + x_235243;\n                    double defunc_1_op_res_235249 = x_235239 + x_235244;\n                    double defunc_1_op_res_235250 = x_235240 + x_235245;\n                    double defunc_1_op_res_235251 = x_235241 + x_235246;\n                    double defunc_1_op_res_235252 = x_235242 + x_235247;\n                    \n                    x_235238 = defunc_1_op_res_235248;\n                    x_235239 = defunc_1_op_res_235249;\n                    x_235240 = defunc_1_op_res_235250;\n                    x_235241 = defunc_1_op_res_235251;\n                    x_235242 = defunc_1_op_res_235252;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_235211)[sext_i32_i64(local_tid_235207)] =\n                        x_235238;\n                    ((volatile __local\n                      double *) red_arr_mem_235213)[sext_i32_i64(local_tid_235207)] =\n                        x_235239;\n                    ((volatile __local\n                      double *) red_arr_mem_235215)[sext_i32_i64(local_tid_235207)] =\n                        x_235240;\n                    ((volatile __lo",
                   "cal\n                      double *) red_arr_mem_235217)[sext_i32_i64(local_tid_235207)] =\n                        x_235241;\n                    ((volatile __local\n                      double *) red_arr_mem_235219)[sext_i32_i64(local_tid_235207)] =\n                        x_235242;\n                }\n            }\n            offset_235254 *= 2;\n        }\n        while (slt32(skip_waves_235255,\n                     squot32(sext_i64_i32(segred_group_sizze_221502) +\n                             wave_sizze_235209 - 1, wave_sizze_235209))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_235254 = skip_waves_235255 * wave_sizze_235209;\n            if (slt32(local_tid_235207 + offset_235254,\n                      sext_i64_i32(segred_group_sizze_221502)) &&\n                ((local_tid_235207 - squot32(local_tid_235207,\n                                             wave_sizze_235209) *\n                  wave_sizze_235209) == 0 && (squot32(local_tid_235207,\n                                                      wave_sizze_235209) & (2 *\n                                                                            skip_waves_235255 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_235243 = ((__local\n                                 double *) red_arr_mem_235211)[sext_i32_i64(local_tid_235207 +\n                                                               offset_235254)];\n                    x_235244 = ((__local\n                                 double *) red_arr_mem_235213)[sext_i32_i64(local_tid_235207 +\n                                                               offset_235254)];\n                    x_235245 = ((__local\n                                 double *) red_arr_mem_235215)[sext_i32_i64(local_tid_235207 +\n                                                               offset_235254)];\n                    x_235246 = ((__loca",
                   "l\n                                 double *) red_arr_mem_235217)[sext_i32_i64(local_tid_235207 +\n                                                               offset_235254)];\n                    x_235247 = ((__local\n                                 double *) red_arr_mem_235219)[sext_i32_i64(local_tid_235207 +\n                                                               offset_235254)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235248 = x_235238 + x_235243;\n                    double defunc_1_op_res_235249 = x_235239 + x_235244;\n                    double defunc_1_op_res_235250 = x_235240 + x_235245;\n                    double defunc_1_op_res_235251 = x_235241 + x_235246;\n                    double defunc_1_op_res_235252 = x_235242 + x_235247;\n                    \n                    x_235238 = defunc_1_op_res_235248;\n                    x_235239 = defunc_1_op_res_235249;\n                    x_235240 = defunc_1_op_res_235250;\n                    x_235241 = defunc_1_op_res_235251;\n                    x_235242 = defunc_1_op_res_235252;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_235211)[sext_i32_i64(local_tid_235207)] =\n                        x_235238;\n                    ((__local\n                      double *) red_arr_mem_235213)[sext_i32_i64(local_tid_235207)] =\n                        x_235239;\n                    ((__local\n                      double *) red_arr_mem_235215)[sext_i32_i64(local_tid_235207)] =\n                        x_235240;\n                    ((__local\n                      double *) red_arr_mem_235217)[sext_i32_i64(local_tid_235207)] =\n                        x_235241;\n                    ((__local\n                      double *) red_arr_mem_235219)[sext_i32_i64(local_tid_235207)] =\n                        x_235242;\n                }\n            }\n  ",
                   "          skip_waves_235255 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_235207) == (int64_t) 0) {\n                x_acc_235232 = x_235238;\n                x_acc_235233 = x_235239;\n                x_acc_235234 = x_235240;\n                x_acc_235235 = x_235241;\n                x_acc_235236 = x_235242;\n            }\n        }\n        if (groups_per_segment_235189 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_235207 == 0) {\n                    ((__global double *) mem_230891)[gtid_221510 *\n                                                     l_n_m_203733 +\n                                                     gtid_221511] =\n                        x_acc_235232;\n                    ((__global double *) mem_230895)[gtid_221510 *\n                                                     l_n_m_203733 +\n                                                     gtid_221511] =\n                        x_acc_235233;\n                    ((__global double *) mem_230899)[gtid_221510 *\n                                                     l_n_m_203733 +\n                                                     gtid_221511] =\n                        x_acc_235234;\n                    ((__global double *) mem_230903)[gtid_221510 *\n                                                     l_n_m_203733 +\n                                                     gtid_221511] =\n                        x_acc_235235;\n                    ((__global double *) mem_230907)[gtid_221510 *\n                                                     l_n_m_203733 +\n                                                     gtid_221511] =\n                        x_acc_235236;\n                }\n            }\n        } else {\n            int32_t old_counter_235256;\n            \n            // first thread in group saves group result to global memo",
                   "ry\n            {\n                if (local_tid_235207 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_235194)[sext_i32_i64(virt_group_id_235225)] =\n                        x_acc_235232;\n                    ((__global\n                      double *) segred_tmp_mem_235196)[sext_i32_i64(virt_group_id_235225)] =\n                        x_acc_235233;\n                    ((__global\n                      double *) segred_tmp_mem_235198)[sext_i32_i64(virt_group_id_235225)] =\n                        x_acc_235234;\n                    ((__global\n                      double *) segred_tmp_mem_235200)[sext_i32_i64(virt_group_id_235225)] =\n                        x_acc_235235;\n                    ((__global\n                      double *) segred_tmp_mem_235202)[sext_i32_i64(virt_group_id_235225)] =\n                        x_acc_235236;\n                    mem_fence_global();\n                    old_counter_235256 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235204)[sext_i32_i64(srem32(flat_segment_id_235226,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_235221)[(int64_t) 0] =\n                        old_counter_235256 == groups_per_segment_235189 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_235257;\n            \n            is_last_group_235257 = ((__local\n                                     bool *) sync_arr_mem_235221)[(int64_t) 0];\n            if (is_last_group_235257) {\n                if (local_tid_235207 == 0) {\n                    old_counter_235256 =\n                        atomic_add_i32_global(&((volatile __global\n                     ",
                   "                            int *) mainzicounter_mem_235204)[sext_i32_i64(srem32(flat_segment_id_235226,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_235189));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_235258 =\n                            sdiv_up64(groups_per_segment_235189,\n                                      segred_group_sizze_221502);\n                    \n                    x_221514 = 0.0;\n                    x_221515 = 0.0;\n                    x_221516 = 0.0;\n                    x_221517 = 0.0;\n                    x_221518 = 0.0;\n                    for (int64_t i_235259 = 0; i_235259 <\n                         read_per_thread_235258; i_235259++) {\n                        int64_t group_res_id_235260 =\n                                sext_i32_i64(local_tid_235207) *\n                                read_per_thread_235258 + i_235259;\n                        int64_t index_of_group_res_235261 =\n                                sext_i32_i64(flat_segment_id_235226) *\n                                groups_per_segment_235189 + group_res_id_235260;\n                        \n                        if (slt64(group_res_id_235260,\n                                  groups_per_segment_235189)) {\n                            x_221519 = ((__global\n                                         double *) segred_tmp_mem_235194)[index_of_group_res_235261];\n                            x_221520 = ((__global\n                                         double *) segred_tmp_mem_235196)[index_of_group_res_235261];\n                            x_221521 = ((__global\n                                         double *) segred_tmp_mem_235198)[index_of_group_res_235261];\n                            x_221522 = ((__gl",
                   "obal\n                                         double *) segred_tmp_mem_235200)[index_of_group_res_235261];\n                            x_221523 = ((__global\n                                         double *) segred_tmp_mem_235202)[index_of_group_res_235261];\n                            \n                            double defunc_1_op_res_221524 = x_221514 + x_221519;\n                            double defunc_1_op_res_221525 = x_221515 + x_221520;\n                            double defunc_1_op_res_221526 = x_221516 + x_221521;\n                            double defunc_1_op_res_221527 = x_221517 + x_221522;\n                            double defunc_1_op_res_221528 = x_221518 + x_221523;\n                            \n                            x_221514 = defunc_1_op_res_221524;\n                            x_221515 = defunc_1_op_res_221525;\n                            x_221516 = defunc_1_op_res_221526;\n                            x_221517 = defunc_1_op_res_221527;\n                            x_221518 = defunc_1_op_res_221528;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_235211)[sext_i32_i64(local_tid_235207)] =\n                    x_221514;\n                ((__local\n                  double *) red_arr_mem_235213)[sext_i32_i64(local_tid_235207)] =\n                    x_221515;\n                ((__local\n                  double *) red_arr_mem_235215)[sext_i32_i64(local_tid_235207)] =\n                    x_221516;\n                ((__local\n                  double *) red_arr_mem_235217)[sext_i32_i64(local_tid_235207)] =\n                    x_221517;\n                ((__local\n                  double *) red_arr_mem_235219)[sext_i32_i64(local_tid_235207)] =\n                    x_221518;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_235262;\n                    int32_t skip_waves_235263 = 1;\n ",
                   "                   double x_235238;\n                    double x_235239;\n                    double x_235240;\n                    double x_235241;\n                    double x_235242;\n                    double x_235243;\n                    double x_235244;\n                    double x_235245;\n                    double x_235246;\n                    double x_235247;\n                    \n                    offset_235262 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_235207,\n                                  sext_i64_i32(segred_group_sizze_221502))) {\n                            x_235238 = ((__local\n                                         double *) red_arr_mem_235211)[sext_i32_i64(local_tid_235207 +\n                                                                       offset_235262)];\n                            x_235239 = ((__local\n                                         double *) red_arr_mem_235213)[sext_i32_i64(local_tid_235207 +\n                                                                       offset_235262)];\n                            x_235240 = ((__local\n                                         double *) red_arr_mem_235215)[sext_i32_i64(local_tid_235207 +\n                                                                       offset_235262)];\n                            x_235241 = ((__local\n                                         double *) red_arr_mem_235217)[sext_i32_i64(local_tid_235207 +\n                                                                       offset_235262)];\n                            x_235242 = ((__local\n                                         double *) red_arr_mem_235219)[sext_i32_i64(local_tid_235207 +\n                                                                       offset_235262)];\n                        }\n                    }\n                    offset_235262 = 1;\n                    while (slt32(offset_235262, wave_sizze_235",
                   "209)) {\n                        if (slt32(local_tid_235207 + offset_235262,\n                                  sext_i64_i32(segred_group_sizze_221502)) &&\n                            ((local_tid_235207 - squot32(local_tid_235207,\n                                                         wave_sizze_235209) *\n                              wave_sizze_235209) & (2 * offset_235262 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_235243 = ((volatile __local\n                                             double *) red_arr_mem_235211)[sext_i32_i64(local_tid_235207 +\n                                                                           offset_235262)];\n                                x_235244 = ((volatile __local\n                                             double *) red_arr_mem_235213)[sext_i32_i64(local_tid_235207 +\n                                                                           offset_235262)];\n                                x_235245 = ((volatile __local\n                                             double *) red_arr_mem_235215)[sext_i32_i64(local_tid_235207 +\n                                                                           offset_235262)];\n                                x_235246 = ((volatile __local\n                                             double *) red_arr_mem_235217)[sext_i32_i64(local_tid_235207 +\n                                                                           offset_235262)];\n                                x_235247 = ((volatile __local\n                                             double *) red_arr_mem_235219)[sext_i32_i64(local_tid_235207 +\n                                                                           offset_235262)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235248 = x_235238 +\n    ",
                   "                                   x_235243;\n                                double defunc_1_op_res_235249 = x_235239 +\n                                       x_235244;\n                                double defunc_1_op_res_235250 = x_235240 +\n                                       x_235245;\n                                double defunc_1_op_res_235251 = x_235241 +\n                                       x_235246;\n                                double defunc_1_op_res_235252 = x_235242 +\n                                       x_235247;\n                                \n                                x_235238 = defunc_1_op_res_235248;\n                                x_235239 = defunc_1_op_res_235249;\n                                x_235240 = defunc_1_op_res_235250;\n                                x_235241 = defunc_1_op_res_235251;\n                                x_235242 = defunc_1_op_res_235252;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235211)[sext_i32_i64(local_tid_235207)] =\n                                    x_235238;\n                                ((volatile __local\n                                  double *) red_arr_mem_235213)[sext_i32_i64(local_tid_235207)] =\n                                    x_235239;\n                                ((volatile __local\n                                  double *) red_arr_mem_235215)[sext_i32_i64(local_tid_235207)] =\n                                    x_235240;\n                                ((volatile __local\n                                  double *) red_arr_mem_235217)[sext_i32_i64(local_tid_235207)] =\n                                    x_235241;\n                                ((volatile __local\n                                  double *) red_arr_mem_235219)[sext_i32_i64(local_tid_235207)] =\n                                    x_235242;",
                   "\n                            }\n                        }\n                        offset_235262 *= 2;\n                    }\n                    while (slt32(skip_waves_235263,\n                                 squot32(sext_i64_i32(segred_group_sizze_221502) +\n                                         wave_sizze_235209 - 1,\n                                         wave_sizze_235209))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_235262 = skip_waves_235263 * wave_sizze_235209;\n                        if (slt32(local_tid_235207 + offset_235262,\n                                  sext_i64_i32(segred_group_sizze_221502)) &&\n                            ((local_tid_235207 - squot32(local_tid_235207,\n                                                         wave_sizze_235209) *\n                              wave_sizze_235209) == 0 &&\n                             (squot32(local_tid_235207, wave_sizze_235209) &\n                              (2 * skip_waves_235263 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_235243 = ((__local\n                                             double *) red_arr_mem_235211)[sext_i32_i64(local_tid_235207 +\n                                                                           offset_235262)];\n                                x_235244 = ((__local\n                                             double *) red_arr_mem_235213)[sext_i32_i64(local_tid_235207 +\n                                                                           offset_235262)];\n                                x_235245 = ((__local\n                                             double *) red_arr_mem_235215)[sext_i32_i64(local_tid_235207 +\n                                                                           offset_235262)];\n                                x_235246 = ((__local\n                                             double *) red_arr_mem_235217)[sext_i32_i64(loc",
                   "al_tid_235207 +\n                                                                           offset_235262)];\n                                x_235247 = ((__local\n                                             double *) red_arr_mem_235219)[sext_i32_i64(local_tid_235207 +\n                                                                           offset_235262)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235248 = x_235238 +\n                                       x_235243;\n                                double defunc_1_op_res_235249 = x_235239 +\n                                       x_235244;\n                                double defunc_1_op_res_235250 = x_235240 +\n                                       x_235245;\n                                double defunc_1_op_res_235251 = x_235241 +\n                                       x_235246;\n                                double defunc_1_op_res_235252 = x_235242 +\n                                       x_235247;\n                                \n                                x_235238 = defunc_1_op_res_235248;\n                                x_235239 = defunc_1_op_res_235249;\n                                x_235240 = defunc_1_op_res_235250;\n                                x_235241 = defunc_1_op_res_235251;\n                                x_235242 = defunc_1_op_res_235252;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_235211)[sext_i32_i64(local_tid_235207)] =\n                                    x_235238;\n                                ((__local\n                                  double *) red_arr_mem_235213)[sext_i32_i64(local_tid_235207)] =\n                                    x_235239;\n                                ((__local\n    ",
                   "                              double *) red_arr_mem_235215)[sext_i32_i64(local_tid_235207)] =\n                                    x_235240;\n                                ((__local\n                                  double *) red_arr_mem_235217)[sext_i32_i64(local_tid_235207)] =\n                                    x_235241;\n                                ((__local\n                                  double *) red_arr_mem_235219)[sext_i32_i64(local_tid_235207)] =\n                                    x_235242;\n                            }\n                        }\n                        skip_waves_235263 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_235207 == 0) {\n                            ((__global double *) mem_230891)[gtid_221510 *\n                                                             l_n_m_203733 +\n                                                             gtid_221511] =\n                                x_235238;\n                            ((__global double *) mem_230895)[gtid_221510 *\n                                                             l_n_m_203733 +\n                                                             gtid_221511] =\n                                x_235239;\n                            ((__global double *) mem_230899)[gtid_221510 *\n                                                             l_n_m_203733 +\n                                                             gtid_221511] =\n                                x_235240;\n                            ((__global double *) mem_230903)[gtid_221510 *\n                                                             l_n_m_203733 +\n                                                             gtid_221511] =\n                                x_235241;\n                            ((__global double *) mem_230907)[gtid_221510 *\n                                                             l_n_m_20373",
                   "3 +\n                                                             gtid_221511] =\n                                x_235242;\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_221502\n}\n__kernel void mainzisegred_large_221611(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_235329_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235327_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235325_backing_aligned_2,\n                                        int64_t n_203572, int64_t q_l_203577,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t l_n_m_203733, int64_t i_203760,\n                                        int64_t num_groups_221604,\n                                        int64_t ctx_param_ext_229596,\n                                        int64_t ctx_param_ext_229597,\n                                        int64_t ctx_param_ext_229599,\n                                        int64_t groups_per_segment_235309,\n                                        int64_t elements_per_thread_235310,\n                                        int64_t virt_num_groups_235311,\n                                        int64_t threads_per_segment_235313,\n                                        __global unsigned char *ext_mem_229519,\n                                        __global unsigned char *ext_mem_229520,\n                                        __global\n                                        unsigned char *mem_param_229601,\n",
                   "                                        __global unsigned char *mem_230659,\n                                        __global unsigned char *mem_230912,\n                                        __global unsigned char *mem_230916,\n                                        __global unsigned char *mem_230920,\n                                        __global unsigned char *mem_230924,\n                                        __global unsigned char *mem_230928,\n                                        __global unsigned char *mem_230933,\n                                        __global unsigned char *mem_230937,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235314,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235316,\n                                        __global\n                                        unsigned char *mainzicounter_mem_235318)\n{\n    #define segred_group_sizze_221603 (mainzisegred_group_sizze_220973)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict sync_arr_mem_235329_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_235329_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_235327_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235327_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_235325_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235325_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235320;\n    int32_t local_tid_235321;\n    int64_t group_sizze_235324;\n    int32_t wave_sizze_23532",
                   "3;\n    int32_t group_tid_235322;\n    \n    global_tid_235320 = get_global_id(0);\n    local_tid_235321 = get_local_id(0);\n    group_sizze_235324 = get_local_size(0);\n    wave_sizze_235323 = LOCKSTEP_WIDTH;\n    group_tid_235322 = get_group_id(0);\n    \n    int32_t phys_tid_221611 = global_tid_235320;\n    __local unsigned char *red_arr_mem_235325;\n    \n    red_arr_mem_235325 = (__local unsigned char *) red_arr_mem_235325_backing_0;\n    \n    __local unsigned char *red_arr_mem_235327;\n    \n    red_arr_mem_235327 = (__local unsigned char *) red_arr_mem_235327_backing_1;\n    \n    __local unsigned char *sync_arr_mem_235329;\n    \n    sync_arr_mem_235329 = (__local\n                           unsigned char *) sync_arr_mem_235329_backing_2;\n    \n    int32_t phys_group_id_235331;\n    \n    phys_group_id_235331 = get_group_id(0);\n    for (int32_t i_235332 = 0; i_235332 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_235311) - phys_group_id_235331,\n                   sext_i64_i32(num_groups_221604)); i_235332++) {\n        int32_t virt_group_id_235333 = phys_group_id_235331 + i_235332 *\n                sext_i64_i32(num_groups_221604);\n        int32_t flat_segment_id_235334 = squot32(virt_group_id_235333,\n                                                 sext_i64_i32(groups_per_segment_235309));\n        int64_t global_tid_235335 = srem64(sext_i32_i64(virt_group_id_235333) *\n                                           segred_group_sizze_221603 +\n                                           sext_i32_i64(local_tid_235321),\n                                           segred_group_sizze_221603 *\n                                           groups_per_segment_235309);\n        int64_t slice_235336 = l_n_m_203733;\n        int64_t slice_235337 = partition_sizze_203667 * slice_235336;\n        int64_t gtid_221608 = squot64(sext_i32_i64(flat_segment_id_235334),\n                                      slice_235336);\n        int64_t remnant_235338 = sext_i32_i64(flat_segment_id_235334) -\n                gt",
                   "id_221608 * slice_235336;\n        int64_t gtid_221609 = remnant_235338;\n        int64_t remnant_235339 = remnant_235338 - gtid_221609;\n        int64_t gtid_221610;\n        double x_acc_235340;\n        double x_acc_235341;\n        int64_t chunk_sizze_235342 = smin64(elements_per_thread_235310,\n                                            sdiv_up64(q_l_203577 -\n                                                      global_tid_235335,\n                                                      threads_per_segment_235313));\n        double x_221612;\n        double x_221613;\n        double x_221614;\n        double x_221615;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_235340 = 0.0;\n            x_acc_235341 = 0.0;\n        }\n        for (int64_t i_235349 = 0; i_235349 < chunk_sizze_235342; i_235349++) {\n            gtid_221610 = global_tid_235335 + threads_per_segment_235313 *\n                i_235349;\n            // apply map function\n            {\n                int64_t x_221628;\n                \n                x_221628 = ((__global int64_t *) ext_mem_229520)[gtid_221608 *\n                                                                 l_n_m_203733 +\n                                                                 gtid_221609];\n                \n                double x_221629;\n                \n                x_221629 = ((__global double *) ext_mem_229519)[gtid_221608 *\n                                                                l_n_m_203733 +\n                                                                gtid_221609];\n                \n                int64_t binop_y_228795 = mul64(jump_t_203582, gtid_221609);\n                int64_t binop_y_228796 = smin64(i_203760, binop_y_228795);\n                int64_t index_primexp_228797 = add64((int64_t) 1,\n                                                     binop_y_228796);\n                double a12_221631;\n                \n                a12_221631 = ((__global double *) mem_230912)[gtid",
                   "_221608 *\n                                                              l_n_m_203733 +\n                                                              gtid_221609];\n                \n                double b12_221632;\n                \n                b12_221632 = ((__global double *) mem_230916)[gtid_221608 *\n                                                              l_n_m_203733 +\n                                                              gtid_221609];\n                \n                double c12_221633;\n                \n                c12_221633 = ((__global double *) mem_230920)[gtid_221608 *\n                                                              l_n_m_203733 +\n                                                              gtid_221609];\n                \n                double b2_221634;\n                \n                b2_221634 = ((__global double *) mem_230924)[gtid_221608 *\n                                                             l_n_m_203733 +\n                                                             gtid_221609];\n                \n                double c2_221635;\n                \n                c2_221635 = ((__global double *) mem_230928)[gtid_221608 *\n                                                             l_n_m_203733 +\n                                                             gtid_221609];\n                \n                bool cond_221637 = sle64(n_203572, gtid_221610);\n                int64_t defunc_0_f_res_221638;\n                \n                if (cond_221637) {\n                    defunc_0_f_res_221638 = (int64_t) 0;\n                } else {\n                    int64_t i_221639 = add64(gtid_221610, x_221628);\n                    int64_t defunc_1_add_res_221640 = add64((int64_t) 1,\n                                                            i_221639);\n                    \n                    defunc_0_f_res_221638 = defunc_1_add_res_221640;\n                }\n                \n                double defunc_0_f_res_221641;\n      ",
                   "          \n                if (cond_221637) {\n                    defunc_0_f_res_221641 = 0.0;\n                } else {\n                    int64_t i_221642 = add64(gtid_221610, x_221628);\n                    double defunc_0_add_arg_221643;\n                    \n                    defunc_0_add_arg_221643 = ((__global\n                                                double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                            (gtid_221608 *\n                                                                             ctx_param_ext_229597 +\n                                                                             i_221642 *\n                                                                             ctx_param_ext_229599)];\n                    defunc_0_f_res_221641 = defunc_0_add_arg_221643;\n                }\n                \n                int64_t binop_p_221644 = sub64(defunc_0_f_res_221638,\n                                               index_primexp_228797);\n                double defunc_0_f_res_221645 = sitofp_i64_f64(binop_p_221644);\n                double abs_res_221646 = fabs(defunc_0_f_res_221645);\n                double tmp1_221647 = abs_res_221646 / x_221629;\n                double x_221648 = tmp1_221647 * tmp1_221647;\n                double y_221649 = tmp1_221647 * x_221648;\n                double tmp2_221650 = 1.0 - y_221649;\n                double x_221651 = tmp2_221650 * tmp2_221650;\n                double tmp3_221652 = tmp2_221650 * x_221651;\n                double tmp4_221653 = defunc_0_f_res_221641 * tmp3_221652;\n                double defunc_1_f_res_221654 = defunc_0_f_res_221645 *\n                       tmp4_221653;\n                double defunc_1_f_res_221655 = defunc_0_f_res_221645 *\n                       defunc_1_f_res_221654;\n                double defunc_0_f_res_221656;\n                \n                if (cond_221637) {\n                    defunc_0_f_res_221656 = 0.0;\n       ",
                   "         } else {\n                    int64_t i_221657 = add64(gtid_221610, x_221628);\n                    double defunc_0_add_arg_221658;\n                    \n                    defunc_0_add_arg_221658 = ((__global\n                                                double *) mem_230659)[gtid_221608 *\n                                                                      n_203572 +\n                                                                      i_221657];\n                    defunc_0_f_res_221656 = defunc_0_add_arg_221658;\n                }\n                \n                double x_221659 = a12_221631 * tmp4_221653;\n                double y_221660 = b12_221632 * defunc_1_f_res_221654;\n                double x_221661 = x_221659 + y_221660;\n                double y_221662 = c12_221633 * defunc_1_f_res_221655;\n                double x_221663 = x_221661 + y_221662;\n                double defunc_9_fit_fun_res_221664 = defunc_0_f_res_221656 *\n                       x_221663;\n                double x_221665 = b12_221632 * tmp4_221653;\n                double y_221666 = b2_221634 * defunc_1_f_res_221654;\n                double x_221667 = x_221665 + y_221666;\n                double y_221668 = c2_221635 * defunc_1_f_res_221655;\n                double x_221669 = x_221667 + y_221668;\n                double defunc_9_slope_fun_res_221670 = defunc_0_f_res_221656 *\n                       x_221669;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_221612 = x_acc_235340;\n                    x_221613 = x_acc_235341;\n                }\n                // load new values\n                {\n                    x_221614 = defunc_9_fit_fun_res_221664;\n                    x_221615 = defunc_9_slope_fun_res_221670;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_221616 = x_221612 + x_221614;\n                    double",
                   " defunc_1_op_res_221617 = x_221613 + x_221615;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_235340 = defunc_1_op_res_221616;\n                        x_acc_235341 = defunc_1_op_res_221617;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_221612 = x_acc_235340;\n            x_221613 = x_acc_235341;\n            ((__local\n              double *) red_arr_mem_235325)[sext_i32_i64(local_tid_235321)] =\n                x_221612;\n            ((__local\n              double *) red_arr_mem_235327)[sext_i32_i64(local_tid_235321)] =\n                x_221613;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_235350;\n        int32_t skip_waves_235351 = 1;\n        double x_235343;\n        double x_235344;\n        double x_235345;\n        double x_235346;\n        \n        offset_235350 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_235321,\n                      sext_i64_i32(segred_group_sizze_221603))) {\n                x_235343 = ((__local\n                             double *) red_arr_mem_235325)[sext_i32_i64(local_tid_235321 +\n                                                           offset_235350)];\n                x_235344 = ((__local\n                             double *) red_arr_mem_235327)[sext_i32_i64(local_tid_235321 +\n                                                           offset_235350)];\n            }\n        }\n        offset_235350 = 1;\n        while (slt32(offset_235350, wave_sizze_235323)) {\n            if (slt32(local_tid_235321 + offset_235350,\n                      sext_i64_i32(segred_group_sizze_221603)) &&\n                ((local_tid_235321 - squot32(local_tid_235321,\n                                             wave_sizze_235323) *\n                  wave_sizze_235323) & (2 * offset_235350 - 1)) ==",
                   " 0) {\n                // read array element\n                {\n                    x_235345 = ((volatile __local\n                                 double *) red_arr_mem_235325)[sext_i32_i64(local_tid_235321 +\n                                                               offset_235350)];\n                    x_235346 = ((volatile __local\n                                 double *) red_arr_mem_235327)[sext_i32_i64(local_tid_235321 +\n                                                               offset_235350)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235347 = x_235343 + x_235345;\n                    double defunc_1_op_res_235348 = x_235344 + x_235346;\n                    \n                    x_235343 = defunc_1_op_res_235347;\n                    x_235344 = defunc_1_op_res_235348;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_235325)[sext_i32_i64(local_tid_235321)] =\n                        x_235343;\n                    ((volatile __local\n                      double *) red_arr_mem_235327)[sext_i32_i64(local_tid_235321)] =\n                        x_235344;\n                }\n            }\n            offset_235350 *= 2;\n        }\n        while (slt32(skip_waves_235351,\n                     squot32(sext_i64_i32(segred_group_sizze_221603) +\n                             wave_sizze_235323 - 1, wave_sizze_235323))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_235350 = skip_waves_235351 * wave_sizze_235323;\n            if (slt32(local_tid_235321 + offset_235350,\n                      sext_i64_i32(segred_group_sizze_221603)) &&\n                ((local_tid_235321 - squot32(local_tid_235321,\n                                             wave_sizze_235323) *\n                  wave_sizze_235323) == 0 && (squot32(local_tid_235321,\n                                       ",
                   "               wave_sizze_235323) & (2 *\n                                                                            skip_waves_235351 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_235345 = ((__local\n                                 double *) red_arr_mem_235325)[sext_i32_i64(local_tid_235321 +\n                                                               offset_235350)];\n                    x_235346 = ((__local\n                                 double *) red_arr_mem_235327)[sext_i32_i64(local_tid_235321 +\n                                                               offset_235350)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235347 = x_235343 + x_235345;\n                    double defunc_1_op_res_235348 = x_235344 + x_235346;\n                    \n                    x_235343 = defunc_1_op_res_235347;\n                    x_235344 = defunc_1_op_res_235348;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_235325)[sext_i32_i64(local_tid_235321)] =\n                        x_235343;\n                    ((__local\n                      double *) red_arr_mem_235327)[sext_i32_i64(local_tid_235321)] =\n                        x_235344;\n                }\n            }\n            skip_waves_235351 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_235321) == (int64_t) 0) {\n                x_acc_235340 = x_235343;\n                x_acc_235341 = x_235344;\n            }\n        }\n        if (groups_per_segment_235309 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_235321 == 0",
                   ") {\n                    ((__global double *) mem_230933)[gtid_221608 *\n                                                     l_n_m_203733 +\n                                                     gtid_221609] =\n                        x_acc_235340;\n                    ((__global double *) mem_230937)[gtid_221608 *\n                                                     l_n_m_203733 +\n                                                     gtid_221609] =\n                        x_acc_235341;\n                }\n            }\n        } else {\n            int32_t old_counter_235352;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_235321 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_235314)[sext_i32_i64(virt_group_id_235333)] =\n                        x_acc_235340;\n                    ((__global\n                      double *) segred_tmp_mem_235316)[sext_i32_i64(virt_group_id_235333)] =\n                        x_acc_235341;\n                    mem_fence_global();\n                    old_counter_235352 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235318)[sext_i32_i64(srem32(flat_segment_id_235334,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_235329)[(int64_t) 0] =\n                        old_counter_235352 == groups_per_segment_235309 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_235353;\n            \n            is_last_group_235353 = ((__local\n                                     bool *) sync_arr_mem_235329)[(int64_t) 0];\n            if (is_last_group_235353) {\n  ",
                   "              if (local_tid_235321 == 0) {\n                    old_counter_235352 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235318)[sext_i32_i64(srem32(flat_segment_id_235334,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_235309));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_235354 =\n                            sdiv_up64(groups_per_segment_235309,\n                                      segred_group_sizze_221603);\n                    \n                    x_221612 = 0.0;\n                    x_221613 = 0.0;\n                    for (int64_t i_235355 = 0; i_235355 <\n                         read_per_thread_235354; i_235355++) {\n                        int64_t group_res_id_235356 =\n                                sext_i32_i64(local_tid_235321) *\n                                read_per_thread_235354 + i_235355;\n                        int64_t index_of_group_res_235357 =\n                                sext_i32_i64(flat_segment_id_235334) *\n                                groups_per_segment_235309 + group_res_id_235356;\n                        \n                        if (slt64(group_res_id_235356,\n                                  groups_per_segment_235309)) {\n                            x_221614 = ((__global\n                                         double *) segred_tmp_mem_235314)[index_of_group_res_235357];\n                            x_221615 = ((__global\n                                         double *) segred_tmp_mem_235316)[index_of_group_res_235357];\n                            \n                            double defunc_1_op_res_221616 = x_221612 + x_221614;\n                       ",
                   "     double defunc_1_op_res_221617 = x_221613 + x_221615;\n                            \n                            x_221612 = defunc_1_op_res_221616;\n                            x_221613 = defunc_1_op_res_221617;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_235325)[sext_i32_i64(local_tid_235321)] =\n                    x_221612;\n                ((__local\n                  double *) red_arr_mem_235327)[sext_i32_i64(local_tid_235321)] =\n                    x_221613;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_235358;\n                    int32_t skip_waves_235359 = 1;\n                    double x_235343;\n                    double x_235344;\n                    double x_235345;\n                    double x_235346;\n                    \n                    offset_235358 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_235321,\n                                  sext_i64_i32(segred_group_sizze_221603))) {\n                            x_235343 = ((__local\n                                         double *) red_arr_mem_235325)[sext_i32_i64(local_tid_235321 +\n                                                                       offset_235358)];\n                            x_235344 = ((__local\n                                         double *) red_arr_mem_235327)[sext_i32_i64(local_tid_235321 +\n                                                                       offset_235358)];\n                        }\n                    }\n                    offset_235358 = 1;\n                    while (slt32(offset_235358, wave_sizze_235323)) {\n                        if (slt32(local_tid_235321 + offset_235358,\n                                  sext_i64_i32(segred_group_sizze_221603)) &&\n                          ",
                   "  ((local_tid_235321 - squot32(local_tid_235321,\n                                                         wave_sizze_235323) *\n                              wave_sizze_235323) & (2 * offset_235358 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_235345 = ((volatile __local\n                                             double *) red_arr_mem_235325)[sext_i32_i64(local_tid_235321 +\n                                                                           offset_235358)];\n                                x_235346 = ((volatile __local\n                                             double *) red_arr_mem_235327)[sext_i32_i64(local_tid_235321 +\n                                                                           offset_235358)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235347 = x_235343 +\n                                       x_235345;\n                                double defunc_1_op_res_235348 = x_235344 +\n                                       x_235346;\n                                \n                                x_235343 = defunc_1_op_res_235347;\n                                x_235344 = defunc_1_op_res_235348;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235325)[sext_i32_i64(local_tid_235321)] =\n                                    x_235343;\n                                ((volatile __local\n                                  double *) red_arr_mem_235327)[sext_i32_i64(local_tid_235321)] =\n                                    x_235344;\n                            }\n                        }\n                        offset_235358 *= 2;\n                    ",
                   "}\n                    while (slt32(skip_waves_235359,\n                                 squot32(sext_i64_i32(segred_group_sizze_221603) +\n                                         wave_sizze_235323 - 1,\n                                         wave_sizze_235323))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_235358 = skip_waves_235359 * wave_sizze_235323;\n                        if (slt32(local_tid_235321 + offset_235358,\n                                  sext_i64_i32(segred_group_sizze_221603)) &&\n                            ((local_tid_235321 - squot32(local_tid_235321,\n                                                         wave_sizze_235323) *\n                              wave_sizze_235323) == 0 &&\n                             (squot32(local_tid_235321, wave_sizze_235323) &\n                              (2 * skip_waves_235359 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_235345 = ((__local\n                                             double *) red_arr_mem_235325)[sext_i32_i64(local_tid_235321 +\n                                                                           offset_235358)];\n                                x_235346 = ((__local\n                                             double *) red_arr_mem_235327)[sext_i32_i64(local_tid_235321 +\n                                                                           offset_235358)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235347 = x_235343 +\n                                       x_235345;\n                                double defunc_1_op_res_235348 = x_235344 +\n                                       x_235346;\n                                \n                                x_235343 = defunc_1_op_res_235347;\n                                x_235344 = defunc_1_",
                   "op_res_235348;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_235325)[sext_i32_i64(local_tid_235321)] =\n                                    x_235343;\n                                ((__local\n                                  double *) red_arr_mem_235327)[sext_i32_i64(local_tid_235321)] =\n                                    x_235344;\n                            }\n                        }\n                        skip_waves_235359 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_235321 == 0) {\n                            ((__global double *) mem_230933)[gtid_221608 *\n                                                             l_n_m_203733 +\n                                                             gtid_221609] =\n                                x_235343;\n                            ((__global double *) mem_230937)[gtid_221608 *\n                                                             l_n_m_203733 +\n                                                             gtid_221609] =\n                                x_235344;\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_221603\n}\n__kernel void mainzisegred_large_223287(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_235569_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235567_backing_aligned_1,\n                                        int64_t n_203572, int64_t q_t_203576,\n                                ",
                   "        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t t_n_m_203740, int64_t i_203760,\n                                        int64_t num_groups_223281,\n                                        int64_t groups_per_segment_235553,\n                                        int64_t elements_per_thread_235554,\n                                        int64_t virt_num_groups_235555,\n                                        int64_t threads_per_segment_235557,\n                                        __global unsigned char *ext_mem_229304,\n                                        __global unsigned char *ext_mem_229305,\n                                        __global unsigned char *ext_mem_229568,\n                                        __global unsigned char *ext_mem_229569,\n                                        __global unsigned char *mem_231121,\n                                        __global unsigned char *mem_231135,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235558,\n                                        __global\n                                        unsigned char *mainzicounter_mem_235560)\n{\n    #define segred_group_sizze_223280 (mainzisegred_group_sizze_222884)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict sync_arr_mem_235569_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_235569_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_235567_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235567_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235562;\n    int32_t local_tid_23",
                   "5563;\n    int64_t group_sizze_235566;\n    int32_t wave_sizze_235565;\n    int32_t group_tid_235564;\n    \n    global_tid_235562 = get_global_id(0);\n    local_tid_235563 = get_local_id(0);\n    group_sizze_235566 = get_local_size(0);\n    wave_sizze_235565 = LOCKSTEP_WIDTH;\n    group_tid_235564 = get_group_id(0);\n    \n    int32_t phys_tid_223287 = global_tid_235562;\n    __local unsigned char *red_arr_mem_235567;\n    \n    red_arr_mem_235567 = (__local unsigned char *) red_arr_mem_235567_backing_0;\n    \n    __local unsigned char *sync_arr_mem_235569;\n    \n    sync_arr_mem_235569 = (__local\n                           unsigned char *) sync_arr_mem_235569_backing_1;\n    \n    int32_t phys_group_id_235571;\n    \n    phys_group_id_235571 = get_group_id(0);\n    for (int32_t i_235572 = 0; i_235572 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_235555) - phys_group_id_235571,\n                   sext_i64_i32(num_groups_223281)); i_235572++) {\n        int32_t virt_group_id_235573 = phys_group_id_235571 + i_235572 *\n                sext_i64_i32(num_groups_223281);\n        int32_t flat_segment_id_235574 = squot32(virt_group_id_235573,\n                                                 sext_i64_i32(groups_per_segment_235553));\n        int64_t global_tid_235575 = srem64(sext_i32_i64(virt_group_id_235573) *\n                                           segred_group_sizze_223280 +\n                                           sext_i32_i64(local_tid_235563),\n                                           segred_group_sizze_223280 *\n                                           groups_per_segment_235553);\n        int64_t slice_235576 = t_n_m_203740;\n        int64_t slice_235577 = partition_sizze_203667 * slice_235576;\n        int64_t gtid_223284 = squot64(sext_i32_i64(flat_segment_id_235574),\n                                      slice_235576);\n        int64_t remnant_235578 = sext_i32_i64(flat_segment_id_235574) -\n                gtid_223284 * slice_235576;\n        int64_t gtid_223285 = remnant_235578;\n",
                   "        int64_t remnant_235579 = remnant_235578 - gtid_223285;\n        int64_t gtid_223286;\n        double x_acc_235580;\n        int64_t chunk_sizze_235581 = smin64(elements_per_thread_235554,\n                                            sdiv_up64(q_t_203576 -\n                                                      global_tid_235575,\n                                                      threads_per_segment_235557));\n        double x_223288;\n        double x_223289;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_235580 = 0.0;\n        }\n        for (int64_t i_235585 = 0; i_235585 < chunk_sizze_235581; i_235585++) {\n            gtid_223286 = global_tid_235575 + threads_per_segment_235557 *\n                i_235585;\n            // apply map function\n            {\n                int64_t x_223292;\n                \n                x_223292 = ((__global int64_t *) ext_mem_229304)[gtid_223284];\n                \n                int64_t x_223297;\n                \n                x_223297 = ((__global int64_t *) ext_mem_229569)[gtid_223284 *\n                                                                 t_n_m_203740 +\n                                                                 gtid_223285];\n                \n                double x_223298;\n                \n                x_223298 = ((__global double *) ext_mem_229568)[gtid_223284 *\n                                                                t_n_m_203740 +\n                                                                gtid_223285];\n                \n                int64_t binop_y_228750 = mul64(jump_t_203582, gtid_223285);\n                int64_t binop_y_228751 = smin64(i_203760, binop_y_228750);\n                int64_t index_primexp_228752 = add64((int64_t) 1,\n                                                     binop_y_228751);\n                bool cond_223301 = sle64(x_223292, gtid_223286);\n                int64_t defunc_0_f_res_223302;\n                \n                if (cond_",
                   "223301) {\n                    defunc_0_f_res_223302 = (int64_t) 0;\n                } else {\n                    int64_t i_223303 = add64(gtid_223286, x_223297);\n                    int64_t defunc_0_add_arg_223304;\n                    \n                    defunc_0_add_arg_223304 = ((__global\n                                                int64_t *) ext_mem_229305)[gtid_223284 *\n                                                                           n_203572 +\n                                                                           i_223303];\n                    \n                    int64_t defunc_1_add_res_223305 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_223304);\n                    \n                    defunc_0_f_res_223302 = defunc_1_add_res_223305;\n                }\n                \n                double defunc_0_f_res_223306;\n                \n                if (cond_223301) {\n                    defunc_0_f_res_223306 = 0.0;\n                } else {\n                    int64_t i_223307 = add64(gtid_223286, x_223297);\n                    double defunc_0_add_arg_223308;\n                    \n                    defunc_0_add_arg_223308 = ((__global\n                                                double *) mem_231121)[gtid_223284 *\n                                                                      n_203572 +\n                                                                      i_223307];\n                    defunc_0_f_res_223306 = defunc_0_add_arg_223308;\n                }\n                \n                int64_t binop_p_223309 = sub64(defunc_0_f_res_223302,\n                                               index_primexp_228752);\n                double defunc_0_f_res_223310 = sitofp_i64_f64(binop_p_223309);\n                double abs_res_223311 = fabs(defunc_0_f_res_223310);\n                double tmp1_223312 = abs_res_223311 / x_223298;\n                double x_223313 = tmp1_223312 * tmp1_223312;\n        ",
                   "        double y_223314 = tmp1_223312 * x_223313;\n                double tmp2_223315 = 1.0 - y_223314;\n                double x_223316 = tmp2_223315 * tmp2_223315;\n                double tmp3_223317 = tmp2_223315 * x_223316;\n                double w_j_223318 = defunc_0_f_res_223306 * tmp3_223317;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_223288 = x_acc_235580;\n                }\n                // load new values\n                {\n                    x_223289 = w_j_223318;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_223290 = x_223288 + x_223289;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_235580 = defunc_1_op_res_223290;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_223288 = x_acc_235580;\n            ((__local\n              double *) red_arr_mem_235567)[sext_i32_i64(local_tid_235563)] =\n                x_223288;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_235586;\n        int32_t skip_waves_235587 = 1;\n        double x_235582;\n        double x_235583;\n        \n        offset_235586 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_235563,\n                      sext_i64_i32(segred_group_sizze_223280))) {\n                x_235582 = ((__local\n                             double *) red_arr_mem_235567)[sext_i32_i64(local_tid_235563 +\n                                                           offset_235586)];\n            }\n        }\n        offset_235586 = 1;\n        while (slt32(offset_235586, wave_sizze_235565)) {\n            if (slt32(local_tid_235563 + offset_235586,\n                      sext_i64_i32(segred_group",
                   "_sizze_223280)) &&\n                ((local_tid_235563 - squot32(local_tid_235563,\n                                             wave_sizze_235565) *\n                  wave_sizze_235565) & (2 * offset_235586 - 1)) == 0) {\n                // read array element\n                {\n                    x_235583 = ((volatile __local\n                                 double *) red_arr_mem_235567)[sext_i32_i64(local_tid_235563 +\n                                                               offset_235586)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235584 = x_235582 + x_235583;\n                    \n                    x_235582 = defunc_1_op_res_235584;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_235567)[sext_i32_i64(local_tid_235563)] =\n                        x_235582;\n                }\n            }\n            offset_235586 *= 2;\n        }\n        while (slt32(skip_waves_235587,\n                     squot32(sext_i64_i32(segred_group_sizze_223280) +\n                             wave_sizze_235565 - 1, wave_sizze_235565))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_235586 = skip_waves_235587 * wave_sizze_235565;\n            if (slt32(local_tid_235563 + offset_235586,\n                      sext_i64_i32(segred_group_sizze_223280)) &&\n                ((local_tid_235563 - squot32(local_tid_235563,\n                                             wave_sizze_235565) *\n                  wave_sizze_235565) == 0 && (squot32(local_tid_235563,\n                                                      wave_sizze_235565) & (2 *\n                                                                            skip_waves_235587 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {",
                   "\n                    x_235583 = ((__local\n                                 double *) red_arr_mem_235567)[sext_i32_i64(local_tid_235563 +\n                                                               offset_235586)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235584 = x_235582 + x_235583;\n                    \n                    x_235582 = defunc_1_op_res_235584;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_235567)[sext_i32_i64(local_tid_235563)] =\n                        x_235582;\n                }\n            }\n            skip_waves_235587 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_235563) == (int64_t) 0) {\n                x_acc_235580 = x_235582;\n            }\n        }\n        if (groups_per_segment_235553 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_235563 == 0) {\n                    ((__global double *) mem_231135)[gtid_223284 *\n                                                     t_n_m_203740 +\n                                                     gtid_223285] =\n                        x_acc_235580;\n                }\n            }\n        } else {\n            int32_t old_counter_235588;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_235563 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_235558)[sext_i32_i64(virt_group_id_235573)] =\n                        x_acc_235580;\n                    mem_fence_global();\n                    old_counter_235588 =\n                        atomic_add_i32_global(&((volatile __global\n                                            ",
                   "     int *) mainzicounter_mem_235560)[sext_i32_i64(srem32(flat_segment_id_235574,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_235569)[(int64_t) 0] =\n                        old_counter_235588 == groups_per_segment_235553 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_235589;\n            \n            is_last_group_235589 = ((__local\n                                     bool *) sync_arr_mem_235569)[(int64_t) 0];\n            if (is_last_group_235589) {\n                if (local_tid_235563 == 0) {\n                    old_counter_235588 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235560)[sext_i32_i64(srem32(flat_segment_id_235574,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_235553));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_235590 =\n                            sdiv_up64(groups_per_segment_235553,\n                                      segred_group_sizze_223280);\n                    \n                    x_223288 = 0.0;\n                    for (int64_t i_235591 = 0; i_235591 <\n                         read_per_thread_235590; i_235591++) {\n                        int64_t group_res_id_235592 =\n                                sext_i32_i64(local_tid_235563) *\n                                read_per_thread_235590 + i_235591;\n                        int64_t index_of_group_res_235593 =\n     ",
                   "                           sext_i32_i64(flat_segment_id_235574) *\n                                groups_per_segment_235553 + group_res_id_235592;\n                        \n                        if (slt64(group_res_id_235592,\n                                  groups_per_segment_235553)) {\n                            x_223289 = ((__global\n                                         double *) segred_tmp_mem_235558)[index_of_group_res_235593];\n                            \n                            double defunc_1_op_res_223290 = x_223288 + x_223289;\n                            \n                            x_223288 = defunc_1_op_res_223290;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_235567)[sext_i32_i64(local_tid_235563)] =\n                    x_223288;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_235594;\n                    int32_t skip_waves_235595 = 1;\n                    double x_235582;\n                    double x_235583;\n                    \n                    offset_235594 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_235563,\n                                  sext_i64_i32(segred_group_sizze_223280))) {\n                            x_235582 = ((__local\n                                         double *) red_arr_mem_235567)[sext_i32_i64(local_tid_235563 +\n                                                                       offset_235594)];\n                        }\n                    }\n                    offset_235594 = 1;\n                    while (slt32(offset_235594, wave_sizze_235565)) {\n                        if (slt32(local_tid_235563 + offset_235594,\n                                  sext_i64_i32(segred_group_sizze_223280)) &&\n                            ((local_tid_235563",
                   " - squot32(local_tid_235563,\n                                                         wave_sizze_235565) *\n                              wave_sizze_235565) & (2 * offset_235594 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_235583 = ((volatile __local\n                                             double *) red_arr_mem_235567)[sext_i32_i64(local_tid_235563 +\n                                                                           offset_235594)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235584 = x_235582 +\n                                       x_235583;\n                                \n                                x_235582 = defunc_1_op_res_235584;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235567)[sext_i32_i64(local_tid_235563)] =\n                                    x_235582;\n                            }\n                        }\n                        offset_235594 *= 2;\n                    }\n                    while (slt32(skip_waves_235595,\n                                 squot32(sext_i64_i32(segred_group_sizze_223280) +\n                                         wave_sizze_235565 - 1,\n                                         wave_sizze_235565))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_235594 = skip_waves_235595 * wave_sizze_235565;\n                        if (slt32(local_tid_235563 + offset_235594,\n                                  sext_i64_i32(segred_group_sizze_223280)) &&\n                            ((local_tid_235563 - squot32(local_tid_235563,\n                                                ",
                   "         wave_sizze_235565) *\n                              wave_sizze_235565) == 0 &&\n                             (squot32(local_tid_235563, wave_sizze_235565) &\n                              (2 * skip_waves_235595 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_235583 = ((__local\n                                             double *) red_arr_mem_235567)[sext_i32_i64(local_tid_235563 +\n                                                                           offset_235594)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235584 = x_235582 +\n                                       x_235583;\n                                \n                                x_235582 = defunc_1_op_res_235584;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_235567)[sext_i32_i64(local_tid_235563)] =\n                                    x_235582;\n                            }\n                        }\n                        skip_waves_235595 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_235563 == 0) {\n                            ((__global double *) mem_231135)[gtid_223284 *\n                                                             t_n_m_203740 +\n                                                             gtid_223285] =\n                                x_235582;\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_223280\n}\n__kernel void mainzisegred_large_2",
                   "23339(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_235651_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235649_backing_aligned_1,\n                                        int64_t n_203572, int64_t q_t_203576,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t t_n_m_203740, int64_t i_203760,\n                                        int64_t num_groups_223333,\n                                        int64_t groups_per_segment_235635,\n                                        int64_t elements_per_thread_235636,\n                                        int64_t virt_num_groups_235637,\n                                        int64_t threads_per_segment_235639,\n                                        __global unsigned char *ext_mem_229304,\n                                        __global unsigned char *ext_mem_229305,\n                                        __global unsigned char *ext_mem_229568,\n                                        __global unsigned char *ext_mem_229569,\n                                        __global unsigned char *mem_231121,\n                                        __global unsigned char *mem_231125,\n                                        __global unsigned char *mem_231140,\n                                        __global unsigned char *mem_231145,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235640,\n                                        __global\n                                        unsigned char *mainzicounter_mem_235642)\n{\n    #define segred_group_sizze_223332 (mainzisegred_group_sizze_222814)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 =",
                   " 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict sync_arr_mem_235651_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_235651_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_235649_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235649_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235644;\n    int32_t local_tid_235645;\n    int64_t group_sizze_235648;\n    int32_t wave_sizze_235647;\n    int32_t group_tid_235646;\n    \n    global_tid_235644 = get_global_id(0);\n    local_tid_235645 = get_local_id(0);\n    group_sizze_235648 = get_local_size(0);\n    wave_sizze_235647 = LOCKSTEP_WIDTH;\n    group_tid_235646 = get_group_id(0);\n    \n    int32_t phys_tid_223339 = global_tid_235644;\n    __local unsigned char *red_arr_mem_235649;\n    \n    red_arr_mem_235649 = (__local unsigned char *) red_arr_mem_235649_backing_0;\n    \n    __local unsigned char *sync_arr_mem_235651;\n    \n    sync_arr_mem_235651 = (__local\n                           unsigned char *) sync_arr_mem_235651_backing_1;\n    \n    int32_t phys_group_id_235653;\n    \n    phys_group_id_235653 = get_group_id(0);\n    for (int32_t i_235654 = 0; i_235654 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_235637) - phys_group_id_235653,\n                   sext_i64_i32(num_groups_223333)); i_235654++) {\n        int32_t virt_group_id_235655 = phys_group_id_235653 + i_235654 *\n                sext_i64_i32(num_groups_223333);\n        int32_t flat_segment_id_235656 = squot32(virt_group_id_235655,\n                                                 sext_i64_i32(groups_per_segment_235635));\n        int64_t global_tid_235657 = srem64(sext_i32_i64(virt_group_id_235655) *\n                                           segred_group_sizze_223332 +\n                                    ",
                   "       sext_i32_i64(local_tid_235645),\n                                           segred_group_sizze_223332 *\n                                           groups_per_segment_235635);\n        int64_t slice_235658 = t_n_m_203740;\n        int64_t slice_235659 = partition_sizze_203667 * slice_235658;\n        int64_t gtid_223336 = squot64(sext_i32_i64(flat_segment_id_235656),\n                                      slice_235658);\n        int64_t remnant_235660 = sext_i32_i64(flat_segment_id_235656) -\n                gtid_223336 * slice_235658;\n        int64_t gtid_223337 = remnant_235660;\n        int64_t remnant_235661 = remnant_235660 - gtid_223337;\n        int64_t gtid_223338;\n        double x_acc_235662;\n        int64_t chunk_sizze_235663 = smin64(elements_per_thread_235636,\n                                            sdiv_up64(q_t_203576 -\n                                                      global_tid_235657,\n                                                      threads_per_segment_235639));\n        double x_223340;\n        double x_223341;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_235662 = 0.0;\n        }\n        for (int64_t i_235667 = 0; i_235667 < chunk_sizze_235663; i_235667++) {\n            gtid_223338 = global_tid_235657 + threads_per_segment_235639 *\n                i_235667;\n            // apply map function\n            {\n                int64_t x_223344;\n                \n                x_223344 = ((__global int64_t *) ext_mem_229304)[gtid_223336];\n                \n                int64_t x_223351;\n                \n                x_223351 = ((__global int64_t *) ext_mem_229569)[gtid_223336 *\n                                                                 t_n_m_203740 +\n                                                                 gtid_223337];\n                \n                double x_223352;\n                \n                x_223352 = ((__global double *) ext_mem_229568)[gtid_223336 *\n                            ",
                   "                                    t_n_m_203740 +\n                                                                gtid_223337];\n                \n                int64_t binop_y_228745 = mul64(jump_t_203582, gtid_223337);\n                int64_t binop_y_228746 = smin64(i_203760, binop_y_228745);\n                int64_t index_primexp_228747 = add64((int64_t) 1,\n                                                     binop_y_228746);\n                double a0_223354;\n                \n                a0_223354 = ((__global double *) mem_231140)[gtid_223336 *\n                                                             t_n_m_203740 +\n                                                             gtid_223337];\n                \n                bool cond_223356 = sle64(x_223344, gtid_223338);\n                int64_t defunc_0_f_res_223357;\n                \n                if (cond_223356) {\n                    defunc_0_f_res_223357 = (int64_t) 0;\n                } else {\n                    int64_t i_223358 = add64(gtid_223338, x_223351);\n                    int64_t defunc_0_add_arg_223359;\n                    \n                    defunc_0_add_arg_223359 = ((__global\n                                                int64_t *) ext_mem_229305)[gtid_223336 *\n                                                                           n_203572 +\n                                                                           i_223358];\n                    \n                    int64_t defunc_1_add_res_223360 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_223359);\n                    \n                    defunc_0_f_res_223357 = defunc_1_add_res_223360;\n                }\n                \n                double defunc_0_f_res_223361;\n                \n                if (cond_223356) {\n                    defunc_0_f_res_223361 = 0.0;\n                } else {\n                    int64_t i_223362 = add64(gtid_223338, x_223351);\n                    ",
                   "double defunc_0_add_arg_223363;\n                    \n                    defunc_0_add_arg_223363 = ((__global\n                                                double *) mem_231121)[gtid_223336 *\n                                                                      n_203572 +\n                                                                      i_223362];\n                    defunc_0_f_res_223361 = defunc_0_add_arg_223363;\n                }\n                \n                int64_t binop_p_223364 = sub64(defunc_0_f_res_223357,\n                                               index_primexp_228747);\n                double defunc_0_f_res_223365 = sitofp_i64_f64(binop_p_223364);\n                double abs_res_223366 = fabs(defunc_0_f_res_223365);\n                double tmp1_223367 = abs_res_223366 / x_223352;\n                double x_223368 = tmp1_223367 * tmp1_223367;\n                double y_223369 = tmp1_223367 * x_223368;\n                double tmp2_223370 = 1.0 - y_223369;\n                double x_223371 = tmp2_223370 * tmp2_223370;\n                double tmp3_223372 = tmp2_223370 * x_223371;\n                double tmp4_223373 = defunc_0_f_res_223361 * tmp3_223372;\n                double defunc_0_f_res_223374;\n                \n                if (cond_223356) {\n                    defunc_0_f_res_223374 = 0.0;\n                } else {\n                    int64_t i_223375 = add64(gtid_223338, x_223351);\n                    double defunc_0_add_arg_223376;\n                    \n                    defunc_0_add_arg_223376 = ((__global\n                                                double *) mem_231125)[gtid_223336 *\n                                                                      n_203572 +\n                                                                      i_223375];\n                    defunc_0_f_res_223374 = defunc_0_add_arg_223376;\n                }\n                \n                double x_223377 = a0_223354 * tmp4_223373;\n                double defunc_9_fit_fun_",
                   "res_223378 = defunc_0_f_res_223374 *\n                       x_223377;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_223340 = x_acc_235662;\n                }\n                // load new values\n                {\n                    x_223341 = defunc_9_fit_fun_res_223378;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_223342 = x_223340 + x_223341;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_235662 = defunc_1_op_res_223342;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_223340 = x_acc_235662;\n            ((__local\n              double *) red_arr_mem_235649)[sext_i32_i64(local_tid_235645)] =\n                x_223340;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_235668;\n        int32_t skip_waves_235669 = 1;\n        double x_235664;\n        double x_235665;\n        \n        offset_235668 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_235645,\n                      sext_i64_i32(segred_group_sizze_223332))) {\n                x_235664 = ((__local\n                             double *) red_arr_mem_235649)[sext_i32_i64(local_tid_235645 +\n                                                           offset_235668)];\n            }\n        }\n        offset_235668 = 1;\n        while (slt32(offset_235668, wave_sizze_235647)) {\n            if (slt32(local_tid_235645 + offset_235668,\n                      sext_i64_i32(segred_group_sizze_223332)) &&\n                ((local_tid_235645 - squot32(local_tid_235645,\n                                             wave_sizze_235647) *\n                  wave_sizze_235647) & (2 * offset_235668 - 1))",
                   " == 0) {\n                // read array element\n                {\n                    x_235665 = ((volatile __local\n                                 double *) red_arr_mem_235649)[sext_i32_i64(local_tid_235645 +\n                                                               offset_235668)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235666 = x_235664 + x_235665;\n                    \n                    x_235664 = defunc_1_op_res_235666;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_235649)[sext_i32_i64(local_tid_235645)] =\n                        x_235664;\n                }\n            }\n            offset_235668 *= 2;\n        }\n        while (slt32(skip_waves_235669,\n                     squot32(sext_i64_i32(segred_group_sizze_223332) +\n                             wave_sizze_235647 - 1, wave_sizze_235647))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_235668 = skip_waves_235669 * wave_sizze_235647;\n            if (slt32(local_tid_235645 + offset_235668,\n                      sext_i64_i32(segred_group_sizze_223332)) &&\n                ((local_tid_235645 - squot32(local_tid_235645,\n                                             wave_sizze_235647) *\n                  wave_sizze_235647) == 0 && (squot32(local_tid_235645,\n                                                      wave_sizze_235647) & (2 *\n                                                                            skip_waves_235669 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_235665 = ((__local\n                                 double *) red_arr_mem_235649)[sext_i32_i64(local_tid_235645 +\n                                                               offset_2356",
                   "68)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235666 = x_235664 + x_235665;\n                    \n                    x_235664 = defunc_1_op_res_235666;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_235649)[sext_i32_i64(local_tid_235645)] =\n                        x_235664;\n                }\n            }\n            skip_waves_235669 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_235645) == (int64_t) 0) {\n                x_acc_235662 = x_235664;\n            }\n        }\n        if (groups_per_segment_235635 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_235645 == 0) {\n                    ((__global double *) mem_231145)[gtid_223336 *\n                                                     t_n_m_203740 +\n                                                     gtid_223337] =\n                        x_acc_235662;\n                }\n            }\n        } else {\n            int32_t old_counter_235670;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_235645 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_235640)[sext_i32_i64(virt_group_id_235655)] =\n                        x_acc_235662;\n                    mem_fence_global();\n                    old_counter_235670 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235642)[sext_i32_i64(srem32(flat_segment_id_235656,\n                                                                                                      10240))],\n                 ",
                   "                             (int) 1);\n                    ((__local bool *) sync_arr_mem_235651)[(int64_t) 0] =\n                        old_counter_235670 == groups_per_segment_235635 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_235671;\n            \n            is_last_group_235671 = ((__local\n                                     bool *) sync_arr_mem_235651)[(int64_t) 0];\n            if (is_last_group_235671) {\n                if (local_tid_235645 == 0) {\n                    old_counter_235670 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235642)[sext_i32_i64(srem32(flat_segment_id_235656,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_235635));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_235672 =\n                            sdiv_up64(groups_per_segment_235635,\n                                      segred_group_sizze_223332);\n                    \n                    x_223340 = 0.0;\n                    for (int64_t i_235673 = 0; i_235673 <\n                         read_per_thread_235672; i_235673++) {\n                        int64_t group_res_id_235674 =\n                                sext_i32_i64(local_tid_235645) *\n                                read_per_thread_235672 + i_235673;\n                        int64_t index_of_group_res_235675 =\n                                sext_i32_i64(flat_segment_id_235656) *\n                                groups_per_segment_235635 + group_res_id_235674;\n                        \n                        if (slt64(group",
                   "_res_id_235674,\n                                  groups_per_segment_235635)) {\n                            x_223341 = ((__global\n                                         double *) segred_tmp_mem_235640)[index_of_group_res_235675];\n                            \n                            double defunc_1_op_res_223342 = x_223340 + x_223341;\n                            \n                            x_223340 = defunc_1_op_res_223342;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_235649)[sext_i32_i64(local_tid_235645)] =\n                    x_223340;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_235676;\n                    int32_t skip_waves_235677 = 1;\n                    double x_235664;\n                    double x_235665;\n                    \n                    offset_235676 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_235645,\n                                  sext_i64_i32(segred_group_sizze_223332))) {\n                            x_235664 = ((__local\n                                         double *) red_arr_mem_235649)[sext_i32_i64(local_tid_235645 +\n                                                                       offset_235676)];\n                        }\n                    }\n                    offset_235676 = 1;\n                    while (slt32(offset_235676, wave_sizze_235647)) {\n                        if (slt32(local_tid_235645 + offset_235676,\n                                  sext_i64_i32(segred_group_sizze_223332)) &&\n                            ((local_tid_235645 - squot32(local_tid_235645,\n                                                         wave_sizze_235647) *\n                              wave_sizze_235647) & (2 * offset_235676 - 1)) ==\n                         ",
                   "   0) {\n                            // read array element\n                            {\n                                x_235665 = ((volatile __local\n                                             double *) red_arr_mem_235649)[sext_i32_i64(local_tid_235645 +\n                                                                           offset_235676)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235666 = x_235664 +\n                                       x_235665;\n                                \n                                x_235664 = defunc_1_op_res_235666;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235649)[sext_i32_i64(local_tid_235645)] =\n                                    x_235664;\n                            }\n                        }\n                        offset_235676 *= 2;\n                    }\n                    while (slt32(skip_waves_235677,\n                                 squot32(sext_i64_i32(segred_group_sizze_223332) +\n                                         wave_sizze_235647 - 1,\n                                         wave_sizze_235647))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_235676 = skip_waves_235677 * wave_sizze_235647;\n                        if (slt32(local_tid_235645 + offset_235676,\n                                  sext_i64_i32(segred_group_sizze_223332)) &&\n                            ((local_tid_235645 - squot32(local_tid_235645,\n                                                         wave_sizze_235647) *\n                              wave_sizze_235647) == 0 &&\n                             (squot32(local_tid_235645, wave_sizze_235647) &\n                              (2 * skip_waves_2",
                   "35677 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_235665 = ((__local\n                                             double *) red_arr_mem_235649)[sext_i32_i64(local_tid_235645 +\n                                                                           offset_235676)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235666 = x_235664 +\n                                       x_235665;\n                                \n                                x_235664 = defunc_1_op_res_235666;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_235649)[sext_i32_i64(local_tid_235645)] =\n                                    x_235664;\n                            }\n                        }\n                        skip_waves_235677 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_235645 == 0) {\n                            ((__global double *) mem_231145)[gtid_223336 *\n                                                             t_n_m_203740 +\n                                                             gtid_223337] =\n                                x_235664;\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_223332\n}\n__kernel void mainzisegred_large_224325(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_235820_backing_aligned_0,\n                              ",
                   "          __local volatile\n                                        int64_t *red_arr_mem_235818_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235816_backing_aligned_2,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235814_backing_aligned_3,\n                                        int64_t n_203572, int64_t q_t_203576,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t t_n_m_203740, int64_t i_203760,\n                                        int64_t num_groups_224317,\n                                        int64_t groups_per_segment_235796,\n                                        int64_t elements_per_thread_235797,\n                                        int64_t virt_num_groups_235798,\n                                        int64_t threads_per_segment_235800,\n                                        __global unsigned char *ext_mem_229304,\n                                        __global unsigned char *ext_mem_229305,\n                                        __global unsigned char *ext_mem_229568,\n                                        __global unsigned char *ext_mem_229569,\n                                        __global unsigned char *mem_231259,\n                                        __global unsigned char *mem_231277,\n                                        __global unsigned char *mem_231281,\n                                        __global unsigned char *mem_231285,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235801,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235803,\n                                        __global\n            ",
                   "                            unsigned char *segred_tmp_mem_235805,\n                                        __global\n                                        unsigned char *mainzicounter_mem_235807)\n{\n    #define segred_group_sizze_224316 (mainzisegred_group_sizze_223845)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict sync_arr_mem_235820_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_235820_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_235818_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235818_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_235816_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235816_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_235814_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235814_backing_aligned_3;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235809;\n    int32_t local_tid_235810;\n    int64_t group_sizze_235813;\n    int32_t wave_sizze_235812;\n    int32_t group_tid_235811;\n    \n    global_tid_235809 = get_global_id(0);\n    local_tid_235810 = get_local_id(0);\n    group_sizze_235813 = get_local_size(0);\n    wave_sizze_235812 = LOCKSTEP_WIDTH;\n    group_tid_235811 = get_group_id(0);\n    \n    int32_t phys_tid_224325 = global_tid_235809;\n    __local unsigned char *red_arr_mem_235814;\n    \n    red_arr_mem_235814 = (__local unsigned char *) red_arr_mem_235814_backing_0;\n    \n    __local unsigned char *red_arr_mem_235816;\n    \n    red_arr_mem_235816 = (__local unsigned char *) red_arr_mem_235816_backing_1;\n    \n  ",
                   "  __local unsigned char *red_arr_mem_235818;\n    \n    red_arr_mem_235818 = (__local unsigned char *) red_arr_mem_235818_backing_2;\n    \n    __local unsigned char *sync_arr_mem_235820;\n    \n    sync_arr_mem_235820 = (__local\n                           unsigned char *) sync_arr_mem_235820_backing_3;\n    \n    int32_t phys_group_id_235822;\n    \n    phys_group_id_235822 = get_group_id(0);\n    for (int32_t i_235823 = 0; i_235823 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_235798) - phys_group_id_235822,\n                   sext_i64_i32(num_groups_224317)); i_235823++) {\n        int32_t virt_group_id_235824 = phys_group_id_235822 + i_235823 *\n                sext_i64_i32(num_groups_224317);\n        int32_t flat_segment_id_235825 = squot32(virt_group_id_235824,\n                                                 sext_i64_i32(groups_per_segment_235796));\n        int64_t global_tid_235826 = srem64(sext_i32_i64(virt_group_id_235824) *\n                                           segred_group_sizze_224316 +\n                                           sext_i32_i64(local_tid_235810),\n                                           segred_group_sizze_224316 *\n                                           groups_per_segment_235796);\n        int64_t slice_235827 = t_n_m_203740;\n        int64_t slice_235828 = partition_sizze_203667 * slice_235827;\n        int64_t gtid_224322 = squot64(sext_i32_i64(flat_segment_id_235825),\n                                      slice_235827);\n        int64_t remnant_235829 = sext_i32_i64(flat_segment_id_235825) -\n                gtid_224322 * slice_235827;\n        int64_t gtid_224323 = remnant_235829;\n        int64_t remnant_235830 = remnant_235829 - gtid_224323;\n        int64_t gtid_224324;\n        double x_acc_235831;\n        double x_acc_235832;\n        double x_acc_235833;\n        int64_t chunk_sizze_235834 = smin64(elements_per_thread_235797,\n                                            sdiv_up64(q_t_203576 -\n                                                ",
                   "      global_tid_235826,\n                                                      threads_per_segment_235800));\n        double x_224326;\n        double x_224327;\n        double x_224328;\n        double x_224329;\n        double x_224330;\n        double x_224331;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_235831 = 0.0;\n            x_acc_235832 = 0.0;\n            x_acc_235833 = 0.0;\n        }\n        for (int64_t i_235844 = 0; i_235844 < chunk_sizze_235834; i_235844++) {\n            gtid_224324 = global_tid_235826 + threads_per_segment_235800 *\n                i_235844;\n            // apply map function\n            {\n                int64_t x_224336;\n                \n                x_224336 = ((__global int64_t *) ext_mem_229304)[gtid_224322];\n                \n                int64_t x_224341;\n                \n                x_224341 = ((__global int64_t *) ext_mem_229569)[gtid_224322 *\n                                                                 t_n_m_203740 +\n                                                                 gtid_224323];\n                \n                double x_224342;\n                \n                x_224342 = ((__global double *) ext_mem_229568)[gtid_224322 *\n                                                                t_n_m_203740 +\n                                                                gtid_224323];\n                \n                int64_t binop_y_228760 = mul64(jump_t_203582, gtid_224323);\n                int64_t binop_y_228761 = smin64(i_203760, binop_y_228760);\n                int64_t index_primexp_228762 = add64((int64_t) 1,\n                                                     binop_y_228761);\n                bool cond_224345 = sle64(x_224336, gtid_224324);\n                int64_t defunc_0_f_res_224346;\n                \n                if (cond_224345) {\n                    defunc_0_f_res_224346 = (int64_t) 0;\n                } else {\n                    int64_t i_224347 = add64(gtid_22",
                   "4324, x_224341);\n                    int64_t defunc_0_add_arg_224348;\n                    \n                    defunc_0_add_arg_224348 = ((__global\n                                                int64_t *) ext_mem_229305)[gtid_224322 *\n                                                                           n_203572 +\n                                                                           i_224347];\n                    \n                    int64_t defunc_1_add_res_224349 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_224348);\n                    \n                    defunc_0_f_res_224346 = defunc_1_add_res_224349;\n                }\n                \n                double defunc_0_f_res_224350;\n                \n                if (cond_224345) {\n                    defunc_0_f_res_224350 = 0.0;\n                } else {\n                    int64_t i_224351 = add64(gtid_224324, x_224341);\n                    double defunc_0_add_arg_224352;\n                    \n                    defunc_0_add_arg_224352 = ((__global\n                                                double *) mem_231259)[gtid_224322 *\n                                                                      n_203572 +\n                                                                      i_224351];\n                    defunc_0_f_res_224350 = defunc_0_add_arg_224352;\n                }\n                \n                int64_t binop_p_224353 = sub64(defunc_0_f_res_224346,\n                                               index_primexp_228762);\n                double defunc_0_f_res_224354 = sitofp_i64_f64(binop_p_224353);\n                double abs_res_224355 = fabs(defunc_0_f_res_224354);\n                double tmp1_224356 = abs_res_224355 / x_224342;\n                double x_224357 = tmp1_224356 * tmp1_224356;\n                double y_224358 = tmp1_224356 * x_224357;\n                double tmp2_224359 = 1.0 - y_224358;\n                double x_224360 = tmp2_22",
                   "4359 * tmp2_224359;\n                double tmp3_224361 = tmp2_224359 * x_224360;\n                double w_j_224362 = defunc_0_f_res_224350 * tmp3_224361;\n                double xw_j_224363 = defunc_0_f_res_224354 * w_j_224362;\n                double x2w_j_224364 = defunc_0_f_res_224354 * xw_j_224363;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_224326 = x_acc_235831;\n                    x_224327 = x_acc_235832;\n                    x_224328 = x_acc_235833;\n                }\n                // load new values\n                {\n                    x_224329 = w_j_224362;\n                    x_224330 = xw_j_224363;\n                    x_224331 = x2w_j_224364;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_224332 = x_224326 + x_224329;\n                    double defunc_1_op_res_224333 = x_224327 + x_224330;\n                    double defunc_1_op_res_224334 = x_224328 + x_224331;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_235831 = defunc_1_op_res_224332;\n                        x_acc_235832 = defunc_1_op_res_224333;\n                        x_acc_235833 = defunc_1_op_res_224334;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_224326 = x_acc_235831;\n            x_224327 = x_acc_235832;\n            x_224328 = x_acc_235833;\n            ((__local\n              double *) red_arr_mem_235814)[sext_i32_i64(local_tid_235810)] =\n                x_224326;\n            ((__local\n              double *) red_arr_mem_235816)[sext_i32_i64(local_tid_235810)] =\n                x_224327;\n            ((__local\n              double *) red_arr_mem_235818)[sext_i32_i64(local_tid_235810)] =\n                x_224328;\n        }\n        barr",
                   "ier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_235845;\n        int32_t skip_waves_235846 = 1;\n        double x_235835;\n        double x_235836;\n        double x_235837;\n        double x_235838;\n        double x_235839;\n        double x_235840;\n        \n        offset_235845 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_235810,\n                      sext_i64_i32(segred_group_sizze_224316))) {\n                x_235835 = ((__local\n                             double *) red_arr_mem_235814)[sext_i32_i64(local_tid_235810 +\n                                                           offset_235845)];\n                x_235836 = ((__local\n                             double *) red_arr_mem_235816)[sext_i32_i64(local_tid_235810 +\n                                                           offset_235845)];\n                x_235837 = ((__local\n                             double *) red_arr_mem_235818)[sext_i32_i64(local_tid_235810 +\n                                                           offset_235845)];\n            }\n        }\n        offset_235845 = 1;\n        while (slt32(offset_235845, wave_sizze_235812)) {\n            if (slt32(local_tid_235810 + offset_235845,\n                      sext_i64_i32(segred_group_sizze_224316)) &&\n                ((local_tid_235810 - squot32(local_tid_235810,\n                                             wave_sizze_235812) *\n                  wave_sizze_235812) & (2 * offset_235845 - 1)) == 0) {\n                // read array element\n                {\n                    x_235838 = ((volatile __local\n                                 double *) red_arr_mem_235814)[sext_i32_i64(local_tid_235810 +\n                                                               offset_235845)];\n                    x_235839 = ((volatile __local\n                                 double *) red_arr_mem_235816)[sext_i32_i64(local_tid_235810 +\n                                                               of",
                   "fset_235845)];\n                    x_235840 = ((volatile __local\n                                 double *) red_arr_mem_235818)[sext_i32_i64(local_tid_235810 +\n                                                               offset_235845)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235841 = x_235835 + x_235838;\n                    double defunc_1_op_res_235842 = x_235836 + x_235839;\n                    double defunc_1_op_res_235843 = x_235837 + x_235840;\n                    \n                    x_235835 = defunc_1_op_res_235841;\n                    x_235836 = defunc_1_op_res_235842;\n                    x_235837 = defunc_1_op_res_235843;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_235814)[sext_i32_i64(local_tid_235810)] =\n                        x_235835;\n                    ((volatile __local\n                      double *) red_arr_mem_235816)[sext_i32_i64(local_tid_235810)] =\n                        x_235836;\n                    ((volatile __local\n                      double *) red_arr_mem_235818)[sext_i32_i64(local_tid_235810)] =\n                        x_235837;\n                }\n            }\n            offset_235845 *= 2;\n        }\n        while (slt32(skip_waves_235846,\n                     squot32(sext_i64_i32(segred_group_sizze_224316) +\n                             wave_sizze_235812 - 1, wave_sizze_235812))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_235845 = skip_waves_235846 * wave_sizze_235812;\n            if (slt32(local_tid_235810 + offset_235845,\n                      sext_i64_i32(segred_group_sizze_224316)) &&\n                ((local_tid_235810 - squot32(local_tid_235810,\n                                             wave_sizze_235812) *\n                  wave_sizze_235812) == 0 && (squot32(local_tid_235810,\n                        ",
                   "                              wave_sizze_235812) & (2 *\n                                                                            skip_waves_235846 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_235838 = ((__local\n                                 double *) red_arr_mem_235814)[sext_i32_i64(local_tid_235810 +\n                                                               offset_235845)];\n                    x_235839 = ((__local\n                                 double *) red_arr_mem_235816)[sext_i32_i64(local_tid_235810 +\n                                                               offset_235845)];\n                    x_235840 = ((__local\n                                 double *) red_arr_mem_235818)[sext_i32_i64(local_tid_235810 +\n                                                               offset_235845)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235841 = x_235835 + x_235838;\n                    double defunc_1_op_res_235842 = x_235836 + x_235839;\n                    double defunc_1_op_res_235843 = x_235837 + x_235840;\n                    \n                    x_235835 = defunc_1_op_res_235841;\n                    x_235836 = defunc_1_op_res_235842;\n                    x_235837 = defunc_1_op_res_235843;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_235814)[sext_i32_i64(local_tid_235810)] =\n                        x_235835;\n                    ((__local\n                      double *) red_arr_mem_235816)[sext_i32_i64(local_tid_235810)] =\n                        x_235836;\n                    ((__local\n                      double *) red_arr_mem_235818)[sext_i32_i64(local_tid_235810)] =\n                        x_235837;\n                }\n   ",
                   "         }\n            skip_waves_235846 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_235810) == (int64_t) 0) {\n                x_acc_235831 = x_235835;\n                x_acc_235832 = x_235836;\n                x_acc_235833 = x_235837;\n            }\n        }\n        if (groups_per_segment_235796 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_235810 == 0) {\n                    ((__global double *) mem_231277)[gtid_224322 *\n                                                     t_n_m_203740 +\n                                                     gtid_224323] =\n                        x_acc_235831;\n                    ((__global double *) mem_231281)[gtid_224322 *\n                                                     t_n_m_203740 +\n                                                     gtid_224323] =\n                        x_acc_235832;\n                    ((__global double *) mem_231285)[gtid_224322 *\n                                                     t_n_m_203740 +\n                                                     gtid_224323] =\n                        x_acc_235833;\n                }\n            }\n        } else {\n            int32_t old_counter_235847;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_235810 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_235801)[sext_i32_i64(virt_group_id_235824)] =\n                        x_acc_235831;\n                    ((__global\n                      double *) segred_tmp_mem_235803)[sext_i32_i64(virt_group_id_235824)] =\n                        x_acc_235832;\n                    ((__global\n                      double *) segred_tmp_mem_235805)[sext_i32_i64(virt_group_id_235824)] =\n                        x_acc_235833;\n   ",
                   "                 mem_fence_global();\n                    old_counter_235847 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235807)[sext_i32_i64(srem32(flat_segment_id_235825,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_235820)[(int64_t) 0] =\n                        old_counter_235847 == groups_per_segment_235796 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_235848;\n            \n            is_last_group_235848 = ((__local\n                                     bool *) sync_arr_mem_235820)[(int64_t) 0];\n            if (is_last_group_235848) {\n                if (local_tid_235810 == 0) {\n                    old_counter_235847 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235807)[sext_i32_i64(srem32(flat_segment_id_235825,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_235796));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_235849 =\n                            sdiv_up64(groups_per_segment_235796,\n                                      segred_group_sizze_224316);\n                    \n                    x_224326 = 0.0;\n                    x_224327 = 0.0;\n                    x_224328 = 0.0;\n                    for (int64_t i_235850 = 0; i_235850 <\n                         read_per_thread_235849; i_23",
                   "5850++) {\n                        int64_t group_res_id_235851 =\n                                sext_i32_i64(local_tid_235810) *\n                                read_per_thread_235849 + i_235850;\n                        int64_t index_of_group_res_235852 =\n                                sext_i32_i64(flat_segment_id_235825) *\n                                groups_per_segment_235796 + group_res_id_235851;\n                        \n                        if (slt64(group_res_id_235851,\n                                  groups_per_segment_235796)) {\n                            x_224329 = ((__global\n                                         double *) segred_tmp_mem_235801)[index_of_group_res_235852];\n                            x_224330 = ((__global\n                                         double *) segred_tmp_mem_235803)[index_of_group_res_235852];\n                            x_224331 = ((__global\n                                         double *) segred_tmp_mem_235805)[index_of_group_res_235852];\n                            \n                            double defunc_1_op_res_224332 = x_224326 + x_224329;\n                            double defunc_1_op_res_224333 = x_224327 + x_224330;\n                            double defunc_1_op_res_224334 = x_224328 + x_224331;\n                            \n                            x_224326 = defunc_1_op_res_224332;\n                            x_224327 = defunc_1_op_res_224333;\n                            x_224328 = defunc_1_op_res_224334;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_235814)[sext_i32_i64(local_tid_235810)] =\n                    x_224326;\n                ((__local\n                  double *) red_arr_mem_235816)[sext_i32_i64(local_tid_235810)] =\n                    x_224327;\n                ((__local\n                  double *) red_arr_mem_235818)[sext_i32_i64(local_tid_235810)] =\n                    x_224328;\n                barrie",
                   "r(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_235853;\n                    int32_t skip_waves_235854 = 1;\n                    double x_235835;\n                    double x_235836;\n                    double x_235837;\n                    double x_235838;\n                    double x_235839;\n                    double x_235840;\n                    \n                    offset_235853 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_235810,\n                                  sext_i64_i32(segred_group_sizze_224316))) {\n                            x_235835 = ((__local\n                                         double *) red_arr_mem_235814)[sext_i32_i64(local_tid_235810 +\n                                                                       offset_235853)];\n                            x_235836 = ((__local\n                                         double *) red_arr_mem_235816)[sext_i32_i64(local_tid_235810 +\n                                                                       offset_235853)];\n                            x_235837 = ((__local\n                                         double *) red_arr_mem_235818)[sext_i32_i64(local_tid_235810 +\n                                                                       offset_235853)];\n                        }\n                    }\n                    offset_235853 = 1;\n                    while (slt32(offset_235853, wave_sizze_235812)) {\n                        if (slt32(local_tid_235810 + offset_235853,\n                                  sext_i64_i32(segred_group_sizze_224316)) &&\n                            ((local_tid_235810 - squot32(local_tid_235810,\n                                                         wave_sizze_235812) *\n                              wave_sizze_235812) & (2 * offset_235853 - 1)) ==\n                            0) {\n                        ",
                   "    // read array element\n                            {\n                                x_235838 = ((volatile __local\n                                             double *) red_arr_mem_235814)[sext_i32_i64(local_tid_235810 +\n                                                                           offset_235853)];\n                                x_235839 = ((volatile __local\n                                             double *) red_arr_mem_235816)[sext_i32_i64(local_tid_235810 +\n                                                                           offset_235853)];\n                                x_235840 = ((volatile __local\n                                             double *) red_arr_mem_235818)[sext_i32_i64(local_tid_235810 +\n                                                                           offset_235853)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235841 = x_235835 +\n                                       x_235838;\n                                double defunc_1_op_res_235842 = x_235836 +\n                                       x_235839;\n                                double defunc_1_op_res_235843 = x_235837 +\n                                       x_235840;\n                                \n                                x_235835 = defunc_1_op_res_235841;\n                                x_235836 = defunc_1_op_res_235842;\n                                x_235837 = defunc_1_op_res_235843;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235814)[sext_i32_i64(local_tid_235810)] =\n                                    x_235835;\n                                ((volatile __local\n                                  double *) red_arr_mem_235816)[sext_i32_i6",
                   "4(local_tid_235810)] =\n                                    x_235836;\n                                ((volatile __local\n                                  double *) red_arr_mem_235818)[sext_i32_i64(local_tid_235810)] =\n                                    x_235837;\n                            }\n                        }\n                        offset_235853 *= 2;\n                    }\n                    while (slt32(skip_waves_235854,\n                                 squot32(sext_i64_i32(segred_group_sizze_224316) +\n                                         wave_sizze_235812 - 1,\n                                         wave_sizze_235812))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_235853 = skip_waves_235854 * wave_sizze_235812;\n                        if (slt32(local_tid_235810 + offset_235853,\n                                  sext_i64_i32(segred_group_sizze_224316)) &&\n                            ((local_tid_235810 - squot32(local_tid_235810,\n                                                         wave_sizze_235812) *\n                              wave_sizze_235812) == 0 &&\n                             (squot32(local_tid_235810, wave_sizze_235812) &\n                              (2 * skip_waves_235854 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_235838 = ((__local\n                                             double *) red_arr_mem_235814)[sext_i32_i64(local_tid_235810 +\n                                                                           offset_235853)];\n                                x_235839 = ((__local\n                                             double *) red_arr_mem_235816)[sext_i32_i64(local_tid_235810 +\n                                                                           offset_235853)];\n                                x_235840 = ((__local\n                                             double *) red_arr_mem_235818)[sext_",
                   "i32_i64(local_tid_235810 +\n                                                                           offset_235853)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235841 = x_235835 +\n                                       x_235838;\n                                double defunc_1_op_res_235842 = x_235836 +\n                                       x_235839;\n                                double defunc_1_op_res_235843 = x_235837 +\n                                       x_235840;\n                                \n                                x_235835 = defunc_1_op_res_235841;\n                                x_235836 = defunc_1_op_res_235842;\n                                x_235837 = defunc_1_op_res_235843;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_235814)[sext_i32_i64(local_tid_235810)] =\n                                    x_235835;\n                                ((__local\n                                  double *) red_arr_mem_235816)[sext_i32_i64(local_tid_235810)] =\n                                    x_235836;\n                                ((__local\n                                  double *) red_arr_mem_235818)[sext_i32_i64(local_tid_235810)] =\n                                    x_235837;\n                            }\n                        }\n                        skip_waves_235854 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_235810 == 0) {\n                            ((__global double *) mem_231277)[gtid_224322 *\n                                                             t_n_m_203740 +\n                                                             gtid_2",
                   "24323] =\n                                x_235835;\n                            ((__global double *) mem_231281)[gtid_224322 *\n                                                             t_n_m_203740 +\n                                                             gtid_224323] =\n                                x_235836;\n                            ((__global double *) mem_231285)[gtid_224322 *\n                                                             t_n_m_203740 +\n                                                             gtid_224323] =\n                                x_235837;\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_224316\n}\n__kernel void mainzisegred_large_224397(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_235920_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235918_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235916_backing_aligned_2,\n                                        int64_t n_203572, int64_t q_t_203576,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t t_n_m_203740, int64_t i_203760,\n                                        int64_t num_groups_224390,\n                                        int64_t groups_per_segment_235900,\n                                        int64_t elements_per_thread_235901,\n                                        int64_t virt_num_groups_235902,\n                                        int64_t threads_per_segment_235904,\n                         ",
                   "               __global unsigned char *ext_mem_229304,\n                                        __global unsigned char *ext_mem_229305,\n                                        __global unsigned char *ext_mem_229568,\n                                        __global unsigned char *ext_mem_229569,\n                                        __global unsigned char *mem_231259,\n                                        __global unsigned char *mem_231263,\n                                        __global unsigned char *mem_231290,\n                                        __global unsigned char *mem_231294,\n                                        __global unsigned char *mem_231298,\n                                        __global unsigned char *mem_231303,\n                                        __global unsigned char *mem_231307,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235905,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235907,\n                                        __global\n                                        unsigned char *mainzicounter_mem_235909)\n{\n    #define segred_group_sizze_224389 (mainzisegred_group_sizze_223748)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict sync_arr_mem_235920_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_235920_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_235918_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235918_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_235916_backing_0 =\n                                   (__local volatile\n                                    unsigned char",
                   " *) red_arr_mem_235916_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235911;\n    int32_t local_tid_235912;\n    int64_t group_sizze_235915;\n    int32_t wave_sizze_235914;\n    int32_t group_tid_235913;\n    \n    global_tid_235911 = get_global_id(0);\n    local_tid_235912 = get_local_id(0);\n    group_sizze_235915 = get_local_size(0);\n    wave_sizze_235914 = LOCKSTEP_WIDTH;\n    group_tid_235913 = get_group_id(0);\n    \n    int32_t phys_tid_224397 = global_tid_235911;\n    __local unsigned char *red_arr_mem_235916;\n    \n    red_arr_mem_235916 = (__local unsigned char *) red_arr_mem_235916_backing_0;\n    \n    __local unsigned char *red_arr_mem_235918;\n    \n    red_arr_mem_235918 = (__local unsigned char *) red_arr_mem_235918_backing_1;\n    \n    __local unsigned char *sync_arr_mem_235920;\n    \n    sync_arr_mem_235920 = (__local\n                           unsigned char *) sync_arr_mem_235920_backing_2;\n    \n    int32_t phys_group_id_235922;\n    \n    phys_group_id_235922 = get_group_id(0);\n    for (int32_t i_235923 = 0; i_235923 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_235902) - phys_group_id_235922,\n                   sext_i64_i32(num_groups_224390)); i_235923++) {\n        int32_t virt_group_id_235924 = phys_group_id_235922 + i_235923 *\n                sext_i64_i32(num_groups_224390);\n        int32_t flat_segment_id_235925 = squot32(virt_group_id_235924,\n                                                 sext_i64_i32(groups_per_segment_235900));\n        int64_t global_tid_235926 = srem64(sext_i32_i64(virt_group_id_235924) *\n                                           segred_group_sizze_224389 +\n                                           sext_i32_i64(local_tid_235912),\n                                           segred_group_sizze_224389 *\n                                           groups_per_segment_235900);\n        int64_t slice_235927 = t_n_m_203740;\n        int64_t slice_235928 = partition_sizze_203667 * slice_235927;\n",
                   "        int64_t gtid_224394 = squot64(sext_i32_i64(flat_segment_id_235925),\n                                      slice_235927);\n        int64_t remnant_235929 = sext_i32_i64(flat_segment_id_235925) -\n                gtid_224394 * slice_235927;\n        int64_t gtid_224395 = remnant_235929;\n        int64_t remnant_235930 = remnant_235929 - gtid_224395;\n        int64_t gtid_224396;\n        double x_acc_235931;\n        double x_acc_235932;\n        int64_t chunk_sizze_235933 = smin64(elements_per_thread_235901,\n                                            sdiv_up64(q_t_203576 -\n                                                      global_tid_235926,\n                                                      threads_per_segment_235904));\n        double x_224398;\n        double x_224399;\n        double x_224400;\n        double x_224401;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_235931 = 0.0;\n            x_acc_235932 = 0.0;\n        }\n        for (int64_t i_235940 = 0; i_235940 < chunk_sizze_235933; i_235940++) {\n            gtid_224396 = global_tid_235926 + threads_per_segment_235904 *\n                i_235940;\n            // apply map function\n            {\n                int64_t x_224405;\n                \n                x_224405 = ((__global int64_t *) ext_mem_229304)[gtid_224394];\n                \n                int64_t x_224414;\n                \n                x_224414 = ((__global int64_t *) ext_mem_229569)[gtid_224394 *\n                                                                 t_n_m_203740 +\n                                                                 gtid_224395];\n                \n                double x_224415;\n                \n                x_224415 = ((__global double *) ext_mem_229568)[gtid_224394 *\n                                                                t_n_m_203740 +\n                                                                gtid_224395];\n                \n                int64_t binop_y_228755 ",
                   "= mul64(jump_t_203582, gtid_224395);\n                int64_t binop_y_228756 = smin64(i_203760, binop_y_228755);\n                int64_t index_primexp_228757 = add64((int64_t) 1,\n                                                     binop_y_228756);\n                double a11_224417;\n                \n                a11_224417 = ((__global double *) mem_231290)[gtid_224394 *\n                                                              t_n_m_203740 +\n                                                              gtid_224395];\n                \n                double b11_224418;\n                \n                b11_224418 = ((__global double *) mem_231294)[gtid_224394 *\n                                                              t_n_m_203740 +\n                                                              gtid_224395];\n                \n                double c11_224419;\n                \n                c11_224419 = ((__global double *) mem_231298)[gtid_224394 *\n                                                              t_n_m_203740 +\n                                                              gtid_224395];\n                \n                bool cond_224421 = sle64(x_224405, gtid_224396);\n                int64_t defunc_0_f_res_224422;\n                \n                if (cond_224421) {\n                    defunc_0_f_res_224422 = (int64_t) 0;\n                } else {\n                    int64_t i_224423 = add64(gtid_224396, x_224414);\n                    int64_t defunc_0_add_arg_224424;\n                    \n                    defunc_0_add_arg_224424 = ((__global\n                                                int64_t *) ext_mem_229305)[gtid_224394 *\n                                                                           n_203572 +\n                                                                           i_224423];\n                    \n                    int64_t defunc_1_add_res_224425 = add64((int64_t) 1,\n                                                         ",
                   "   defunc_0_add_arg_224424);\n                    \n                    defunc_0_f_res_224422 = defunc_1_add_res_224425;\n                }\n                \n                double defunc_0_f_res_224426;\n                \n                if (cond_224421) {\n                    defunc_0_f_res_224426 = 0.0;\n                } else {\n                    int64_t i_224427 = add64(gtid_224396, x_224414);\n                    double defunc_0_add_arg_224428;\n                    \n                    defunc_0_add_arg_224428 = ((__global\n                                                double *) mem_231259)[gtid_224394 *\n                                                                      n_203572 +\n                                                                      i_224427];\n                    defunc_0_f_res_224426 = defunc_0_add_arg_224428;\n                }\n                \n                int64_t binop_p_224429 = sub64(defunc_0_f_res_224422,\n                                               index_primexp_228757);\n                double defunc_0_f_res_224430 = sitofp_i64_f64(binop_p_224429);\n                double abs_res_224431 = fabs(defunc_0_f_res_224430);\n                double tmp1_224432 = abs_res_224431 / x_224415;\n                double x_224433 = tmp1_224432 * tmp1_224432;\n                double y_224434 = tmp1_224432 * x_224433;\n                double tmp2_224435 = 1.0 - y_224434;\n                double x_224436 = tmp2_224435 * tmp2_224435;\n                double tmp3_224437 = tmp2_224435 * x_224436;\n                double tmp4_224438 = defunc_0_f_res_224426 * tmp3_224437;\n                double defunc_1_f_res_224439 = defunc_0_f_res_224430 *\n                       tmp4_224438;\n                double defunc_0_f_res_224440;\n                \n                if (cond_224421) {\n                    defunc_0_f_res_224440 = 0.0;\n                } else {\n                    int64_t i_224441 = add64(gtid_224396, x_224414);\n                    double defunc_0_add_arg_224442;\n     ",
                   "               \n                    defunc_0_add_arg_224442 = ((__global\n                                                double *) mem_231263)[gtid_224394 *\n                                                                      n_203572 +\n                                                                      i_224441];\n                    defunc_0_f_res_224440 = defunc_0_add_arg_224442;\n                }\n                \n                double x_224443 = a11_224417 * tmp4_224438;\n                double y_224444 = b11_224418 * defunc_1_f_res_224439;\n                double x_224445 = x_224443 + y_224444;\n                double defunc_9_fit_fun_res_224446 = defunc_0_f_res_224440 *\n                       x_224445;\n                double x_224447 = b11_224418 * tmp4_224438;\n                double y_224448 = c11_224419 * defunc_1_f_res_224439;\n                double x_224449 = x_224447 + y_224448;\n                double defunc_9_slope_fun_res_224450 = defunc_0_f_res_224440 *\n                       x_224449;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_224398 = x_acc_235931;\n                    x_224399 = x_acc_235932;\n                }\n                // load new values\n                {\n                    x_224400 = defunc_9_fit_fun_res_224446;\n                    x_224401 = defunc_9_slope_fun_res_224450;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_224402 = x_224398 + x_224400;\n                    double defunc_1_op_res_224403 = x_224399 + x_224401;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_235931 = defunc_1_op_res_224402;\n                        x_acc_235932 = defunc_1_op_res_224403;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory",
                   "\n        {\n            x_224398 = x_acc_235931;\n            x_224399 = x_acc_235932;\n            ((__local\n              double *) red_arr_mem_235916)[sext_i32_i64(local_tid_235912)] =\n                x_224398;\n            ((__local\n              double *) red_arr_mem_235918)[sext_i32_i64(local_tid_235912)] =\n                x_224399;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_235941;\n        int32_t skip_waves_235942 = 1;\n        double x_235934;\n        double x_235935;\n        double x_235936;\n        double x_235937;\n        \n        offset_235941 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_235912,\n                      sext_i64_i32(segred_group_sizze_224389))) {\n                x_235934 = ((__local\n                             double *) red_arr_mem_235916)[sext_i32_i64(local_tid_235912 +\n                                                           offset_235941)];\n                x_235935 = ((__local\n                             double *) red_arr_mem_235918)[sext_i32_i64(local_tid_235912 +\n                                                           offset_235941)];\n            }\n        }\n        offset_235941 = 1;\n        while (slt32(offset_235941, wave_sizze_235914)) {\n            if (slt32(local_tid_235912 + offset_235941,\n                      sext_i64_i32(segred_group_sizze_224389)) &&\n                ((local_tid_235912 - squot32(local_tid_235912,\n                                             wave_sizze_235914) *\n                  wave_sizze_235914) & (2 * offset_235941 - 1)) == 0) {\n                // read array element\n                {\n                    x_235936 = ((volatile __local\n                                 double *) red_arr_mem_235916)[sext_i32_i64(local_tid_235912 +\n                                                               offset_235941)];\n                    x_235937 = ((volatile __local\n                                 double *) red_arr_mem_",
                   "235918)[sext_i32_i64(local_tid_235912 +\n                                                               offset_235941)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235938 = x_235934 + x_235936;\n                    double defunc_1_op_res_235939 = x_235935 + x_235937;\n                    \n                    x_235934 = defunc_1_op_res_235938;\n                    x_235935 = defunc_1_op_res_235939;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_235916)[sext_i32_i64(local_tid_235912)] =\n                        x_235934;\n                    ((volatile __local\n                      double *) red_arr_mem_235918)[sext_i32_i64(local_tid_235912)] =\n                        x_235935;\n                }\n            }\n            offset_235941 *= 2;\n        }\n        while (slt32(skip_waves_235942,\n                     squot32(sext_i64_i32(segred_group_sizze_224389) +\n                             wave_sizze_235914 - 1, wave_sizze_235914))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_235941 = skip_waves_235942 * wave_sizze_235914;\n            if (slt32(local_tid_235912 + offset_235941,\n                      sext_i64_i32(segred_group_sizze_224389)) &&\n                ((local_tid_235912 - squot32(local_tid_235912,\n                                             wave_sizze_235914) *\n                  wave_sizze_235914) == 0 && (squot32(local_tid_235912,\n                                                      wave_sizze_235914) & (2 *\n                                                                            skip_waves_235942 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_235936 = ((__local\n                                 double *) red_arr_m",
                   "em_235916)[sext_i32_i64(local_tid_235912 +\n                                                               offset_235941)];\n                    x_235937 = ((__local\n                                 double *) red_arr_mem_235918)[sext_i32_i64(local_tid_235912 +\n                                                               offset_235941)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235938 = x_235934 + x_235936;\n                    double defunc_1_op_res_235939 = x_235935 + x_235937;\n                    \n                    x_235934 = defunc_1_op_res_235938;\n                    x_235935 = defunc_1_op_res_235939;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_235916)[sext_i32_i64(local_tid_235912)] =\n                        x_235934;\n                    ((__local\n                      double *) red_arr_mem_235918)[sext_i32_i64(local_tid_235912)] =\n                        x_235935;\n                }\n            }\n            skip_waves_235942 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_235912) == (int64_t) 0) {\n                x_acc_235931 = x_235934;\n                x_acc_235932 = x_235935;\n            }\n        }\n        if (groups_per_segment_235900 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_235912 == 0) {\n                    ((__global double *) mem_231303)[gtid_224394 *\n                                                     t_n_m_203740 +\n                                                     gtid_224395] =\n                        x_acc_235931;\n                    ((__global double *) mem_231307)[gtid_224394 *\n                                                     t_n_m_203740 +\n            ",
                   "                                         gtid_224395] =\n                        x_acc_235932;\n                }\n            }\n        } else {\n            int32_t old_counter_235943;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_235912 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_235905)[sext_i32_i64(virt_group_id_235924)] =\n                        x_acc_235931;\n                    ((__global\n                      double *) segred_tmp_mem_235907)[sext_i32_i64(virt_group_id_235924)] =\n                        x_acc_235932;\n                    mem_fence_global();\n                    old_counter_235943 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235909)[sext_i32_i64(srem32(flat_segment_id_235925,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_235920)[(int64_t) 0] =\n                        old_counter_235943 == groups_per_segment_235900 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_235944;\n            \n            is_last_group_235944 = ((__local\n                                     bool *) sync_arr_mem_235920)[(int64_t) 0];\n            if (is_last_group_235944) {\n                if (local_tid_235912 == 0) {\n                    old_counter_235943 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235909)[sext_i32_i64(srem32(flat_segment_id_235925,\n                                                                                                      10240))],\n   ",
                   "                                           (int) ((int64_t) 0 -\n                                                     groups_per_segment_235900));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_235945 =\n                            sdiv_up64(groups_per_segment_235900,\n                                      segred_group_sizze_224389);\n                    \n                    x_224398 = 0.0;\n                    x_224399 = 0.0;\n                    for (int64_t i_235946 = 0; i_235946 <\n                         read_per_thread_235945; i_235946++) {\n                        int64_t group_res_id_235947 =\n                                sext_i32_i64(local_tid_235912) *\n                                read_per_thread_235945 + i_235946;\n                        int64_t index_of_group_res_235948 =\n                                sext_i32_i64(flat_segment_id_235925) *\n                                groups_per_segment_235900 + group_res_id_235947;\n                        \n                        if (slt64(group_res_id_235947,\n                                  groups_per_segment_235900)) {\n                            x_224400 = ((__global\n                                         double *) segred_tmp_mem_235905)[index_of_group_res_235948];\n                            x_224401 = ((__global\n                                         double *) segred_tmp_mem_235907)[index_of_group_res_235948];\n                            \n                            double defunc_1_op_res_224402 = x_224398 + x_224400;\n                            double defunc_1_op_res_224403 = x_224399 + x_224401;\n                            \n                            x_224398 = defunc_1_op_res_224402;\n                            x_224399 = defunc_1_op_res_224403;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_235916)[sext_i32_i64(local_tid_235912)] =\n     ",
                   "               x_224398;\n                ((__local\n                  double *) red_arr_mem_235918)[sext_i32_i64(local_tid_235912)] =\n                    x_224399;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_235949;\n                    int32_t skip_waves_235950 = 1;\n                    double x_235934;\n                    double x_235935;\n                    double x_235936;\n                    double x_235937;\n                    \n                    offset_235949 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_235912,\n                                  sext_i64_i32(segred_group_sizze_224389))) {\n                            x_235934 = ((__local\n                                         double *) red_arr_mem_235916)[sext_i32_i64(local_tid_235912 +\n                                                                       offset_235949)];\n                            x_235935 = ((__local\n                                         double *) red_arr_mem_235918)[sext_i32_i64(local_tid_235912 +\n                                                                       offset_235949)];\n                        }\n                    }\n                    offset_235949 = 1;\n                    while (slt32(offset_235949, wave_sizze_235914)) {\n                        if (slt32(local_tid_235912 + offset_235949,\n                                  sext_i64_i32(segred_group_sizze_224389)) &&\n                            ((local_tid_235912 - squot32(local_tid_235912,\n                                                         wave_sizze_235914) *\n                              wave_sizze_235914) & (2 * offset_235949 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_235936 = ((volatile __local\n           ",
                   "                                  double *) red_arr_mem_235916)[sext_i32_i64(local_tid_235912 +\n                                                                           offset_235949)];\n                                x_235937 = ((volatile __local\n                                             double *) red_arr_mem_235918)[sext_i32_i64(local_tid_235912 +\n                                                                           offset_235949)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235938 = x_235934 +\n                                       x_235936;\n                                double defunc_1_op_res_235939 = x_235935 +\n                                       x_235937;\n                                \n                                x_235934 = defunc_1_op_res_235938;\n                                x_235935 = defunc_1_op_res_235939;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235916)[sext_i32_i64(local_tid_235912)] =\n                                    x_235934;\n                                ((volatile __local\n                                  double *) red_arr_mem_235918)[sext_i32_i64(local_tid_235912)] =\n                                    x_235935;\n                            }\n                        }\n                        offset_235949 *= 2;\n                    }\n                    while (slt32(skip_waves_235950,\n                                 squot32(sext_i64_i32(segred_group_sizze_224389) +\n                                         wave_sizze_235914 - 1,\n                                         wave_sizze_235914))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_235949 = skip_waves_235950 * wave_sizze_23",
                   "5914;\n                        if (slt32(local_tid_235912 + offset_235949,\n                                  sext_i64_i32(segred_group_sizze_224389)) &&\n                            ((local_tid_235912 - squot32(local_tid_235912,\n                                                         wave_sizze_235914) *\n                              wave_sizze_235914) == 0 &&\n                             (squot32(local_tid_235912, wave_sizze_235914) &\n                              (2 * skip_waves_235950 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_235936 = ((__local\n                                             double *) red_arr_mem_235916)[sext_i32_i64(local_tid_235912 +\n                                                                           offset_235949)];\n                                x_235937 = ((__local\n                                             double *) red_arr_mem_235918)[sext_i32_i64(local_tid_235912 +\n                                                                           offset_235949)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235938 = x_235934 +\n                                       x_235936;\n                                double defunc_1_op_res_235939 = x_235935 +\n                                       x_235937;\n                                \n                                x_235934 = defunc_1_op_res_235938;\n                                x_235935 = defunc_1_op_res_235939;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_235916)[sext_i32_i64(local_tid_235912)] =\n                                    x_235934;\n                                ((__local\n                                ",
                   "  double *) red_arr_mem_235918)[sext_i32_i64(local_tid_235912)] =\n                                    x_235935;\n                            }\n                        }\n                        skip_waves_235950 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_235912 == 0) {\n                            ((__global double *) mem_231303)[gtid_224394 *\n                                                             t_n_m_203740 +\n                                                             gtid_224395] =\n                                x_235934;\n                            ((__global double *) mem_231307)[gtid_224394 *\n                                                             t_n_m_203740 +\n                                                             gtid_224395] =\n                                x_235935;\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_224389\n}\n__kernel void mainzisegred_large_225613(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_236117_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_236115_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_236113_backing_aligned_2,\n                                        __local volatile\n                                        int64_t *red_arr_mem_236111_backing_aligned_3,\n                                        __local volatile\n                                        int64_t *red_arr_mem_236109_backing_aligned_4,\n                                        __local volatile\n             ",
                   "                           int64_t *red_arr_mem_236107_backing_aligned_5,\n                                        int64_t n_203572, int64_t q_t_203576,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t t_n_m_203740, int64_t i_203760,\n                                        int64_t num_groups_225603,\n                                        int64_t groups_per_segment_236085,\n                                        int64_t elements_per_thread_236086,\n                                        int64_t virt_num_groups_236087,\n                                        int64_t threads_per_segment_236089,\n                                        __global unsigned char *ext_mem_229304,\n                                        __global unsigned char *ext_mem_229305,\n                                        __global unsigned char *ext_mem_229568,\n                                        __global unsigned char *ext_mem_229569,\n                                        __global unsigned char *mem_231428,\n                                        __global unsigned char *mem_231446,\n                                        __global unsigned char *mem_231450,\n                                        __global unsigned char *mem_231454,\n                                        __global unsigned char *mem_231458,\n                                        __global unsigned char *mem_231462,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236090,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236092,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236094,\n                                        __global\n                                        unsigned char *segred",
                   "_tmp_mem_236096,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236098,\n                                        __global\n                                        unsigned char *mainzicounter_mem_236100)\n{\n    #define segred_group_sizze_225602 (mainzisegred_group_sizze_225051)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict sync_arr_mem_236117_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_236117_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_236115_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236115_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_236113_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236113_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_236111_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236111_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_236109_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236109_backing_aligned_4;\n    __local volatile unsigned char *restrict red_arr_mem_236107_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236107_backing_aligned_5;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236102;\n    int32_t local_tid_236103;\n    int64_t group_sizze_236106;\n    int32_t wave_sizze_236105;\n    int32_t group_tid_236104;\n    \n    global_tid_23610",
                   "2 = get_global_id(0);\n    local_tid_236103 = get_local_id(0);\n    group_sizze_236106 = get_local_size(0);\n    wave_sizze_236105 = LOCKSTEP_WIDTH;\n    group_tid_236104 = get_group_id(0);\n    \n    int32_t phys_tid_225613 = global_tid_236102;\n    __local unsigned char *red_arr_mem_236107;\n    \n    red_arr_mem_236107 = (__local unsigned char *) red_arr_mem_236107_backing_0;\n    \n    __local unsigned char *red_arr_mem_236109;\n    \n    red_arr_mem_236109 = (__local unsigned char *) red_arr_mem_236109_backing_1;\n    \n    __local unsigned char *red_arr_mem_236111;\n    \n    red_arr_mem_236111 = (__local unsigned char *) red_arr_mem_236111_backing_2;\n    \n    __local unsigned char *red_arr_mem_236113;\n    \n    red_arr_mem_236113 = (__local unsigned char *) red_arr_mem_236113_backing_3;\n    \n    __local unsigned char *red_arr_mem_236115;\n    \n    red_arr_mem_236115 = (__local unsigned char *) red_arr_mem_236115_backing_4;\n    \n    __local unsigned char *sync_arr_mem_236117;\n    \n    sync_arr_mem_236117 = (__local\n                           unsigned char *) sync_arr_mem_236117_backing_5;\n    \n    int32_t phys_group_id_236119;\n    \n    phys_group_id_236119 = get_group_id(0);\n    for (int32_t i_236120 = 0; i_236120 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_236087) - phys_group_id_236119,\n                   sext_i64_i32(num_groups_225603)); i_236120++) {\n        int32_t virt_group_id_236121 = phys_group_id_236119 + i_236120 *\n                sext_i64_i32(num_groups_225603);\n        int32_t flat_segment_id_236122 = squot32(virt_group_id_236121,\n                                                 sext_i64_i32(groups_per_segment_236085));\n        int64_t global_tid_236123 = srem64(sext_i32_i64(virt_group_id_236121) *\n                                           segred_group_sizze_225602 +\n                                           sext_i32_i64(local_tid_236103),\n                                           segred_group_sizze_225602 *\n                                           groups",
                   "_per_segment_236085);\n        int64_t slice_236124 = t_n_m_203740;\n        int64_t slice_236125 = partition_sizze_203667 * slice_236124;\n        int64_t gtid_225610 = squot64(sext_i32_i64(flat_segment_id_236122),\n                                      slice_236124);\n        int64_t remnant_236126 = sext_i32_i64(flat_segment_id_236122) -\n                gtid_225610 * slice_236124;\n        int64_t gtid_225611 = remnant_236126;\n        int64_t remnant_236127 = remnant_236126 - gtid_225611;\n        int64_t gtid_225612;\n        double x_acc_236128;\n        double x_acc_236129;\n        double x_acc_236130;\n        double x_acc_236131;\n        double x_acc_236132;\n        int64_t chunk_sizze_236133 = smin64(elements_per_thread_236086,\n                                            sdiv_up64(q_t_203576 -\n                                                      global_tid_236123,\n                                                      threads_per_segment_236089));\n        double x_225614;\n        double x_225615;\n        double x_225616;\n        double x_225617;\n        double x_225618;\n        double x_225619;\n        double x_225620;\n        double x_225621;\n        double x_225622;\n        double x_225623;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_236128 = 0.0;\n            x_acc_236129 = 0.0;\n            x_acc_236130 = 0.0;\n            x_acc_236131 = 0.0;\n            x_acc_236132 = 0.0;\n        }\n        for (int64_t i_236149 = 0; i_236149 < chunk_sizze_236133; i_236149++) {\n            gtid_225612 = global_tid_236123 + threads_per_segment_236089 *\n                i_236149;\n            // apply map function\n            {\n                int64_t x_225630;\n                \n                x_225630 = ((__global int64_t *) ext_mem_229304)[gtid_225610];\n                \n                int64_t x_225635;\n                \n                x_225635 = ((__global int64_t *) ext_mem_229569)[gtid_225610 *\n                                               ",
                   "                  t_n_m_203740 +\n                                                                 gtid_225611];\n                \n                double x_225636;\n                \n                x_225636 = ((__global double *) ext_mem_229568)[gtid_225610 *\n                                                                t_n_m_203740 +\n                                                                gtid_225611];\n                \n                int64_t binop_y_228770 = mul64(jump_t_203582, gtid_225611);\n                int64_t binop_y_228771 = smin64(i_203760, binop_y_228770);\n                int64_t index_primexp_228772 = add64((int64_t) 1,\n                                                     binop_y_228771);\n                bool cond_225639 = sle64(x_225630, gtid_225612);\n                int64_t defunc_0_f_res_225640;\n                \n                if (cond_225639) {\n                    defunc_0_f_res_225640 = (int64_t) 0;\n                } else {\n                    int64_t i_225641 = add64(gtid_225612, x_225635);\n                    int64_t defunc_0_add_arg_225642;\n                    \n                    defunc_0_add_arg_225642 = ((__global\n                                                int64_t *) ext_mem_229305)[gtid_225610 *\n                                                                           n_203572 +\n                                                                           i_225641];\n                    \n                    int64_t defunc_1_add_res_225643 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_225642);\n                    \n                    defunc_0_f_res_225640 = defunc_1_add_res_225643;\n                }\n                \n                double defunc_0_f_res_225644;\n                \n                if (cond_225639) {\n                    defunc_0_f_res_225644 = 0.0;\n                } else {\n                    int64_t i_225645 = add64(gtid_225612, x_225635);\n                    double de",
                   "func_0_add_arg_225646;\n                    \n                    defunc_0_add_arg_225646 = ((__global\n                                                double *) mem_231428)[gtid_225610 *\n                                                                      n_203572 +\n                                                                      i_225645];\n                    defunc_0_f_res_225644 = defunc_0_add_arg_225646;\n                }\n                \n                int64_t binop_p_225647 = sub64(defunc_0_f_res_225640,\n                                               index_primexp_228772);\n                double defunc_0_f_res_225648 = sitofp_i64_f64(binop_p_225647);\n                double abs_res_225649 = fabs(defunc_0_f_res_225648);\n                double tmp1_225650 = abs_res_225649 / x_225636;\n                double x_225651 = tmp1_225650 * tmp1_225650;\n                double y_225652 = tmp1_225650 * x_225651;\n                double tmp2_225653 = 1.0 - y_225652;\n                double x_225654 = tmp2_225653 * tmp2_225653;\n                double tmp3_225655 = tmp2_225653 * x_225654;\n                double w_j_225656 = defunc_0_f_res_225644 * tmp3_225655;\n                double xw_j_225657 = defunc_0_f_res_225648 * w_j_225656;\n                double x2w_j_225658 = defunc_0_f_res_225648 * xw_j_225657;\n                double x3w_j_225659 = defunc_0_f_res_225648 * x2w_j_225658;\n                double x4w_j_225660 = defunc_0_f_res_225648 * x3w_j_225659;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_225614 = x_acc_236128;\n                    x_225615 = x_acc_236129;\n                    x_225616 = x_acc_236130;\n                    x_225617 = x_acc_236131;\n                    x_225618 = x_acc_236132;\n                }\n                // load new values\n                {\n                    x_225619 = w_j_225656;\n                    x_225620 = xw_j_225657;\n                ",
                   "    x_225621 = x2w_j_225658;\n                    x_225622 = x3w_j_225659;\n                    x_225623 = x4w_j_225660;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_225624 = x_225614 + x_225619;\n                    double defunc_1_op_res_225625 = x_225615 + x_225620;\n                    double defunc_1_op_res_225626 = x_225616 + x_225621;\n                    double defunc_1_op_res_225627 = x_225617 + x_225622;\n                    double defunc_1_op_res_225628 = x_225618 + x_225623;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_236128 = defunc_1_op_res_225624;\n                        x_acc_236129 = defunc_1_op_res_225625;\n                        x_acc_236130 = defunc_1_op_res_225626;\n                        x_acc_236131 = defunc_1_op_res_225627;\n                        x_acc_236132 = defunc_1_op_res_225628;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_225614 = x_acc_236128;\n            x_225615 = x_acc_236129;\n            x_225616 = x_acc_236130;\n            x_225617 = x_acc_236131;\n            x_225618 = x_acc_236132;\n            ((__local\n              double *) red_arr_mem_236107)[sext_i32_i64(local_tid_236103)] =\n                x_225614;\n            ((__local\n              double *) red_arr_mem_236109)[sext_i32_i64(local_tid_236103)] =\n                x_225615;\n            ((__local\n              double *) red_arr_mem_236111)[sext_i32_i64(local_tid_236103)] =\n                x_225616;\n            ((__local\n              double *) red_arr_mem_236113)[sext_i32_i64(local_tid_236103)] =\n                x_225617;\n            ((__local\n              double *) red_arr_mem_236115)[sext_i32_i64(local_tid_236103)] =\n                x_225618;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t off",
                   "set_236150;\n        int32_t skip_waves_236151 = 1;\n        double x_236134;\n        double x_236135;\n        double x_236136;\n        double x_236137;\n        double x_236138;\n        double x_236139;\n        double x_236140;\n        double x_236141;\n        double x_236142;\n        double x_236143;\n        \n        offset_236150 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_236103,\n                      sext_i64_i32(segred_group_sizze_225602))) {\n                x_236134 = ((__local\n                             double *) red_arr_mem_236107)[sext_i32_i64(local_tid_236103 +\n                                                           offset_236150)];\n                x_236135 = ((__local\n                             double *) red_arr_mem_236109)[sext_i32_i64(local_tid_236103 +\n                                                           offset_236150)];\n                x_236136 = ((__local\n                             double *) red_arr_mem_236111)[sext_i32_i64(local_tid_236103 +\n                                                           offset_236150)];\n                x_236137 = ((__local\n                             double *) red_arr_mem_236113)[sext_i32_i64(local_tid_236103 +\n                                                           offset_236150)];\n                x_236138 = ((__local\n                             double *) red_arr_mem_236115)[sext_i32_i64(local_tid_236103 +\n                                                           offset_236150)];\n            }\n        }\n        offset_236150 = 1;\n        while (slt32(offset_236150, wave_sizze_236105)) {\n            if (slt32(local_tid_236103 + offset_236150,\n                      sext_i64_i32(segred_group_sizze_225602)) &&\n                ((local_tid_236103 - squot32(local_tid_236103,\n                                             wave_sizze_236105) *\n                  wave_sizze_236105) & (2 * offset_236150 - 1)) == 0) {\n                // read array element",
                   "\n                {\n                    x_236139 = ((volatile __local\n                                 double *) red_arr_mem_236107)[sext_i32_i64(local_tid_236103 +\n                                                               offset_236150)];\n                    x_236140 = ((volatile __local\n                                 double *) red_arr_mem_236109)[sext_i32_i64(local_tid_236103 +\n                                                               offset_236150)];\n                    x_236141 = ((volatile __local\n                                 double *) red_arr_mem_236111)[sext_i32_i64(local_tid_236103 +\n                                                               offset_236150)];\n                    x_236142 = ((volatile __local\n                                 double *) red_arr_mem_236113)[sext_i32_i64(local_tid_236103 +\n                                                               offset_236150)];\n                    x_236143 = ((volatile __local\n                                 double *) red_arr_mem_236115)[sext_i32_i64(local_tid_236103 +\n                                                               offset_236150)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_236144 = x_236134 + x_236139;\n                    double defunc_1_op_res_236145 = x_236135 + x_236140;\n                    double defunc_1_op_res_236146 = x_236136 + x_236141;\n                    double defunc_1_op_res_236147 = x_236137 + x_236142;\n                    double defunc_1_op_res_236148 = x_236138 + x_236143;\n                    \n                    x_236134 = defunc_1_op_res_236144;\n                    x_236135 = defunc_1_op_res_236145;\n                    x_236136 = defunc_1_op_res_236146;\n                    x_236137 = defunc_1_op_res_236147;\n                    x_236138 = defunc_1_op_res_236148;\n                }\n                // write result of operation\n                {\n                    ((volatile __",
                   "local\n                      double *) red_arr_mem_236107)[sext_i32_i64(local_tid_236103)] =\n                        x_236134;\n                    ((volatile __local\n                      double *) red_arr_mem_236109)[sext_i32_i64(local_tid_236103)] =\n                        x_236135;\n                    ((volatile __local\n                      double *) red_arr_mem_236111)[sext_i32_i64(local_tid_236103)] =\n                        x_236136;\n                    ((volatile __local\n                      double *) red_arr_mem_236113)[sext_i32_i64(local_tid_236103)] =\n                        x_236137;\n                    ((volatile __local\n                      double *) red_arr_mem_236115)[sext_i32_i64(local_tid_236103)] =\n                        x_236138;\n                }\n            }\n            offset_236150 *= 2;\n        }\n        while (slt32(skip_waves_236151,\n                     squot32(sext_i64_i32(segred_group_sizze_225602) +\n                             wave_sizze_236105 - 1, wave_sizze_236105))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_236150 = skip_waves_236151 * wave_sizze_236105;\n            if (slt32(local_tid_236103 + offset_236150,\n                      sext_i64_i32(segred_group_sizze_225602)) &&\n                ((local_tid_236103 - squot32(local_tid_236103,\n                                             wave_sizze_236105) *\n                  wave_sizze_236105) == 0 && (squot32(local_tid_236103,\n                                                      wave_sizze_236105) & (2 *\n                                                                            skip_waves_236151 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_236139 = ((__local\n                                 double *) red_arr_mem_236107)[sext_i32_i64(local_tid_236103 +\n                                                               offset_23",
                   "6150)];\n                    x_236140 = ((__local\n                                 double *) red_arr_mem_236109)[sext_i32_i64(local_tid_236103 +\n                                                               offset_236150)];\n                    x_236141 = ((__local\n                                 double *) red_arr_mem_236111)[sext_i32_i64(local_tid_236103 +\n                                                               offset_236150)];\n                    x_236142 = ((__local\n                                 double *) red_arr_mem_236113)[sext_i32_i64(local_tid_236103 +\n                                                               offset_236150)];\n                    x_236143 = ((__local\n                                 double *) red_arr_mem_236115)[sext_i32_i64(local_tid_236103 +\n                                                               offset_236150)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_236144 = x_236134 + x_236139;\n                    double defunc_1_op_res_236145 = x_236135 + x_236140;\n                    double defunc_1_op_res_236146 = x_236136 + x_236141;\n                    double defunc_1_op_res_236147 = x_236137 + x_236142;\n                    double defunc_1_op_res_236148 = x_236138 + x_236143;\n                    \n                    x_236134 = defunc_1_op_res_236144;\n                    x_236135 = defunc_1_op_res_236145;\n                    x_236136 = defunc_1_op_res_236146;\n                    x_236137 = defunc_1_op_res_236147;\n                    x_236138 = defunc_1_op_res_236148;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_236107)[sext_i32_i64(local_tid_236103)] =\n                        x_236134;\n                    ((__local\n                      double *) red_arr_mem_236109)[sext_i32_i64(local_tid_236103)] =\n                        x_236135;\n     ",
                   "               ((__local\n                      double *) red_arr_mem_236111)[sext_i32_i64(local_tid_236103)] =\n                        x_236136;\n                    ((__local\n                      double *) red_arr_mem_236113)[sext_i32_i64(local_tid_236103)] =\n                        x_236137;\n                    ((__local\n                      double *) red_arr_mem_236115)[sext_i32_i64(local_tid_236103)] =\n                        x_236138;\n                }\n            }\n            skip_waves_236151 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_236103) == (int64_t) 0) {\n                x_acc_236128 = x_236134;\n                x_acc_236129 = x_236135;\n                x_acc_236130 = x_236136;\n                x_acc_236131 = x_236137;\n                x_acc_236132 = x_236138;\n            }\n        }\n        if (groups_per_segment_236085 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_236103 == 0) {\n                    ((__global double *) mem_231446)[gtid_225610 *\n                                                     t_n_m_203740 +\n                                                     gtid_225611] =\n                        x_acc_236128;\n                    ((__global double *) mem_231450)[gtid_225610 *\n                                                     t_n_m_203740 +\n                                                     gtid_225611] =\n                        x_acc_236129;\n                    ((__global double *) mem_231454)[gtid_225610 *\n                                                     t_n_m_203740 +\n                                                     gtid_225611] =\n                        x_acc_236130;\n                    ((__global double *) mem_231458)[gtid_225610 *\n                                                     t_n_m_203740 +\n                                        ",
                   "             gtid_225611] =\n                        x_acc_236131;\n                    ((__global double *) mem_231462)[gtid_225610 *\n                                                     t_n_m_203740 +\n                                                     gtid_225611] =\n                        x_acc_236132;\n                }\n            }\n        } else {\n            int32_t old_counter_236152;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_236103 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_236090)[sext_i32_i64(virt_group_id_236121)] =\n                        x_acc_236128;\n                    ((__global\n                      double *) segred_tmp_mem_236092)[sext_i32_i64(virt_group_id_236121)] =\n                        x_acc_236129;\n                    ((__global\n                      double *) segred_tmp_mem_236094)[sext_i32_i64(virt_group_id_236121)] =\n                        x_acc_236130;\n                    ((__global\n                      double *) segred_tmp_mem_236096)[sext_i32_i64(virt_group_id_236121)] =\n                        x_acc_236131;\n                    ((__global\n                      double *) segred_tmp_mem_236098)[sext_i32_i64(virt_group_id_236121)] =\n                        x_acc_236132;\n                    mem_fence_global();\n                    old_counter_236152 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_236100)[sext_i32_i64(srem32(flat_segment_id_236122,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_236117)[(int64_t) 0] =\n                        old_counter_236152 == groups_per_segment_236085 -\n                        (int64_t) 1;\n                }\n    ",
                   "        }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_236153;\n            \n            is_last_group_236153 = ((__local\n                                     bool *) sync_arr_mem_236117)[(int64_t) 0];\n            if (is_last_group_236153) {\n                if (local_tid_236103 == 0) {\n                    old_counter_236152 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_236100)[sext_i32_i64(srem32(flat_segment_id_236122,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_236085));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_236154 =\n                            sdiv_up64(groups_per_segment_236085,\n                                      segred_group_sizze_225602);\n                    \n                    x_225614 = 0.0;\n                    x_225615 = 0.0;\n                    x_225616 = 0.0;\n                    x_225617 = 0.0;\n                    x_225618 = 0.0;\n                    for (int64_t i_236155 = 0; i_236155 <\n                         read_per_thread_236154; i_236155++) {\n                        int64_t group_res_id_236156 =\n                                sext_i32_i64(local_tid_236103) *\n                                read_per_thread_236154 + i_236155;\n                        int64_t index_of_group_res_236157 =\n                                sext_i32_i64(flat_segment_id_236122) *\n                                groups_per_segment_236085 + group_res_id_236156;\n                        \n                        if (slt64(group_res_id_236156,\n                                  groups_per_segment_236085)) {\n                      ",
                   "      x_225619 = ((__global\n                                         double *) segred_tmp_mem_236090)[index_of_group_res_236157];\n                            x_225620 = ((__global\n                                         double *) segred_tmp_mem_236092)[index_of_group_res_236157];\n                            x_225621 = ((__global\n                                         double *) segred_tmp_mem_236094)[index_of_group_res_236157];\n                            x_225622 = ((__global\n                                         double *) segred_tmp_mem_236096)[index_of_group_res_236157];\n                            x_225623 = ((__global\n                                         double *) segred_tmp_mem_236098)[index_of_group_res_236157];\n                            \n                            double defunc_1_op_res_225624 = x_225614 + x_225619;\n                            double defunc_1_op_res_225625 = x_225615 + x_225620;\n                            double defunc_1_op_res_225626 = x_225616 + x_225621;\n                            double defunc_1_op_res_225627 = x_225617 + x_225622;\n                            double defunc_1_op_res_225628 = x_225618 + x_225623;\n                            \n                            x_225614 = defunc_1_op_res_225624;\n                            x_225615 = defunc_1_op_res_225625;\n                            x_225616 = defunc_1_op_res_225626;\n                            x_225617 = defunc_1_op_res_225627;\n                            x_225618 = defunc_1_op_res_225628;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_236107)[sext_i32_i64(local_tid_236103)] =\n                    x_225614;\n                ((__local\n                  double *) red_arr_mem_236109)[sext_i32_i64(local_tid_236103)] =\n                    x_225615;\n                ((__local\n                  double *) red_arr_mem_236111)[sext_i32_i64(local_tid_236103)] =\n                    x_225616;\n    ",
                   "            ((__local\n                  double *) red_arr_mem_236113)[sext_i32_i64(local_tid_236103)] =\n                    x_225617;\n                ((__local\n                  double *) red_arr_mem_236115)[sext_i32_i64(local_tid_236103)] =\n                    x_225618;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_236158;\n                    int32_t skip_waves_236159 = 1;\n                    double x_236134;\n                    double x_236135;\n                    double x_236136;\n                    double x_236137;\n                    double x_236138;\n                    double x_236139;\n                    double x_236140;\n                    double x_236141;\n                    double x_236142;\n                    double x_236143;\n                    \n                    offset_236158 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_236103,\n                                  sext_i64_i32(segred_group_sizze_225602))) {\n                            x_236134 = ((__local\n                                         double *) red_arr_mem_236107)[sext_i32_i64(local_tid_236103 +\n                                                                       offset_236158)];\n                            x_236135 = ((__local\n                                         double *) red_arr_mem_236109)[sext_i32_i64(local_tid_236103 +\n                                                                       offset_236158)];\n                            x_236136 = ((__local\n                                         double *) red_arr_mem_236111)[sext_i32_i64(local_tid_236103 +\n                                                                       offset_236158)];\n                            x_236137 = ((__local\n                                         double *) red_arr_mem_236113)[sext_i32_i64(local_tid_236103 ",
                   "+\n                                                                       offset_236158)];\n                            x_236138 = ((__local\n                                         double *) red_arr_mem_236115)[sext_i32_i64(local_tid_236103 +\n                                                                       offset_236158)];\n                        }\n                    }\n                    offset_236158 = 1;\n                    while (slt32(offset_236158, wave_sizze_236105)) {\n                        if (slt32(local_tid_236103 + offset_236158,\n                                  sext_i64_i32(segred_group_sizze_225602)) &&\n                            ((local_tid_236103 - squot32(local_tid_236103,\n                                                         wave_sizze_236105) *\n                              wave_sizze_236105) & (2 * offset_236158 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_236139 = ((volatile __local\n                                             double *) red_arr_mem_236107)[sext_i32_i64(local_tid_236103 +\n                                                                           offset_236158)];\n                                x_236140 = ((volatile __local\n                                             double *) red_arr_mem_236109)[sext_i32_i64(local_tid_236103 +\n                                                                           offset_236158)];\n                                x_236141 = ((volatile __local\n                                             double *) red_arr_mem_236111)[sext_i32_i64(local_tid_236103 +\n                                                                           offset_236158)];\n                                x_236142 = ((volatile __local\n                                             double *) red_arr_mem_236113)[sext_i32_i64(local_tid_236103 +\n                                                                      ",
                   "     offset_236158)];\n                                x_236143 = ((volatile __local\n                                             double *) red_arr_mem_236115)[sext_i32_i64(local_tid_236103 +\n                                                                           offset_236158)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_236144 = x_236134 +\n                                       x_236139;\n                                double defunc_1_op_res_236145 = x_236135 +\n                                       x_236140;\n                                double defunc_1_op_res_236146 = x_236136 +\n                                       x_236141;\n                                double defunc_1_op_res_236147 = x_236137 +\n                                       x_236142;\n                                double defunc_1_op_res_236148 = x_236138 +\n                                       x_236143;\n                                \n                                x_236134 = defunc_1_op_res_236144;\n                                x_236135 = defunc_1_op_res_236145;\n                                x_236136 = defunc_1_op_res_236146;\n                                x_236137 = defunc_1_op_res_236147;\n                                x_236138 = defunc_1_op_res_236148;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_236107)[sext_i32_i64(local_tid_236103)] =\n                                    x_236134;\n                                ((volatile __local\n                                  double *) red_arr_mem_236109)[sext_i32_i64(local_tid_236103)] =\n                                    x_236135;\n                                ((volatile __local\n                                  double *) red_arr_me",
                   "m_236111)[sext_i32_i64(local_tid_236103)] =\n                                    x_236136;\n                                ((volatile __local\n                                  double *) red_arr_mem_236113)[sext_i32_i64(local_tid_236103)] =\n                                    x_236137;\n                                ((volatile __local\n                                  double *) red_arr_mem_236115)[sext_i32_i64(local_tid_236103)] =\n                                    x_236138;\n                            }\n                        }\n                        offset_236158 *= 2;\n                    }\n                    while (slt32(skip_waves_236159,\n                                 squot32(sext_i64_i32(segred_group_sizze_225602) +\n                                         wave_sizze_236105 - 1,\n                                         wave_sizze_236105))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_236158 = skip_waves_236159 * wave_sizze_236105;\n                        if (slt32(local_tid_236103 + offset_236158,\n                                  sext_i64_i32(segred_group_sizze_225602)) &&\n                            ((local_tid_236103 - squot32(local_tid_236103,\n                                                         wave_sizze_236105) *\n                              wave_sizze_236105) == 0 &&\n                             (squot32(local_tid_236103, wave_sizze_236105) &\n                              (2 * skip_waves_236159 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_236139 = ((__local\n                                             double *) red_arr_mem_236107)[sext_i32_i64(local_tid_236103 +\n                                                                           offset_236158)];\n                                x_236140 = ((__local\n                                             double *) red_arr_mem_236109)[sext_i32_i64(local_tid_236103 +\n         ",
                   "                                                                  offset_236158)];\n                                x_236141 = ((__local\n                                             double *) red_arr_mem_236111)[sext_i32_i64(local_tid_236103 +\n                                                                           offset_236158)];\n                                x_236142 = ((__local\n                                             double *) red_arr_mem_236113)[sext_i32_i64(local_tid_236103 +\n                                                                           offset_236158)];\n                                x_236143 = ((__local\n                                             double *) red_arr_mem_236115)[sext_i32_i64(local_tid_236103 +\n                                                                           offset_236158)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_236144 = x_236134 +\n                                       x_236139;\n                                double defunc_1_op_res_236145 = x_236135 +\n                                       x_236140;\n                                double defunc_1_op_res_236146 = x_236136 +\n                                       x_236141;\n                                double defunc_1_op_res_236147 = x_236137 +\n                                       x_236142;\n                                double defunc_1_op_res_236148 = x_236138 +\n                                       x_236143;\n                                \n                                x_236134 = defunc_1_op_res_236144;\n                                x_236135 = defunc_1_op_res_236145;\n                                x_236136 = defunc_1_op_res_236146;\n                                x_236137 = defunc_1_op_res_236147;\n                                x_236138 = defunc_1_op_res_236148;\n                            }\n                          ",
                   "  // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_236107)[sext_i32_i64(local_tid_236103)] =\n                                    x_236134;\n                                ((__local\n                                  double *) red_arr_mem_236109)[sext_i32_i64(local_tid_236103)] =\n                                    x_236135;\n                                ((__local\n                                  double *) red_arr_mem_236111)[sext_i32_i64(local_tid_236103)] =\n                                    x_236136;\n                                ((__local\n                                  double *) red_arr_mem_236113)[sext_i32_i64(local_tid_236103)] =\n                                    x_236137;\n                                ((__local\n                                  double *) red_arr_mem_236115)[sext_i32_i64(local_tid_236103)] =\n                                    x_236138;\n                            }\n                        }\n                        skip_waves_236159 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_236103 == 0) {\n                            ((__global double *) mem_231446)[gtid_225610 *\n                                                             t_n_m_203740 +\n                                                             gtid_225611] =\n                                x_236134;\n                            ((__global double *) mem_231450)[gtid_225610 *\n                                                             t_n_m_203740 +\n                                                             gtid_225611] =\n                                x_236135;\n                            ((__global double *) mem_231454)[gtid_225610 *\n                                                             t_n_m_203740 +\n                                                       ",
                   "      gtid_225611] =\n                                x_236136;\n                            ((__global double *) mem_231458)[gtid_225610 *\n                                                             t_n_m_203740 +\n                                                             gtid_225611] =\n                                x_236137;\n                            ((__global double *) mem_231462)[gtid_225610 *\n                                                             t_n_m_203740 +\n                                                             gtid_225611] =\n                                x_236138;\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_225602\n}\n__kernel void mainzisegred_large_225714(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_236225_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_236223_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_236221_backing_aligned_2,\n                                        int64_t n_203572, int64_t q_t_203576,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t t_n_m_203740, int64_t i_203760,\n                                        int64_t num_groups_225707,\n                                        int64_t groups_per_segment_236205,\n                                        int64_t elements_per_thread_236206,\n                                        int64_t virt_num_groups_236207,\n                                        int64_t threads_per_segment_236209,\n             ",
                   "                           __global unsigned char *ext_mem_229304,\n                                        __global unsigned char *ext_mem_229305,\n                                        __global unsigned char *ext_mem_229568,\n                                        __global unsigned char *ext_mem_229569,\n                                        __global unsigned char *mem_231428,\n                                        __global unsigned char *mem_231432,\n                                        __global unsigned char *mem_231467,\n                                        __global unsigned char *mem_231471,\n                                        __global unsigned char *mem_231475,\n                                        __global unsigned char *mem_231479,\n                                        __global unsigned char *mem_231483,\n                                        __global unsigned char *mem_231488,\n                                        __global unsigned char *mem_231492,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236210,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236212,\n                                        __global\n                                        unsigned char *mainzicounter_mem_236214)\n{\n    #define segred_group_sizze_225706 (mainzisegred_group_sizze_224922)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict sync_arr_mem_236225_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_236225_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_236223_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236223_backing_aligned_1;\n    __local vo",
                   "latile unsigned char *restrict red_arr_mem_236221_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236221_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236216;\n    int32_t local_tid_236217;\n    int64_t group_sizze_236220;\n    int32_t wave_sizze_236219;\n    int32_t group_tid_236218;\n    \n    global_tid_236216 = get_global_id(0);\n    local_tid_236217 = get_local_id(0);\n    group_sizze_236220 = get_local_size(0);\n    wave_sizze_236219 = LOCKSTEP_WIDTH;\n    group_tid_236218 = get_group_id(0);\n    \n    int32_t phys_tid_225714 = global_tid_236216;\n    __local unsigned char *red_arr_mem_236221;\n    \n    red_arr_mem_236221 = (__local unsigned char *) red_arr_mem_236221_backing_0;\n    \n    __local unsigned char *red_arr_mem_236223;\n    \n    red_arr_mem_236223 = (__local unsigned char *) red_arr_mem_236223_backing_1;\n    \n    __local unsigned char *sync_arr_mem_236225;\n    \n    sync_arr_mem_236225 = (__local\n                           unsigned char *) sync_arr_mem_236225_backing_2;\n    \n    int32_t phys_group_id_236227;\n    \n    phys_group_id_236227 = get_group_id(0);\n    for (int32_t i_236228 = 0; i_236228 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_236207) - phys_group_id_236227,\n                   sext_i64_i32(num_groups_225707)); i_236228++) {\n        int32_t virt_group_id_236229 = phys_group_id_236227 + i_236228 *\n                sext_i64_i32(num_groups_225707);\n        int32_t flat_segment_id_236230 = squot32(virt_group_id_236229,\n                                                 sext_i64_i32(groups_per_segment_236205));\n        int64_t global_tid_236231 = srem64(sext_i32_i64(virt_group_id_236229) *\n                                           segred_group_sizze_225706 +\n                                           sext_i32_i64(local_tid_236217),\n                                           segred_group_sizze_225706 *\n                      ",
                   "                     groups_per_segment_236205);\n        int64_t slice_236232 = t_n_m_203740;\n        int64_t slice_236233 = partition_sizze_203667 * slice_236232;\n        int64_t gtid_225711 = squot64(sext_i32_i64(flat_segment_id_236230),\n                                      slice_236232);\n        int64_t remnant_236234 = sext_i32_i64(flat_segment_id_236230) -\n                gtid_225711 * slice_236232;\n        int64_t gtid_225712 = remnant_236234;\n        int64_t remnant_236235 = remnant_236234 - gtid_225712;\n        int64_t gtid_225713;\n        double x_acc_236236;\n        double x_acc_236237;\n        int64_t chunk_sizze_236238 = smin64(elements_per_thread_236206,\n                                            sdiv_up64(q_t_203576 -\n                                                      global_tid_236231,\n                                                      threads_per_segment_236209));\n        double x_225715;\n        double x_225716;\n        double x_225717;\n        double x_225718;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_236236 = 0.0;\n            x_acc_236237 = 0.0;\n        }\n        for (int64_t i_236245 = 0; i_236245 < chunk_sizze_236238; i_236245++) {\n            gtid_225713 = global_tid_236231 + threads_per_segment_236209 *\n                i_236245;\n            // apply map function\n            {\n                int64_t x_225722;\n                \n                x_225722 = ((__global int64_t *) ext_mem_229304)[gtid_225711];\n                \n                int64_t x_225733;\n                \n                x_225733 = ((__global int64_t *) ext_mem_229569)[gtid_225711 *\n                                                                 t_n_m_203740 +\n                                                                 gtid_225712];\n                \n                double x_225734;\n                \n                x_225734 = ((__global double *) ext_mem_229568)[gtid_225711 *\n                                                 ",
                   "               t_n_m_203740 +\n                                                                gtid_225712];\n                \n                int64_t binop_y_228765 = mul64(jump_t_203582, gtid_225712);\n                int64_t binop_y_228766 = smin64(i_203760, binop_y_228765);\n                int64_t index_primexp_228767 = add64((int64_t) 1,\n                                                     binop_y_228766);\n                double a12_225736;\n                \n                a12_225736 = ((__global double *) mem_231467)[gtid_225711 *\n                                                              t_n_m_203740 +\n                                                              gtid_225712];\n                \n                double b12_225737;\n                \n                b12_225737 = ((__global double *) mem_231471)[gtid_225711 *\n                                                              t_n_m_203740 +\n                                                              gtid_225712];\n                \n                double c12_225738;\n                \n                c12_225738 = ((__global double *) mem_231475)[gtid_225711 *\n                                                              t_n_m_203740 +\n                                                              gtid_225712];\n                \n                double b2_225739;\n                \n                b2_225739 = ((__global double *) mem_231479)[gtid_225711 *\n                                                             t_n_m_203740 +\n                                                             gtid_225712];\n                \n                double c2_225740;\n                \n                c2_225740 = ((__global double *) mem_231483)[gtid_225711 *\n                                                             t_n_m_203740 +\n                                                             gtid_225712];\n                \n                bool cond_225742 = sle64(x_225722, gtid_225713);\n                int64_t defunc_0_f_res_22",
                   "5743;\n                \n                if (cond_225742) {\n                    defunc_0_f_res_225743 = (int64_t) 0;\n                } else {\n                    int64_t i_225744 = add64(gtid_225713, x_225733);\n                    int64_t defunc_0_add_arg_225745;\n                    \n                    defunc_0_add_arg_225745 = ((__global\n                                                int64_t *) ext_mem_229305)[gtid_225711 *\n                                                                           n_203572 +\n                                                                           i_225744];\n                    \n                    int64_t defunc_1_add_res_225746 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_225745);\n                    \n                    defunc_0_f_res_225743 = defunc_1_add_res_225746;\n                }\n                \n                double defunc_0_f_res_225747;\n                \n                if (cond_225742) {\n                    defunc_0_f_res_225747 = 0.0;\n                } else {\n                    int64_t i_225748 = add64(gtid_225713, x_225733);\n                    double defunc_0_add_arg_225749;\n                    \n                    defunc_0_add_arg_225749 = ((__global\n                                                double *) mem_231428)[gtid_225711 *\n                                                                      n_203572 +\n                                                                      i_225748];\n                    defunc_0_f_res_225747 = defunc_0_add_arg_225749;\n                }\n                \n                int64_t binop_p_225750 = sub64(defunc_0_f_res_225743,\n                                               index_primexp_228767);\n                double defunc_0_f_res_225751 = sitofp_i64_f64(binop_p_225750);\n                double abs_res_225752 = fabs(defunc_0_f_res_225751);\n                double tmp1_225753 = abs_res_225752 / x_225734;\n                doubl",
                   "e x_225754 = tmp1_225753 * tmp1_225753;\n                double y_225755 = tmp1_225753 * x_225754;\n                double tmp2_225756 = 1.0 - y_225755;\n                double x_225757 = tmp2_225756 * tmp2_225756;\n                double tmp3_225758 = tmp2_225756 * x_225757;\n                double tmp4_225759 = defunc_0_f_res_225747 * tmp3_225758;\n                double defunc_1_f_res_225760 = defunc_0_f_res_225751 *\n                       tmp4_225759;\n                double defunc_1_f_res_225761 = defunc_0_f_res_225751 *\n                       defunc_1_f_res_225760;\n                double defunc_0_f_res_225762;\n                \n                if (cond_225742) {\n                    defunc_0_f_res_225762 = 0.0;\n                } else {\n                    int64_t i_225763 = add64(gtid_225713, x_225733);\n                    double defunc_0_add_arg_225764;\n                    \n                    defunc_0_add_arg_225764 = ((__global\n                                                double *) mem_231432)[gtid_225711 *\n                                                                      n_203572 +\n                                                                      i_225763];\n                    defunc_0_f_res_225762 = defunc_0_add_arg_225764;\n                }\n                \n                double x_225765 = a12_225736 * tmp4_225759;\n                double y_225766 = b12_225737 * defunc_1_f_res_225760;\n                double x_225767 = x_225765 + y_225766;\n                double y_225768 = c12_225738 * defunc_1_f_res_225761;\n                double x_225769 = x_225767 + y_225768;\n                double defunc_9_fit_fun_res_225770 = defunc_0_f_res_225762 *\n                       x_225769;\n                double x_225771 = b12_225737 * tmp4_225759;\n                double y_225772 = b2_225739 * defunc_1_f_res_225760;\n                double x_225773 = x_225771 + y_225772;\n                double y_225774 = c2_225740 * defunc_1_f_res_225761;\n                double x_225775 = x",
                   "_225773 + y_225774;\n                double defunc_9_slope_fun_res_225776 = defunc_0_f_res_225762 *\n                       x_225775;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_225715 = x_acc_236236;\n                    x_225716 = x_acc_236237;\n                }\n                // load new values\n                {\n                    x_225717 = defunc_9_fit_fun_res_225770;\n                    x_225718 = defunc_9_slope_fun_res_225776;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_225719 = x_225715 + x_225717;\n                    double defunc_1_op_res_225720 = x_225716 + x_225718;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_236236 = defunc_1_op_res_225719;\n                        x_acc_236237 = defunc_1_op_res_225720;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_225715 = x_acc_236236;\n            x_225716 = x_acc_236237;\n            ((__local\n              double *) red_arr_mem_236221)[sext_i32_i64(local_tid_236217)] =\n                x_225715;\n            ((__local\n              double *) red_arr_mem_236223)[sext_i32_i64(local_tid_236217)] =\n                x_225716;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_236246;\n        int32_t skip_waves_236247 = 1;\n        double x_236239;\n        double x_236240;\n        double x_236241;\n        double x_236242;\n        \n        offset_236246 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_236217,\n                      sext_i64_i32(segred_group_sizze_225706))) {\n                x_236239 = ((__local\n                             double *) red_arr_mem_236221)[sext_i32_i64(",
                   "local_tid_236217 +\n                                                           offset_236246)];\n                x_236240 = ((__local\n                             double *) red_arr_mem_236223)[sext_i32_i64(local_tid_236217 +\n                                                           offset_236246)];\n            }\n        }\n        offset_236246 = 1;\n        while (slt32(offset_236246, wave_sizze_236219)) {\n            if (slt32(local_tid_236217 + offset_236246,\n                      sext_i64_i32(segred_group_sizze_225706)) &&\n                ((local_tid_236217 - squot32(local_tid_236217,\n                                             wave_sizze_236219) *\n                  wave_sizze_236219) & (2 * offset_236246 - 1)) == 0) {\n                // read array element\n                {\n                    x_236241 = ((volatile __local\n                                 double *) red_arr_mem_236221)[sext_i32_i64(local_tid_236217 +\n                                                               offset_236246)];\n                    x_236242 = ((volatile __local\n                                 double *) red_arr_mem_236223)[sext_i32_i64(local_tid_236217 +\n                                                               offset_236246)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_236243 = x_236239 + x_236241;\n                    double defunc_1_op_res_236244 = x_236240 + x_236242;\n                    \n                    x_236239 = defunc_1_op_res_236243;\n                    x_236240 = defunc_1_op_res_236244;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_236221)[sext_i32_i64(local_tid_236217)] =\n                        x_236239;\n                    ((volatile __local\n                      double *) red_arr_mem_236223)[sext_i32_i64(local_tid_236217)] =\n                        x_236240;\n      ",
                   "          }\n            }\n            offset_236246 *= 2;\n        }\n        while (slt32(skip_waves_236247,\n                     squot32(sext_i64_i32(segred_group_sizze_225706) +\n                             wave_sizze_236219 - 1, wave_sizze_236219))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_236246 = skip_waves_236247 * wave_sizze_236219;\n            if (slt32(local_tid_236217 + offset_236246,\n                      sext_i64_i32(segred_group_sizze_225706)) &&\n                ((local_tid_236217 - squot32(local_tid_236217,\n                                             wave_sizze_236219) *\n                  wave_sizze_236219) == 0 && (squot32(local_tid_236217,\n                                                      wave_sizze_236219) & (2 *\n                                                                            skip_waves_236247 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_236241 = ((__local\n                                 double *) red_arr_mem_236221)[sext_i32_i64(local_tid_236217 +\n                                                               offset_236246)];\n                    x_236242 = ((__local\n                                 double *) red_arr_mem_236223)[sext_i32_i64(local_tid_236217 +\n                                                               offset_236246)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_236243 = x_236239 + x_236241;\n                    double defunc_1_op_res_236244 = x_236240 + x_236242;\n                    \n                    x_236239 = defunc_1_op_res_236243;\n                    x_236240 = defunc_1_op_res_236244;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_236221)[sext_i32_i64(local_tid_",
                   "236217)] =\n                        x_236239;\n                    ((__local\n                      double *) red_arr_mem_236223)[sext_i32_i64(local_tid_236217)] =\n                        x_236240;\n                }\n            }\n            skip_waves_236247 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_236217) == (int64_t) 0) {\n                x_acc_236236 = x_236239;\n                x_acc_236237 = x_236240;\n            }\n        }\n        if (groups_per_segment_236205 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_236217 == 0) {\n                    ((__global double *) mem_231488)[gtid_225711 *\n                                                     t_n_m_203740 +\n                                                     gtid_225712] =\n                        x_acc_236236;\n                    ((__global double *) mem_231492)[gtid_225711 *\n                                                     t_n_m_203740 +\n                                                     gtid_225712] =\n                        x_acc_236237;\n                }\n            }\n        } else {\n            int32_t old_counter_236248;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_236217 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_236210)[sext_i32_i64(virt_group_id_236229)] =\n                        x_acc_236236;\n                    ((__global\n                      double *) segred_tmp_mem_236212)[sext_i32_i64(virt_group_id_236229)] =\n                        x_acc_236237;\n                    mem_fence_global();\n                    old_counter_236248 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_236214)[s",
                   "ext_i32_i64(srem32(flat_segment_id_236230,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_236225)[(int64_t) 0] =\n                        old_counter_236248 == groups_per_segment_236205 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_236249;\n            \n            is_last_group_236249 = ((__local\n                                     bool *) sync_arr_mem_236225)[(int64_t) 0];\n            if (is_last_group_236249) {\n                if (local_tid_236217 == 0) {\n                    old_counter_236248 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_236214)[sext_i32_i64(srem32(flat_segment_id_236230,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_236205));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_236250 =\n                            sdiv_up64(groups_per_segment_236205,\n                                      segred_group_sizze_225706);\n                    \n                    x_225715 = 0.0;\n                    x_225716 = 0.0;\n                    for (int64_t i_236251 = 0; i_236251 <\n                         read_per_thread_236250; i_236251++) {\n                        int64_t group_res_id_236252 =\n                                sext_i32_i64(local_tid_236217) *\n                                read_per_thread_236250 + i_236251;\n                        int64_t index_of_group_res_236253 =\n        ",
                   "                        sext_i32_i64(flat_segment_id_236230) *\n                                groups_per_segment_236205 + group_res_id_236252;\n                        \n                        if (slt64(group_res_id_236252,\n                                  groups_per_segment_236205)) {\n                            x_225717 = ((__global\n                                         double *) segred_tmp_mem_236210)[index_of_group_res_236253];\n                            x_225718 = ((__global\n                                         double *) segred_tmp_mem_236212)[index_of_group_res_236253];\n                            \n                            double defunc_1_op_res_225719 = x_225715 + x_225717;\n                            double defunc_1_op_res_225720 = x_225716 + x_225718;\n                            \n                            x_225715 = defunc_1_op_res_225719;\n                            x_225716 = defunc_1_op_res_225720;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_236221)[sext_i32_i64(local_tid_236217)] =\n                    x_225715;\n                ((__local\n                  double *) red_arr_mem_236223)[sext_i32_i64(local_tid_236217)] =\n                    x_225716;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_236254;\n                    int32_t skip_waves_236255 = 1;\n                    double x_236239;\n                    double x_236240;\n                    double x_236241;\n                    double x_236242;\n                    \n                    offset_236254 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_236217,\n                                  sext_i64_i32(segred_group_sizze_225706))) {\n                            x_236239 = ((__local\n                                   ",
                   "      double *) red_arr_mem_236221)[sext_i32_i64(local_tid_236217 +\n                                                                       offset_236254)];\n                            x_236240 = ((__local\n                                         double *) red_arr_mem_236223)[sext_i32_i64(local_tid_236217 +\n                                                                       offset_236254)];\n                        }\n                    }\n                    offset_236254 = 1;\n                    while (slt32(offset_236254, wave_sizze_236219)) {\n                        if (slt32(local_tid_236217 + offset_236254,\n                                  sext_i64_i32(segred_group_sizze_225706)) &&\n                            ((local_tid_236217 - squot32(local_tid_236217,\n                                                         wave_sizze_236219) *\n                              wave_sizze_236219) & (2 * offset_236254 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_236241 = ((volatile __local\n                                             double *) red_arr_mem_236221)[sext_i32_i64(local_tid_236217 +\n                                                                           offset_236254)];\n                                x_236242 = ((volatile __local\n                                             double *) red_arr_mem_236223)[sext_i32_i64(local_tid_236217 +\n                                                                           offset_236254)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_236243 = x_236239 +\n                                       x_236241;\n                                double defunc_1_op_res_236244 = x_236240 +\n                                       x_236242;\n                                \n                                x_23",
                   "6239 = defunc_1_op_res_236243;\n                                x_236240 = defunc_1_op_res_236244;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_236221)[sext_i32_i64(local_tid_236217)] =\n                                    x_236239;\n                                ((volatile __local\n                                  double *) red_arr_mem_236223)[sext_i32_i64(local_tid_236217)] =\n                                    x_236240;\n                            }\n                        }\n                        offset_236254 *= 2;\n                    }\n                    while (slt32(skip_waves_236255,\n                                 squot32(sext_i64_i32(segred_group_sizze_225706) +\n                                         wave_sizze_236219 - 1,\n                                         wave_sizze_236219))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_236254 = skip_waves_236255 * wave_sizze_236219;\n                        if (slt32(local_tid_236217 + offset_236254,\n                                  sext_i64_i32(segred_group_sizze_225706)) &&\n                            ((local_tid_236217 - squot32(local_tid_236217,\n                                                         wave_sizze_236219) *\n                              wave_sizze_236219) == 0 &&\n                             (squot32(local_tid_236217, wave_sizze_236219) &\n                              (2 * skip_waves_236255 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_236241 = ((__local\n                                             double *) red_arr_mem_236221)[sext_i32_i64(local_tid_236217 +\n                                                                           offset_236254)];\n                                x_236242 = (",
                   "(__local\n                                             double *) red_arr_mem_236223)[sext_i32_i64(local_tid_236217 +\n                                                                           offset_236254)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_236243 = x_236239 +\n                                       x_236241;\n                                double defunc_1_op_res_236244 = x_236240 +\n                                       x_236242;\n                                \n                                x_236239 = defunc_1_op_res_236243;\n                                x_236240 = defunc_1_op_res_236244;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_236221)[sext_i32_i64(local_tid_236217)] =\n                                    x_236239;\n                                ((__local\n                                  double *) red_arr_mem_236223)[sext_i32_i64(local_tid_236217)] =\n                                    x_236240;\n                            }\n                        }\n                        skip_waves_236255 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_236217 == 0) {\n                            ((__global double *) mem_231488)[gtid_225711 *\n                                                             t_n_m_203740 +\n                                                             gtid_225712] =\n                                x_236239;\n                            ((__global double *) mem_231492)[gtid_225711 *\n                                                             t_n_m_203740 +\n                                                             gtid_225712] =\n          ",
                   "                      x_236240;\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_225706\n}\n__kernel void mainzisegred_large_228180(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_236734_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_236732_backing_aligned_1,\n                                        int64_t n_203572,\n                                        int64_t partition_sizze_203667,\n                                        int64_t stl_res_203754,\n                                        int64_t j_m_i_204223,\n                                        int64_t num_groups_228175,\n                                        int64_t groups_per_segment_236718,\n                                        int64_t elements_per_thread_236719,\n                                        int64_t virt_num_groups_236720,\n                                        int64_t threads_per_segment_236722,\n                                        __global unsigned char *ext_mem_231924,\n                                        __global unsigned char *mem_231941,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236723,\n                                        __global\n                                        unsigned char *mainzicounter_mem_236725)\n{\n    #define segred_group_sizze_228174 (mainzisegred_group_sizze_228157)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict sync_arr_mem_236734_backing_1 =\n                                   (__local volatile\n                                    unsigned char *",
                   ") sync_arr_mem_236734_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_236732_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236732_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236727;\n    int32_t local_tid_236728;\n    int64_t group_sizze_236731;\n    int32_t wave_sizze_236730;\n    int32_t group_tid_236729;\n    \n    global_tid_236727 = get_global_id(0);\n    local_tid_236728 = get_local_id(0);\n    group_sizze_236731 = get_local_size(0);\n    wave_sizze_236730 = LOCKSTEP_WIDTH;\n    group_tid_236729 = get_group_id(0);\n    \n    int32_t phys_tid_228180 = global_tid_236727;\n    __local unsigned char *red_arr_mem_236732;\n    \n    red_arr_mem_236732 = (__local unsigned char *) red_arr_mem_236732_backing_0;\n    \n    __local unsigned char *sync_arr_mem_236734;\n    \n    sync_arr_mem_236734 = (__local\n                           unsigned char *) sync_arr_mem_236734_backing_1;\n    \n    int32_t phys_group_id_236736;\n    \n    phys_group_id_236736 = get_group_id(0);\n    for (int32_t i_236737 = 0; i_236737 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_236720) - phys_group_id_236736,\n                   sext_i64_i32(num_groups_228175)); i_236737++) {\n        int32_t virt_group_id_236738 = phys_group_id_236736 + i_236737 *\n                sext_i64_i32(num_groups_228175);\n        int32_t flat_segment_id_236739 = squot32(virt_group_id_236738,\n                                                 sext_i64_i32(groups_per_segment_236718));\n        int64_t global_tid_236740 = srem64(sext_i32_i64(virt_group_id_236738) *\n                                           segred_group_sizze_228174 +\n                                           sext_i32_i64(local_tid_236728),\n                                           segred_group_sizze_228174 *\n                                           groups_per_segment_236718);\n        int64_t slice_236741 = par",
                   "tition_sizze_203667;\n        int64_t gtid_228178 = sext_i32_i64(flat_segment_id_236739);\n        int64_t remnant_236742 = sext_i32_i64(flat_segment_id_236739) -\n                gtid_228178;\n        int64_t gtid_228179;\n        double x_acc_236743;\n        int64_t chunk_sizze_236744 = smin64(elements_per_thread_236719,\n                                            sdiv_up64(j_m_i_204223 -\n                                                      global_tid_236740,\n                                                      threads_per_segment_236722));\n        double x_228181;\n        double x_228182;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_236743 = 0.0;\n        }\n        for (int64_t i_236748 = 0; i_236748 < chunk_sizze_236744; i_236748++) {\n            gtid_228179 = global_tid_236740 + threads_per_segment_236722 *\n                i_236748;\n            // apply map function\n            {\n                int64_t slice_228309 = stl_res_203754 + gtid_228179;\n                double x_228185;\n                \n                x_228185 = ((__global double *) ext_mem_231924)[gtid_228178 *\n                                                                n_203572 +\n                                                                slice_228309];\n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_228181 = x_acc_236743;\n                }\n                // load new values\n                {\n                    x_228182 = x_228185;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_228183 = x_228181 + x_228182;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_236743 = defunc_1_op_res_228183;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {",
                   "\n            x_228181 = x_acc_236743;\n            ((__local\n              double *) red_arr_mem_236732)[sext_i32_i64(local_tid_236728)] =\n                x_228181;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_236749;\n        int32_t skip_waves_236750 = 1;\n        double x_236745;\n        double x_236746;\n        \n        offset_236749 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_236728,\n                      sext_i64_i32(segred_group_sizze_228174))) {\n                x_236745 = ((__local\n                             double *) red_arr_mem_236732)[sext_i32_i64(local_tid_236728 +\n                                                           offset_236749)];\n            }\n        }\n        offset_236749 = 1;\n        while (slt32(offset_236749, wave_sizze_236730)) {\n            if (slt32(local_tid_236728 + offset_236749,\n                      sext_i64_i32(segred_group_sizze_228174)) &&\n                ((local_tid_236728 - squot32(local_tid_236728,\n                                             wave_sizze_236730) *\n                  wave_sizze_236730) & (2 * offset_236749 - 1)) == 0) {\n                // read array element\n                {\n                    x_236746 = ((volatile __local\n                                 double *) red_arr_mem_236732)[sext_i32_i64(local_tid_236728 +\n                                                               offset_236749)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_236747 = x_236745 + x_236746;\n                    \n                    x_236745 = defunc_1_op_res_236747;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_236732)[sext_i32_i64(local_tid_236728)] =\n                        x_236745;\n                }\n            }\n            offset_236749 *= 2",
                   ";\n        }\n        while (slt32(skip_waves_236750,\n                     squot32(sext_i64_i32(segred_group_sizze_228174) +\n                             wave_sizze_236730 - 1, wave_sizze_236730))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_236749 = skip_waves_236750 * wave_sizze_236730;\n            if (slt32(local_tid_236728 + offset_236749,\n                      sext_i64_i32(segred_group_sizze_228174)) &&\n                ((local_tid_236728 - squot32(local_tid_236728,\n                                             wave_sizze_236730) *\n                  wave_sizze_236730) == 0 && (squot32(local_tid_236728,\n                                                      wave_sizze_236730) & (2 *\n                                                                            skip_waves_236750 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_236746 = ((__local\n                                 double *) red_arr_mem_236732)[sext_i32_i64(local_tid_236728 +\n                                                               offset_236749)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_236747 = x_236745 + x_236746;\n                    \n                    x_236745 = defunc_1_op_res_236747;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_236732)[sext_i32_i64(local_tid_236728)] =\n                        x_236745;\n                }\n            }\n            skip_waves_236750 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_236728) == (int64_t) 0) {\n                x_acc_236743 = x_236745;\n            }\n        }\n        if (groups_per_segment_236718 == (i",
                   "nt64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_236728 == 0) {\n                    ((__global double *) mem_231941)[gtid_228178] =\n                        x_acc_236743;\n                }\n            }\n        } else {\n            int32_t old_counter_236751;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_236728 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_236723)[sext_i32_i64(virt_group_id_236738)] =\n                        x_acc_236743;\n                    mem_fence_global();\n                    old_counter_236751 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_236725)[sext_i32_i64(srem32(flat_segment_id_236739,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_236734)[(int64_t) 0] =\n                        old_counter_236751 == groups_per_segment_236718 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_236752;\n            \n            is_last_group_236752 = ((__local\n                                     bool *) sync_arr_mem_236734)[(int64_t) 0];\n            if (is_last_group_236752) {\n                if (local_tid_236728 == 0) {\n                    old_counter_236751 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_236725)[sext_i32_i64(srem32(flat_segment_id_236739,\n                                                                                                      10240))],\n               ",
                   "                               (int) ((int64_t) 0 -\n                                                     groups_per_segment_236718));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_236753 =\n                            sdiv_up64(groups_per_segment_236718,\n                                      segred_group_sizze_228174);\n                    \n                    x_228181 = 0.0;\n                    for (int64_t i_236754 = 0; i_236754 <\n                         read_per_thread_236753; i_236754++) {\n                        int64_t group_res_id_236755 =\n                                sext_i32_i64(local_tid_236728) *\n                                read_per_thread_236753 + i_236754;\n                        int64_t index_of_group_res_236756 =\n                                sext_i32_i64(flat_segment_id_236739) *\n                                groups_per_segment_236718 + group_res_id_236755;\n                        \n                        if (slt64(group_res_id_236755,\n                                  groups_per_segment_236718)) {\n                            x_228182 = ((__global\n                                         double *) segred_tmp_mem_236723)[index_of_group_res_236756];\n                            \n                            double defunc_1_op_res_228183 = x_228181 + x_228182;\n                            \n                            x_228181 = defunc_1_op_res_228183;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_236732)[sext_i32_i64(local_tid_236728)] =\n                    x_228181;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_236757;\n                    int32_t skip_waves_236758 = 1;\n                    double x_236745;\n                    double x_236746;\n                    \n                  ",
                   "  offset_236757 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_236728,\n                                  sext_i64_i32(segred_group_sizze_228174))) {\n                            x_236745 = ((__local\n                                         double *) red_arr_mem_236732)[sext_i32_i64(local_tid_236728 +\n                                                                       offset_236757)];\n                        }\n                    }\n                    offset_236757 = 1;\n                    while (slt32(offset_236757, wave_sizze_236730)) {\n                        if (slt32(local_tid_236728 + offset_236757,\n                                  sext_i64_i32(segred_group_sizze_228174)) &&\n                            ((local_tid_236728 - squot32(local_tid_236728,\n                                                         wave_sizze_236730) *\n                              wave_sizze_236730) & (2 * offset_236757 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_236746 = ((volatile __local\n                                             double *) red_arr_mem_236732)[sext_i32_i64(local_tid_236728 +\n                                                                           offset_236757)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_236747 = x_236745 +\n                                       x_236746;\n                                \n                                x_236745 = defunc_1_op_res_236747;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_236732)[sext_i32_i64(local_tid_236728)] =\n ",
                   "                                   x_236745;\n                            }\n                        }\n                        offset_236757 *= 2;\n                    }\n                    while (slt32(skip_waves_236758,\n                                 squot32(sext_i64_i32(segred_group_sizze_228174) +\n                                         wave_sizze_236730 - 1,\n                                         wave_sizze_236730))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_236757 = skip_waves_236758 * wave_sizze_236730;\n                        if (slt32(local_tid_236728 + offset_236757,\n                                  sext_i64_i32(segred_group_sizze_228174)) &&\n                            ((local_tid_236728 - squot32(local_tid_236728,\n                                                         wave_sizze_236730) *\n                              wave_sizze_236730) == 0 &&\n                             (squot32(local_tid_236728, wave_sizze_236730) &\n                              (2 * skip_waves_236758 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_236746 = ((__local\n                                             double *) red_arr_mem_236732)[sext_i32_i64(local_tid_236728 +\n                                                                           offset_236757)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_236747 = x_236745 +\n                                       x_236746;\n                                \n                                x_236745 = defunc_1_op_res_236747;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_236732)[sext_i32_i64(local_tid_236728)] =\n      ",
                   "                              x_236745;\n                            }\n                        }\n                        skip_waves_236758 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_236728 == 0) {\n                            ((__global double *) mem_231941)[gtid_228178] =\n                                x_236745;\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_228174\n}\n__kernel void mainzisegred_small_212093(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233137_backing_aligned_0,\n                                        int64_t n_p_203574, int64_t q_s_203575,\n                                        int64_t partition_sizze_203667,\n                                        int64_t defunc_0_f_res_203721,\n                                        int64_t s_n_m_203726,\n                                        int64_t num_groups_212086,\n                                        int64_t segment_sizze_nonzzero_233130,\n                                        __global unsigned char *ext_mem_229372,\n                                        __global unsigned char *ext_mem_229373,\n                                        __global unsigned char *ext_mem_229470,\n                                        __global unsigned char *ext_mem_229471,\n                                        __global unsigned char *mem_229639,\n                                        __global unsigned char *mem_229795,\n                                        __global unsigned char *mem_229805)\n{\n    #define segred_group_sizze_212085 (mainzisegred_group_sizze_211266)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_d",
                   "im2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_233137_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233137_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233132;\n    int32_t local_tid_233133;\n    int64_t group_sizze_233136;\n    int32_t wave_sizze_233135;\n    int32_t group_tid_233134;\n    \n    global_tid_233132 = get_global_id(0);\n    local_tid_233133 = get_local_id(0);\n    group_sizze_233136 = get_local_size(0);\n    wave_sizze_233135 = LOCKSTEP_WIDTH;\n    group_tid_233134 = get_group_id(0);\n    \n    int32_t phys_tid_212093 = global_tid_233132;\n    __local unsigned char *red_arr_mem_233137;\n    \n    red_arr_mem_233137 = (__local unsigned char *) red_arr_mem_233137_backing_0;\n    \n    int32_t phys_group_id_233139;\n    \n    phys_group_id_233139 = get_group_id(0);\n    for (int32_t i_233140 = 0; i_233140 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * n_p_203574 *\n                                          s_n_m_203726,\n                                          squot64(segred_group_sizze_212085,\n                                                  segment_sizze_nonzzero_233130))) -\n                   phys_group_id_233139, sext_i64_i32(num_groups_212086));\n         i_233140++) {\n        int32_t virt_group_id_233141 = phys_group_id_233139 + i_233140 *\n                sext_i64_i32(num_groups_212086);\n        int64_t slice_233142 = s_n_m_203726;\n        int64_t slice_233143 = n_p_203574 * slice_233142;\n        int64_t slice_233144 = partition_sizze_203667 * slice_233143;\n        int64_t gtid_212089 = squot64(squot64(sext_i32_i64(local_tid_233133),\n                                              segment_sizze_nonzzero_233130) +\n                                      sext_i32_i64(virt_group_id_233141) *\n                                      squot64(segred_group_sizze_212085,\n                                     ",
                   "         segment_sizze_nonzzero_233130),\n                                      slice_233143);\n        int64_t remnant_233145 = squot64(sext_i32_i64(local_tid_233133),\n                                         segment_sizze_nonzzero_233130) +\n                sext_i32_i64(virt_group_id_233141) *\n                squot64(segred_group_sizze_212085,\n                        segment_sizze_nonzzero_233130) - gtid_212089 *\n                slice_233143;\n        int64_t gtid_212090 = squot64(remnant_233145, slice_233142);\n        int64_t remnant_233146 = remnant_233145 - gtid_212090 * slice_233142;\n        int64_t gtid_212091 = remnant_233146;\n        int64_t remnant_233147 = remnant_233146 - gtid_212091;\n        int64_t gtid_212092 = srem64(sext_i32_i64(local_tid_233133),\n                                     q_s_203575);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_s_203575) && (((slt64(gtid_212089,\n                                                           partition_sizze_203667) &&\n                                                     slt64(gtid_212090,\n                                                           n_p_203574)) &&\n                                                    slt64(gtid_212091,\n                                                          s_n_m_203726)) &&\n                                                   slt64(sext_i32_i64(local_tid_233133),\n                                                         q_s_203575 *\n                                                         squot64(segred_group_sizze_212085,\n                                                                 segment_sizze_nonzzero_233130)))) {\n                int64_t x_212105;\n                \n                x_212105 = ((__global int64_t *) ext_mem_229372)[gtid_212089 *\n                                                                 n_p_203574 +\n                                                                 gtid_212090];\n                \n         ",
                   "       int64_t x_212109;\n                \n                x_212109 = ((__global int64_t *) ext_mem_229471)[gtid_212089 *\n                                                                 (s_n_m_203726 *\n                                                                  n_p_203574) +\n                                                                 gtid_212090 *\n                                                                 s_n_m_203726 +\n                                                                 gtid_212091];\n                \n                double x_212110;\n                \n                x_212110 = ((__global double *) ext_mem_229470)[gtid_212089 *\n                                                                (s_n_m_203726 *\n                                                                 n_p_203574) +\n                                                                gtid_212090 *\n                                                                s_n_m_203726 +\n                                                                gtid_212091];\n                \n                int64_t defunc_0_m_fun_res_212111;\n                \n                defunc_0_m_fun_res_212111 = ((__global\n                                              int64_t *) mem_229795)[gtid_212089 *\n                                                                     (s_n_m_203726 *\n                                                                      n_p_203574) +\n                                                                     gtid_212090 *\n                                                                     s_n_m_203726 +\n                                                                     gtid_212091];\n                \n                bool cond_212113 = sle64(x_212105, gtid_212092);\n                int64_t defunc_0_f_res_212114;\n                \n                if (cond_212113) {\n                    defunc_0_f_res_212114 = (int64_t) 0;\n                } else {\n                    int64_t i_212115",
                   " = add64(gtid_212092, x_212109);\n                    int64_t defunc_0_add_arg_212116;\n                    \n                    defunc_0_add_arg_212116 = ((__global\n                                                int64_t *) ext_mem_229373)[gtid_212089 *\n                                                                           (defunc_0_f_res_203721 *\n                                                                            n_p_203574) +\n                                                                           gtid_212090 *\n                                                                           defunc_0_f_res_203721 +\n                                                                           i_212115];\n                    \n                    int64_t defunc_1_add_res_212117 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_212116);\n                    \n                    defunc_0_f_res_212114 = defunc_1_add_res_212117;\n                }\n                \n                double defunc_0_f_res_212118;\n                \n                if (cond_212113) {\n                    defunc_0_f_res_212118 = 0.0;\n                } else {\n                    int64_t i_212119 = add64(gtid_212092, x_212109);\n                    double defunc_0_add_arg_212120;\n                    \n                    defunc_0_add_arg_212120 = ((__global\n                                                double *) mem_229639)[gtid_212089 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_212090 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_212119];\n                    defunc_0_f_res_212118 = defunc_0_add_arg_212120;\n               ",
                   " }\n                \n                int64_t binop_p_212121 = sub64(defunc_0_f_res_212114,\n                                               defunc_0_m_fun_res_212111);\n                double defunc_0_f_res_212122 = sitofp_i64_f64(binop_p_212121);\n                double abs_res_212123 = fabs(defunc_0_f_res_212122);\n                double tmp1_212124 = abs_res_212123 / x_212110;\n                double x_212125 = tmp1_212124 * tmp1_212124;\n                double y_212126 = tmp1_212124 * x_212125;\n                double tmp2_212127 = 1.0 - y_212126;\n                double x_212128 = tmp2_212127 * tmp2_212127;\n                double tmp3_212129 = tmp2_212127 * x_212128;\n                double w_j_212130 = defunc_0_f_res_212118 * tmp3_212129;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_233137)[sext_i32_i64(local_tid_233133)] =\n                        w_j_212130;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_233137)[sext_i32_i64(local_tid_233133)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_s_203575)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_212094;\n                double x_212095;\n                double x_233148;\n                double x_233149;\n                bool ltid_in_bounds_233151 =\n                     slt64(sext_i32_i64(local_tid_233133), q_s_203575 *\n                           squot64(segred_group_sizze_212085,\n                                   segment_sizze_nonzzero_233130));\n                int32_t skip_threads_233152;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_233151) {\n                        x_212095 = ((volatile __local\n",
                   "                                     double *) red_arr_mem_233137)[sext_i32_i64(local_tid_233133)];\n                        if ((local_tid_233133 - squot32(local_tid_233133, 32) *\n                             32) == 0) {\n                            x_212094 = x_212095;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_233152 = 1;\n                    while (slt32(skip_threads_233152, 32)) {\n                        bool thread_active_233153 = sle32(skip_threads_233152,\n                                                          local_tid_233133 -\n                                                          squot32(local_tid_233133,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_233151;\n                        \n                        if (thread_active_233153) {\n                            // read operands\n                            {\n                                x_212094 = ((volatile __local\n                                             double *) red_arr_mem_233137)[sext_i32_i64(local_tid_233133) -\n                                                                           sext_i32_i64(skip_threads_233152)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_233154 =\n                                 slt64(srem64(sext_i32_i64(local_tid_233133),\n                                              q_s_203575),\n                                       sext_i32_i64(local_tid_233133) -\n                                       sext_i32_i64(local_tid_233133 -\n                                       skip_threads_233152));\n                            \n                            if (thread_active_233153 && inactive_233154) {\n                                x_212094 = x_212",
                   "095;\n                            }\n                            if (thread_active_233153) {\n                                if (!inactive_233154) {\n                                    double defunc_1_op_res_212096 = x_212094 +\n                                           x_212095;\n                                    \n                                    x_212094 = defunc_1_op_res_212096;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_233135, skip_threads_233152)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_233153) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233137)[sext_i32_i64(local_tid_233133)] =\n                                    x_212094;\n                                x_212095 = x_212094;\n                            }\n                        }\n                        if (sle32(wave_sizze_233135, skip_threads_233152)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_233152 *= 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_233133 - squot32(local_tid_233133, 32) *\n                         32) == 31 && ltid_in_bounds_233151) {\n                        ((volatile __local\n                          double *) red_arr_mem_233137)[sext_i32_i64(squot32(local_tid_233133,\n                                                                             32))] =\n                            x_212094;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which of",
                   "fset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_233155;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_233133, 32) == 0 &&\n                            ltid_in_bounds_233151) {\n                            x_233149 = ((volatile __local\n                                         double *) red_arr_mem_233137)[sext_i32_i64(local_tid_233133)];\n                            if ((local_tid_233133 - squot32(local_tid_233133,\n                                                            32) * 32) == 0) {\n                                x_233148 = x_233149;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_233155 = 1;\n                        while (slt32(skip_threads_233155, 32)) {\n                            bool thread_active_233156 =\n                                 sle32(skip_threads_233155, local_tid_233133 -\n                                       squot32(local_tid_233133, 32) * 32) &&\n                                 (squot32(local_tid_233133, 32) == 0 &&\n                                  ltid_in_bounds_233151);\n                            \n                            if (thread_active_233156) {\n                                // read operands\n                                {\n                                    x_233148 = ((volatile __local\n                                                 double *) red_arr_mem_233137)[sext_i32_i64(local_tid_233133) -\n                                                                               sext_i32_i64(skip_threads_233155)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_233157 =\n                     ",
                   "                slt64(srem64(sext_i32_i64(local_tid_233133 *\n                                                  32 + 32 - 1), q_s_203575),\n                                           sext_i32_i64(local_tid_233133 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_233133 -\n                                                         skip_threads_233155) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_233156 && inactive_233157) {\n                                    x_233148 = x_233149;\n                                }\n                                if (thread_active_233156) {\n                                    if (!inactive_233157) {\n                                        double defunc_1_op_res_233150 =\n                                               x_233148 + x_233149;\n                                        \n                                        x_233148 = defunc_1_op_res_233150;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_233135, skip_threads_233155)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_233156) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_233137)[sext_i32_i64(local_tid_233133)] =\n                                        x_233148;\n                                    x_233149 = x_233148;\n                                }\n                            }\n                            if (sle32(wave_sizze_233135, skip_threads_233155)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                      ",
                   "      skip_threads_233155 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_233158 = squot32(local_tid_233133, 32) == 0 ||\n                     !ltid_in_bounds_233151;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_233158) {\n                            x_212095 = x_212094;\n                            x_212094 = ((__local\n                                         double *) red_arr_mem_233137)[sext_i32_i64(squot32(local_tid_233133,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_233159 =\n                             slt64(srem64(sext_i32_i64(local_tid_233133),\n                                          q_s_203575),\n                                   sext_i32_i64(local_tid_233133) -\n                                   sext_i32_i64(squot32(local_tid_233133, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_233158) {\n                            if (inactive_233159) {\n                                x_212094 = x_212095;\n                            }\n                        }\n                        if (!no_carry_in_233158) {\n                            if (!inactive_233159) {\n                                double defunc_1_op_res_212096 = x_212094 +\n                                       x_212095;\n                                \n                                x_212094 = defunc_1_op_res_212096;\n                            }\n                        }\n                 ",
                   "   }\n                    // write final result\n                    {\n                        if (!no_carry_in_233158) {\n                            ((__local\n                              double *) red_arr_mem_233137)[sext_i32_i64(local_tid_233133)] =\n                                x_212094;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_233133, 32) == 0 &&\n                        ltid_in_bounds_233151) {\n                        ((__local\n                          double *) red_arr_mem_233137)[sext_i32_i64(local_tid_233133)] =\n                            x_212095;\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_233141) *\n                      squot64(segred_group_sizze_212085,\n                              segment_sizze_nonzzero_233130) +\n                      sext_i32_i64(local_tid_233133), partition_sizze_203667 *\n                      n_p_203574 * s_n_m_203726) &&\n                slt64(sext_i32_i64(local_tid_233133),\n                      squot64(segred_group_sizze_212085,\n                              segment_sizze_nonzzero_233130))) {\n                double tmp_233160;\n                \n                tmp_233160 = ((__local\n                               double *) red_arr_mem_233137)[(sext_i32_i64(local_tid_233133) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233130 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_229805)[squot64(sext_i32_i64(virt_group_id_233141) *\n                 ",
                   "                               squot64(segred_group_sizze_212085,\n                                                        segment_sizze_nonzzero_233130) +\n                                                sext_i32_i64(local_tid_233133),\n                                                n_p_203574 * s_n_m_203726) *\n                                        (s_n_m_203726 * n_p_203574) +\n                                        squot64(sext_i32_i64(virt_group_id_233141) *\n                                                squot64(segred_group_sizze_212085,\n                                                        segment_sizze_nonzzero_233130) +\n                                                sext_i32_i64(local_tid_233133) -\n                                                squot64(sext_i32_i64(virt_group_id_233141) *\n                                                        squot64(segred_group_sizze_212085,\n                                                                segment_sizze_nonzzero_233130) +\n                                                        sext_i32_i64(local_tid_233133),\n                                                        n_p_203574 *\n                                                        s_n_m_203726) *\n                                                (n_p_203574 * s_n_m_203726),\n                                                s_n_m_203726) * s_n_m_203726 +\n                                        (sext_i32_i64(virt_group_id_233141) *\n                                         squot64(segred_group_sizze_212085,\n                                                 segment_sizze_nonzzero_233130) +\n                                         sext_i32_i64(local_tid_233133) -\n                                         squot64(sext_i32_i64(virt_group_id_233141) *\n                                                 squot64(segred_group_sizze_212085,\n                                                         segment_sizze_nonzzero_233130) +\n                                            ",
                   "     sext_i32_i64(local_tid_233133),\n                                                 n_p_203574 * s_n_m_203726) *\n                                         (n_p_203574 * s_n_m_203726) -\n                                         squot64(sext_i32_i64(virt_group_id_233141) *\n                                                 squot64(segred_group_sizze_212085,\n                                                         segment_sizze_nonzzero_233130) +\n                                                 sext_i32_i64(local_tid_233133) -\n                                                 squot64(sext_i32_i64(virt_group_id_233141) *\n                                                         squot64(segred_group_sizze_212085,\n                                                                 segment_sizze_nonzzero_233130) +\n                                                         sext_i32_i64(local_tid_233133),\n                                                         n_p_203574 *\n                                                         s_n_m_203726) *\n                                                 (n_p_203574 * s_n_m_203726),\n                                                 s_n_m_203726) *\n                                         s_n_m_203726)] = tmp_233160;\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_212085\n}\n__kernel void mainzisegred_small_212167(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233225_backing_aligned_0,\n                                        int64_t n_p_203574, int64_t q_s_203575,\n                                        int64_t partition_sizze_203667,\n                                        int64_t defunc_0_f_res_203721,\n                                        int64_t s_n_m_203726,\n                                        int64_t ",
                   "num_groups_212160,\n                                        int64_t segment_sizze_nonzzero_233218,\n                                        __global unsigned char *ext_mem_229372,\n                                        __global unsigned char *ext_mem_229373,\n                                        __global unsigned char *ext_mem_229470,\n                                        __global unsigned char *ext_mem_229471,\n                                        __global unsigned char *mem_229634,\n                                        __global unsigned char *mem_229639,\n                                        __global unsigned char *mem_229811,\n                                        __global unsigned char *mem_229816,\n                                        __global unsigned char *mem_229822)\n{\n    #define segred_group_sizze_212159 (mainzisegred_group_sizze_211164)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_233225_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233225_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233220;\n    int32_t local_tid_233221;\n    int64_t group_sizze_233224;\n    int32_t wave_sizze_233223;\n    int32_t group_tid_233222;\n    \n    global_tid_233220 = get_global_id(0);\n    local_tid_233221 = get_local_id(0);\n    group_sizze_233224 = get_local_size(0);\n    wave_sizze_233223 = LOCKSTEP_WIDTH;\n    group_tid_233222 = get_group_id(0);\n    \n    int32_t phys_tid_212167 = global_tid_233220;\n    __local unsigned char *red_arr_mem_233225;\n    \n    red_arr_mem_233225 = (__local unsigned char *) red_arr_mem_233225_backing_0;\n    \n    int32_t phys_group_id_233227;\n    \n    phys_group_id_233227 = get_group_id(0);\n    for (int32_t i_233228 = 0; i_233228 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * n_p_2035",
                   "74 *\n                                          s_n_m_203726,\n                                          squot64(segred_group_sizze_212159,\n                                                  segment_sizze_nonzzero_233218))) -\n                   phys_group_id_233227, sext_i64_i32(num_groups_212160));\n         i_233228++) {\n        int32_t virt_group_id_233229 = phys_group_id_233227 + i_233228 *\n                sext_i64_i32(num_groups_212160);\n        int64_t slice_233230 = s_n_m_203726;\n        int64_t slice_233231 = n_p_203574 * slice_233230;\n        int64_t slice_233232 = partition_sizze_203667 * slice_233231;\n        int64_t gtid_212163 = squot64(squot64(sext_i32_i64(local_tid_233221),\n                                              segment_sizze_nonzzero_233218) +\n                                      sext_i32_i64(virt_group_id_233229) *\n                                      squot64(segred_group_sizze_212159,\n                                              segment_sizze_nonzzero_233218),\n                                      slice_233231);\n        int64_t remnant_233233 = squot64(sext_i32_i64(local_tid_233221),\n                                         segment_sizze_nonzzero_233218) +\n                sext_i32_i64(virt_group_id_233229) *\n                squot64(segred_group_sizze_212159,\n                        segment_sizze_nonzzero_233218) - gtid_212163 *\n                slice_233231;\n        int64_t gtid_212164 = squot64(remnant_233233, slice_233230);\n        int64_t remnant_233234 = remnant_233233 - gtid_212164 * slice_233230;\n        int64_t gtid_212165 = remnant_233234;\n        int64_t remnant_233235 = remnant_233234 - gtid_212165;\n        int64_t gtid_212166 = srem64(sext_i32_i64(local_tid_233221),\n                                     q_s_203575);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_s_203575) && (((slt64(gtid_212163,\n                                                           partition_sizze_203667) &&\n ",
                   "                                                    slt64(gtid_212164,\n                                                           n_p_203574)) &&\n                                                    slt64(gtid_212165,\n                                                          s_n_m_203726)) &&\n                                                   slt64(sext_i32_i64(local_tid_233221),\n                                                         q_s_203575 *\n                                                         squot64(segred_group_sizze_212159,\n                                                                 segment_sizze_nonzzero_233218)))) {\n                int64_t x_212182;\n                \n                x_212182 = ((__global int64_t *) ext_mem_229372)[gtid_212163 *\n                                                                 n_p_203574 +\n                                                                 gtid_212164];\n                \n                int64_t x_212187;\n                \n                x_212187 = ((__global int64_t *) ext_mem_229471)[gtid_212163 *\n                                                                 (s_n_m_203726 *\n                                                                  n_p_203574) +\n                                                                 gtid_212164 *\n                                                                 s_n_m_203726 +\n                                                                 gtid_212165];\n                \n                double x_212188;\n                \n                x_212188 = ((__global double *) ext_mem_229470)[gtid_212163 *\n                                                                (s_n_m_203726 *\n                                                                 n_p_203574) +\n                                                                gtid_212164 *\n                                                                s_n_m_203726 +\n                                                             ",
                   "   gtid_212165];\n                \n                double a0_212189;\n                \n                a0_212189 = ((__global double *) mem_229811)[gtid_212163 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_212164 *\n                                                             s_n_m_203726 +\n                                                             gtid_212165];\n                \n                int64_t defunc_0_m_fun_res_212190;\n                \n                defunc_0_m_fun_res_212190 = ((__global\n                                              int64_t *) mem_229816)[gtid_212163 *\n                                                                     (s_n_m_203726 *\n                                                                      n_p_203574) +\n                                                                     gtid_212164 *\n                                                                     s_n_m_203726 +\n                                                                     gtid_212165];\n                \n                bool cond_212192 = sle64(x_212182, gtid_212166);\n                int64_t defunc_0_f_res_212193;\n                \n                if (cond_212192) {\n                    defunc_0_f_res_212193 = (int64_t) 0;\n                } else {\n                    int64_t i_212194 = add64(gtid_212166, x_212187);\n                    int64_t defunc_0_add_arg_212195;\n                    \n                    defunc_0_add_arg_212195 = ((__global\n                                                int64_t *) ext_mem_229373)[gtid_212163 *\n                                                                           (defunc_0_f_res_203721 *\n                                                                            n_p_203574) +\n                                                                           gt",
                   "id_212164 *\n                                                                           defunc_0_f_res_203721 +\n                                                                           i_212194];\n                    \n                    int64_t defunc_1_add_res_212196 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_212195);\n                    \n                    defunc_0_f_res_212193 = defunc_1_add_res_212196;\n                }\n                \n                double defunc_0_f_res_212197;\n                \n                if (cond_212192) {\n                    defunc_0_f_res_212197 = 0.0;\n                } else {\n                    int64_t i_212198 = add64(gtid_212166, x_212187);\n                    double defunc_0_add_arg_212199;\n                    \n                    defunc_0_add_arg_212199 = ((__global\n                                                double *) mem_229639)[gtid_212163 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_212164 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_212198];\n                    defunc_0_f_res_212197 = defunc_0_add_arg_212199;\n                }\n                \n                int64_t binop_p_212200 = sub64(defunc_0_f_res_212193,\n                                               defunc_0_m_fun_res_212190);\n                double defunc_0_f_res_212201 = sitofp_i64_f64(binop_p_212200);\n                double abs_res_212202 = fabs(defunc_0_f_res_212201);\n                double tmp1_212203 = abs_res_212202 / x_212188;\n                double x_212204 = tmp1_212203 * tmp1_212203;\n                double y_212205 = tmp1_212203 * x_212204;\n                double t",
                   "mp2_212206 = 1.0 - y_212205;\n                double x_212207 = tmp2_212206 * tmp2_212206;\n                double tmp3_212208 = tmp2_212206 * x_212207;\n                double tmp4_212209 = defunc_0_f_res_212197 * tmp3_212208;\n                double defunc_0_f_res_212210;\n                \n                if (cond_212192) {\n                    defunc_0_f_res_212210 = 0.0;\n                } else {\n                    int64_t i_212211 = add64(gtid_212166, x_212187);\n                    double defunc_0_add_arg_212212;\n                    \n                    defunc_0_add_arg_212212 = ((__global\n                                                double *) mem_229634)[gtid_212163 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_212164 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_212211];\n                    defunc_0_f_res_212210 = defunc_0_add_arg_212212;\n                }\n                \n                double x_212213 = a0_212189 * tmp4_212209;\n                double defunc_9_fit_fun_res_212214 = defunc_0_f_res_212210 *\n                       x_212213;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_233225)[sext_i32_i64(local_tid_233221)] =\n                        defunc_9_fit_fun_res_212214;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_233225)[sext_i32_i64(local_tid_233221)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_s_203575)) {\n            // per",
                   "form segmented scan to imitate reduction\n            {\n                double x_212168;\n                double x_212169;\n                double x_233236;\n                double x_233237;\n                bool ltid_in_bounds_233239 =\n                     slt64(sext_i32_i64(local_tid_233221), q_s_203575 *\n                           squot64(segred_group_sizze_212159,\n                                   segment_sizze_nonzzero_233218));\n                int32_t skip_threads_233240;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_233239) {\n                        x_212169 = ((volatile __local\n                                     double *) red_arr_mem_233225)[sext_i32_i64(local_tid_233221)];\n                        if ((local_tid_233221 - squot32(local_tid_233221, 32) *\n                             32) == 0) {\n                            x_212168 = x_212169;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_233240 = 1;\n                    while (slt32(skip_threads_233240, 32)) {\n                        bool thread_active_233241 = sle32(skip_threads_233240,\n                                                          local_tid_233221 -\n                                                          squot32(local_tid_233221,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_233239;\n                        \n                        if (thread_active_233241) {\n                            // read operands\n                            {\n                                x_212168 = ((volatile __local\n                                             double *) red_arr_mem_233225)[sext_i32_i64(local_tid_233221) -\n                                                                           sext_i32_i64(skip_threads_233240)];\n       ",
                   "                     }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_233242 =\n                                 slt64(srem64(sext_i32_i64(local_tid_233221),\n                                              q_s_203575),\n                                       sext_i32_i64(local_tid_233221) -\n                                       sext_i32_i64(local_tid_233221 -\n                                       skip_threads_233240));\n                            \n                            if (thread_active_233241 && inactive_233242) {\n                                x_212168 = x_212169;\n                            }\n                            if (thread_active_233241) {\n                                if (!inactive_233242) {\n                                    double defunc_1_op_res_212170 = x_212168 +\n                                           x_212169;\n                                    \n                                    x_212168 = defunc_1_op_res_212170;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_233223, skip_threads_233240)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_233241) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233225)[sext_i32_i64(local_tid_233221)] =\n                                    x_212168;\n                                x_212169 = x_212168;\n                            }\n                        }\n                        if (sle32(wave_sizze_233223, skip_threads_233240)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_233240 *= 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_233221 - squot32(local_tid_233221, 32) *\n                         32) == 31 && ltid_in_bounds_233239) {\n                        ((volatile __local\n                          double *) red_arr_mem_233225)[sext_i32_i64(squot32(local_tid_233221,\n                                                                             32))] =\n                            x_212168;\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_233243;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_233221, 32) == 0 &&\n                            ltid_in_bounds_233239) {\n                            x_233237 = ((volatile __local\n                                         double *) red_arr_mem_233225)[sext_i32_i64(local_tid_233221)];\n                            if ((local_tid_233221 - squot32(local_tid_233221,\n                                                            32) * 32) == 0) {\n                                x_233236 = x_233237;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_233243 = 1;\n                        while (slt32(skip_threads_233243, 32)) {\n                            bool thread_active_233244 =\n                                 sle32(skip_threads_233243, local_tid_233221 -\n                                       squot32(local_tid_233221, 32) * 32) &&\n                                 (squot32(local_tid_233221, 32) == 0 &&\n                                  ltid_in_bounds_233239);\n               ",
                   "             \n                            if (thread_active_233244) {\n                                // read operands\n                                {\n                                    x_233236 = ((volatile __local\n                                                 double *) red_arr_mem_233225)[sext_i32_i64(local_tid_233221) -\n                                                                               sext_i32_i64(skip_threads_233243)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_233245 =\n                                     slt64(srem64(sext_i32_i64(local_tid_233221 *\n                                                  32 + 32 - 1), q_s_203575),\n                                           sext_i32_i64(local_tid_233221 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_233221 -\n                                                         skip_threads_233243) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_233244 && inactive_233245) {\n                                    x_233236 = x_233237;\n                                }\n                                if (thread_active_233244) {\n                                    if (!inactive_233245) {\n                                        double defunc_1_op_res_233238 =\n                                               x_233236 + x_233237;\n                                        \n                                        x_233236 = defunc_1_op_res_233238;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_233223, skip_threads_233243)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                          ",
                   "  }\n                            if (thread_active_233244) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_233225)[sext_i32_i64(local_tid_233221)] =\n                                        x_233236;\n                                    x_233237 = x_233236;\n                                }\n                            }\n                            if (sle32(wave_sizze_233223, skip_threads_233243)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_233243 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_233246 = squot32(local_tid_233221, 32) == 0 ||\n                     !ltid_in_bounds_233239;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_233246) {\n                            x_212169 = x_212168;\n                            x_212168 = ((__local\n                                         double *) red_arr_mem_233225)[sext_i32_i64(squot32(local_tid_233221,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_233247 =\n                             slt64(srem64(sext_i32_i64(local_tid_233221),\n                                          q_s_203575),\n                                   sext_i32_i64(local_tid_233221) -\n                                   sext_i32_i64(squot32(local_tid_233221, 32) *\n                ",
                   "                   32 - 1));\n                        \n                        if (!no_carry_in_233246) {\n                            if (inactive_233247) {\n                                x_212168 = x_212169;\n                            }\n                        }\n                        if (!no_carry_in_233246) {\n                            if (!inactive_233247) {\n                                double defunc_1_op_res_212170 = x_212168 +\n                                       x_212169;\n                                \n                                x_212168 = defunc_1_op_res_212170;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_233246) {\n                            ((__local\n                              double *) red_arr_mem_233225)[sext_i32_i64(local_tid_233221)] =\n                                x_212168;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_233221, 32) == 0 &&\n                        ltid_in_bounds_233239) {\n                        ((__local\n                          double *) red_arr_mem_233225)[sext_i32_i64(local_tid_233221)] =\n                            x_212169;\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_233229) *\n                      squot64(segred_group_sizze_212159,\n                              segment_sizze_nonzzero_233218) +\n                      sext_i32_i64(local_tid_233221), partition_sizze_203667 *\n                      n_p_203574 * s_n_m_203726) &&\n                slt64(sext_i32_i64(local_tid_233221),\n                 ",
                   "     squot64(segred_group_sizze_212159,\n                              segment_sizze_nonzzero_233218))) {\n                double tmp_233248;\n                \n                tmp_233248 = ((__local\n                               double *) red_arr_mem_233225)[(sext_i32_i64(local_tid_233221) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233218 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_229822)[squot64(sext_i32_i64(virt_group_id_233229) *\n                                                squot64(segred_group_sizze_212159,\n                                                        segment_sizze_nonzzero_233218) +\n                                                sext_i32_i64(local_tid_233221),\n                                                n_p_203574 * s_n_m_203726) *\n                                        (s_n_m_203726 * n_p_203574) +\n                                        squot64(sext_i32_i64(virt_group_id_233229) *\n                                                squot64(segred_group_sizze_212159,\n                                                        segment_sizze_nonzzero_233218) +\n                                                sext_i32_i64(local_tid_233221) -\n                                                squot64(sext_i32_i64(virt_group_id_233229) *\n                                                        squot64(segred_group_sizze_212159,\n                                                                segment_sizze_nonzzero_233218) +\n                                                        sext_i32_i64(local_tid_233221),\n                                                        n_p_203574 *\n                                                        s_n_m_203726) *\n                                                (n_p_203574 * s_n_m_203726),\n                            ",
                   "                    s_n_m_203726) * s_n_m_203726 +\n                                        (sext_i32_i64(virt_group_id_233229) *\n                                         squot64(segred_group_sizze_212159,\n                                                 segment_sizze_nonzzero_233218) +\n                                         sext_i32_i64(local_tid_233221) -\n                                         squot64(sext_i32_i64(virt_group_id_233229) *\n                                                 squot64(segred_group_sizze_212159,\n                                                         segment_sizze_nonzzero_233218) +\n                                                 sext_i32_i64(local_tid_233221),\n                                                 n_p_203574 * s_n_m_203726) *\n                                         (n_p_203574 * s_n_m_203726) -\n                                         squot64(sext_i32_i64(virt_group_id_233229) *\n                                                 squot64(segred_group_sizze_212159,\n                                                         segment_sizze_nonzzero_233218) +\n                                                 sext_i32_i64(local_tid_233221) -\n                                                 squot64(sext_i32_i64(virt_group_id_233229) *\n                                                         squot64(segred_group_sizze_212159,\n                                                                 segment_sizze_nonzzero_233218) +\n                                                         sext_i32_i64(local_tid_233221),\n                                                         n_p_203574 *\n                                                         s_n_m_203726) *\n                                                 (n_p_203574 * s_n_m_203726),\n                                                 s_n_m_203726) *\n                                         s_n_m_203726)] = tmp_233248;\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_212159\n}\n__kernel void mainzisegred_small_214227(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233474_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233472_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233470_backing_aligned_2,\n                                        int64_t n_p_203574, int64_t q_s_203575,\n                                        int64_t partition_sizze_203667,\n                                        int64_t defunc_0_f_res_203721,\n                                        int64_t s_n_m_203726,\n                                        int64_t num_groups_214218,\n                                        int64_t segment_sizze_nonzzero_233463,\n                                        __global unsigned char *ext_mem_229372,\n                                        __global unsigned char *ext_mem_229373,\n                                        __global unsigned char *ext_mem_229470,\n                                        __global unsigned char *ext_mem_229471,\n                                        __global unsigned char *mem_229639,\n                                        __global unsigned char *mem_230081,\n                                        __global unsigned char *mem_230091,\n                                        __global unsigned char *mem_230096,\n                                        __global unsigned char *mem_230101)\n{\n    #define segred_group_sizze_214217 (mainzisegred_group_sizze_213183)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_233474_backing_2 =\n    ",
                   "                               (__local volatile\n                                    unsigned char *) red_arr_mem_233474_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_233472_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233472_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_233470_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233470_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233465;\n    int32_t local_tid_233466;\n    int64_t group_sizze_233469;\n    int32_t wave_sizze_233468;\n    int32_t group_tid_233467;\n    \n    global_tid_233465 = get_global_id(0);\n    local_tid_233466 = get_local_id(0);\n    group_sizze_233469 = get_local_size(0);\n    wave_sizze_233468 = LOCKSTEP_WIDTH;\n    group_tid_233467 = get_group_id(0);\n    \n    int32_t phys_tid_214227 = global_tid_233465;\n    __local unsigned char *red_arr_mem_233470;\n    \n    red_arr_mem_233470 = (__local unsigned char *) red_arr_mem_233470_backing_0;\n    \n    __local unsigned char *red_arr_mem_233472;\n    \n    red_arr_mem_233472 = (__local unsigned char *) red_arr_mem_233472_backing_1;\n    \n    __local unsigned char *red_arr_mem_233474;\n    \n    red_arr_mem_233474 = (__local unsigned char *) red_arr_mem_233474_backing_2;\n    \n    int32_t phys_group_id_233476;\n    \n    phys_group_id_233476 = get_group_id(0);\n    for (int32_t i_233477 = 0; i_233477 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * n_p_203574 *\n                                          s_n_m_203726,\n                                          squot64(segred_group_sizze_214217,\n                                                  segment_sizze_nonzzero_233463))) -\n                   phys_group_id_233476, sext_i64_i32(num_groups_214218));\n         i_233477++) {\n        in",
                   "t32_t virt_group_id_233478 = phys_group_id_233476 + i_233477 *\n                sext_i64_i32(num_groups_214218);\n        int64_t slice_233479 = s_n_m_203726;\n        int64_t slice_233480 = n_p_203574 * slice_233479;\n        int64_t slice_233481 = partition_sizze_203667 * slice_233480;\n        int64_t gtid_214223 = squot64(squot64(sext_i32_i64(local_tid_233466),\n                                              segment_sizze_nonzzero_233463) +\n                                      sext_i32_i64(virt_group_id_233478) *\n                                      squot64(segred_group_sizze_214217,\n                                              segment_sizze_nonzzero_233463),\n                                      slice_233480);\n        int64_t remnant_233482 = squot64(sext_i32_i64(local_tid_233466),\n                                         segment_sizze_nonzzero_233463) +\n                sext_i32_i64(virt_group_id_233478) *\n                squot64(segred_group_sizze_214217,\n                        segment_sizze_nonzzero_233463) - gtid_214223 *\n                slice_233480;\n        int64_t gtid_214224 = squot64(remnant_233482, slice_233479);\n        int64_t remnant_233483 = remnant_233482 - gtid_214224 * slice_233479;\n        int64_t gtid_214225 = remnant_233483;\n        int64_t remnant_233484 = remnant_233483 - gtid_214225;\n        int64_t gtid_214226 = srem64(sext_i32_i64(local_tid_233466),\n                                     q_s_203575);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_s_203575) && (((slt64(gtid_214223,\n                                                           partition_sizze_203667) &&\n                                                     slt64(gtid_214224,\n                                                           n_p_203574)) &&\n                                                    slt64(gtid_214225,\n                                                          s_n_m_203726)) &&\n                                      ",
                   "             slt64(sext_i32_i64(local_tid_233466),\n                                                         q_s_203575 *\n                                                         squot64(segred_group_sizze_214217,\n                                                                 segment_sizze_nonzzero_233463)))) {\n                int64_t x_214245;\n                \n                x_214245 = ((__global int64_t *) ext_mem_229372)[gtid_214223 *\n                                                                 n_p_203574 +\n                                                                 gtid_214224];\n                \n                int64_t x_214249;\n                \n                x_214249 = ((__global int64_t *) ext_mem_229471)[gtid_214223 *\n                                                                 (s_n_m_203726 *\n                                                                  n_p_203574) +\n                                                                 gtid_214224 *\n                                                                 s_n_m_203726 +\n                                                                 gtid_214225];\n                \n                double x_214250;\n                \n                x_214250 = ((__global double *) ext_mem_229470)[gtid_214223 *\n                                                                (s_n_m_203726 *\n                                                                 n_p_203574) +\n                                                                gtid_214224 *\n                                                                s_n_m_203726 +\n                                                                gtid_214225];\n                \n                int64_t defunc_0_m_fun_res_214251;\n                \n                defunc_0_m_fun_res_214251 = ((__global\n                                              int64_t *) mem_230081)[gtid_214223 *\n                                                                     (s_n_m_203726 *\n      ",
                   "                                                                n_p_203574) +\n                                                                     gtid_214224 *\n                                                                     s_n_m_203726 +\n                                                                     gtid_214225];\n                \n                bool cond_214253 = sle64(x_214245, gtid_214226);\n                int64_t defunc_0_f_res_214254;\n                \n                if (cond_214253) {\n                    defunc_0_f_res_214254 = (int64_t) 0;\n                } else {\n                    int64_t i_214255 = add64(gtid_214226, x_214249);\n                    int64_t defunc_0_add_arg_214256;\n                    \n                    defunc_0_add_arg_214256 = ((__global\n                                                int64_t *) ext_mem_229373)[gtid_214223 *\n                                                                           (defunc_0_f_res_203721 *\n                                                                            n_p_203574) +\n                                                                           gtid_214224 *\n                                                                           defunc_0_f_res_203721 +\n                                                                           i_214255];\n                    \n                    int64_t defunc_1_add_res_214257 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_214256);\n                    \n                    defunc_0_f_res_214254 = defunc_1_add_res_214257;\n                }\n                \n                double defunc_0_f_res_214258;\n                \n                if (cond_214253) {\n                    defunc_0_f_res_214258 = 0.0;\n                } else {\n                    int64_t i_214259 = add64(gtid_214226, x_214249);\n                    double defunc_0_add_arg_214260;\n                    \n                    defunc_0_add_arg_",
                   "214260 = ((__global\n                                                double *) mem_229639)[gtid_214223 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_214224 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_214259];\n                    defunc_0_f_res_214258 = defunc_0_add_arg_214260;\n                }\n                \n                int64_t binop_p_214261 = sub64(defunc_0_f_res_214254,\n                                               defunc_0_m_fun_res_214251);\n                double defunc_0_f_res_214262 = sitofp_i64_f64(binop_p_214261);\n                double abs_res_214263 = fabs(defunc_0_f_res_214262);\n                double tmp1_214264 = abs_res_214263 / x_214250;\n                double x_214265 = tmp1_214264 * tmp1_214264;\n                double y_214266 = tmp1_214264 * x_214265;\n                double tmp2_214267 = 1.0 - y_214266;\n                double x_214268 = tmp2_214267 * tmp2_214267;\n                double tmp3_214269 = tmp2_214267 * x_214268;\n                double w_j_214270 = defunc_0_f_res_214258 * tmp3_214269;\n                double xw_j_214271 = defunc_0_f_res_214262 * w_j_214270;\n                double x2w_j_214272 = defunc_0_f_res_214262 * xw_j_214271;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_233470)[sext_i32_i64(local_tid_233466)] =\n                        w_j_214270;\n                    ((__local\n                      double *) red_arr_mem_233472)[sext_i32_i64(local_tid_233466)] =\n                        xw_j_214271;\n                    ((__local\n     ",
                   "                 double *) red_arr_mem_233474)[sext_i32_i64(local_tid_233466)] =\n                        x2w_j_214272;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_233470)[sext_i32_i64(local_tid_233466)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_233472)[sext_i32_i64(local_tid_233466)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_233474)[sext_i32_i64(local_tid_233466)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_s_203575)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_214228;\n                double x_214229;\n                double x_214230;\n                double x_214231;\n                double x_214232;\n                double x_214233;\n                double x_233485;\n                double x_233486;\n                double x_233487;\n                double x_233488;\n                double x_233489;\n                double x_233490;\n                bool ltid_in_bounds_233494 =\n                     slt64(sext_i32_i64(local_tid_233466), q_s_203575 *\n                           squot64(segred_group_sizze_214217,\n                                   segment_sizze_nonzzero_233463));\n                int32_t skip_threads_233495;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_233494) {\n                        x_214231 = ((volatile __local\n                                     double *) red_arr_mem_233470)[sext_i32_i64(local_tid_233466)];\n                        x_214232 = ((volatile __local\n                                     double *) red_arr_mem_233472)[sext_i32_i64(local_tid_233466)];\n                        x_214233 = ((volatile __local\n                                     double *) red_arr_mem_233474)[sext_i32_i64(",
                   "local_tid_233466)];\n                        if ((local_tid_233466 - squot32(local_tid_233466, 32) *\n                             32) == 0) {\n                            x_214228 = x_214231;\n                            x_214229 = x_214232;\n                            x_214230 = x_214233;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_233495 = 1;\n                    while (slt32(skip_threads_233495, 32)) {\n                        bool thread_active_233496 = sle32(skip_threads_233495,\n                                                          local_tid_233466 -\n                                                          squot32(local_tid_233466,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_233494;\n                        \n                        if (thread_active_233496) {\n                            // read operands\n                            {\n                                x_214228 = ((volatile __local\n                                             double *) red_arr_mem_233470)[sext_i32_i64(local_tid_233466) -\n                                                                           sext_i32_i64(skip_threads_233495)];\n                                x_214229 = ((volatile __local\n                                             double *) red_arr_mem_233472)[sext_i32_i64(local_tid_233466) -\n                                                                           sext_i32_i64(skip_threads_233495)];\n                                x_214230 = ((volatile __local\n                                             double *) red_arr_mem_233474)[sext_i32_i64(local_tid_233466) -\n                                                                           sext_i32_i64(skip_threads_233495)];\n                            }\n                        }\n                        // perform o",
                   "peration\n                        {\n                            bool inactive_233497 =\n                                 slt64(srem64(sext_i32_i64(local_tid_233466),\n                                              q_s_203575),\n                                       sext_i32_i64(local_tid_233466) -\n                                       sext_i32_i64(local_tid_233466 -\n                                       skip_threads_233495));\n                            \n                            if (thread_active_233496 && inactive_233497) {\n                                x_214228 = x_214231;\n                                x_214229 = x_214232;\n                                x_214230 = x_214233;\n                            }\n                            if (thread_active_233496) {\n                                if (!inactive_233497) {\n                                    double defunc_1_op_res_214234 = x_214228 +\n                                           x_214231;\n                                    double defunc_1_op_res_214235 = x_214229 +\n                                           x_214232;\n                                    double defunc_1_op_res_214236 = x_214230 +\n                                           x_214233;\n                                    \n                                    x_214228 = defunc_1_op_res_214234;\n                                    x_214229 = defunc_1_op_res_214235;\n                                    x_214230 = defunc_1_op_res_214236;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_233468, skip_threads_233495)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_233496) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233470)[sext_i32_i64(local_tid_233466",
                   ")] =\n                                    x_214228;\n                                x_214231 = x_214228;\n                                ((volatile __local\n                                  double *) red_arr_mem_233472)[sext_i32_i64(local_tid_233466)] =\n                                    x_214229;\n                                x_214232 = x_214229;\n                                ((volatile __local\n                                  double *) red_arr_mem_233474)[sext_i32_i64(local_tid_233466)] =\n                                    x_214230;\n                                x_214233 = x_214230;\n                            }\n                        }\n                        if (sle32(wave_sizze_233468, skip_threads_233495)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_233495 *= 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_233466 - squot32(local_tid_233466, 32) *\n                         32) == 31 && ltid_in_bounds_233494) {\n                        ((volatile __local\n                          double *) red_arr_mem_233470)[sext_i32_i64(squot32(local_tid_233466,\n                                                                             32))] =\n                            x_214228;\n                        ((volatile __local\n                          double *) red_arr_mem_233472)[sext_i32_i64(squot32(local_tid_233466,\n                                                                             32))] =\n                            x_214229;\n                        ((volatile __local\n                          double *) red_arr_mem_233474)[sext_i32_i64(squot32(local_tid_233466,\n                                                                             32))] =\n                            x_214230;\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_233498;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_233466, 32) == 0 &&\n                            ltid_in_bounds_233494) {\n                            x_233488 = ((volatile __local\n                                         double *) red_arr_mem_233470)[sext_i32_i64(local_tid_233466)];\n                            x_233489 = ((volatile __local\n                                         double *) red_arr_mem_233472)[sext_i32_i64(local_tid_233466)];\n                            x_233490 = ((volatile __local\n                                         double *) red_arr_mem_233474)[sext_i32_i64(local_tid_233466)];\n                            if ((local_tid_233466 - squot32(local_tid_233466,\n                                                            32) * 32) == 0) {\n                                x_233485 = x_233488;\n                                x_233486 = x_233489;\n                                x_233487 = x_233490;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_233498 = 1;\n                        while (slt32(skip_threads_233498, 32)) {\n                            bool thread_active_233499 =\n                                 sle32(skip_threads_233498, local_tid_233466 -\n                                       squot32(local_tid_233466, 32) * 32) &&\n                                 (squot32(local_tid_233466, 32) == 0 &&\n                                  ltid_in_bounds_233494);\n                            \n                            if (thread_active_233499) {\n                                // read operands\n      ",
                   "                          {\n                                    x_233485 = ((volatile __local\n                                                 double *) red_arr_mem_233470)[sext_i32_i64(local_tid_233466) -\n                                                                               sext_i32_i64(skip_threads_233498)];\n                                    x_233486 = ((volatile __local\n                                                 double *) red_arr_mem_233472)[sext_i32_i64(local_tid_233466) -\n                                                                               sext_i32_i64(skip_threads_233498)];\n                                    x_233487 = ((volatile __local\n                                                 double *) red_arr_mem_233474)[sext_i32_i64(local_tid_233466) -\n                                                                               sext_i32_i64(skip_threads_233498)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_233500 =\n                                     slt64(srem64(sext_i32_i64(local_tid_233466 *\n                                                  32 + 32 - 1), q_s_203575),\n                                           sext_i32_i64(local_tid_233466 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_233466 -\n                                                         skip_threads_233498) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_233499 && inactive_233500) {\n                                    x_233485 = x_233488;\n                                    x_233486 = x_233489;\n                                    x_233487 = x_233490;\n                                }\n                                if (thread_active_233499) {\n            ",
                   "                        if (!inactive_233500) {\n                                        double defunc_1_op_res_233491 =\n                                               x_233485 + x_233488;\n                                        double defunc_1_op_res_233492 =\n                                               x_233486 + x_233489;\n                                        double defunc_1_op_res_233493 =\n                                               x_233487 + x_233490;\n                                        \n                                        x_233485 = defunc_1_op_res_233491;\n                                        x_233486 = defunc_1_op_res_233492;\n                                        x_233487 = defunc_1_op_res_233493;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_233468, skip_threads_233498)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_233499) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_233470)[sext_i32_i64(local_tid_233466)] =\n                                        x_233485;\n                                    x_233488 = x_233485;\n                                    ((volatile __local\n                                      double *) red_arr_mem_233472)[sext_i32_i64(local_tid_233466)] =\n                                        x_233486;\n                                    x_233489 = x_233486;\n                                    ((volatile __local\n                                      double *) red_arr_mem_233474)[sext_i32_i64(local_tid_233466)] =\n                                        x_233487;\n                                    x_233490 = x_233487;\n                                }\n                           ",
                   " }\n                            if (sle32(wave_sizze_233468, skip_threads_233498)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_233498 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_233501 = squot32(local_tid_233466, 32) == 0 ||\n                     !ltid_in_bounds_233494;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_233501) {\n                            x_214231 = x_214228;\n                            x_214232 = x_214229;\n                            x_214233 = x_214230;\n                            x_214228 = ((__local\n                                         double *) red_arr_mem_233470)[sext_i32_i64(squot32(local_tid_233466,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_214229 = ((__local\n                                         double *) red_arr_mem_233472)[sext_i32_i64(squot32(local_tid_233466,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_214230 = ((__local\n                                         double *) red_arr_mem_233474)[sext_i32_i64(squot32(local_tid_233466,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                       ",
                   " bool inactive_233502 =\n                             slt64(srem64(sext_i32_i64(local_tid_233466),\n                                          q_s_203575),\n                                   sext_i32_i64(local_tid_233466) -\n                                   sext_i32_i64(squot32(local_tid_233466, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_233501) {\n                            if (inactive_233502) {\n                                x_214228 = x_214231;\n                                x_214229 = x_214232;\n                                x_214230 = x_214233;\n                            }\n                        }\n                        if (!no_carry_in_233501) {\n                            if (!inactive_233502) {\n                                double defunc_1_op_res_214234 = x_214228 +\n                                       x_214231;\n                                double defunc_1_op_res_214235 = x_214229 +\n                                       x_214232;\n                                double defunc_1_op_res_214236 = x_214230 +\n                                       x_214233;\n                                \n                                x_214228 = defunc_1_op_res_214234;\n                                x_214229 = defunc_1_op_res_214235;\n                                x_214230 = defunc_1_op_res_214236;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_233501) {\n                            ((__local\n                              double *) red_arr_mem_233470)[sext_i32_i64(local_tid_233466)] =\n                                x_214228;\n                            ((__local\n                              double *) red_arr_mem_233472)[sext_i32_i64(local_tid_233466)] =\n                                x_214229;\n                            ((__local\n                        ",
                   "      double *) red_arr_mem_233474)[sext_i32_i64(local_tid_233466)] =\n                                x_214230;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_233466, 32) == 0 &&\n                        ltid_in_bounds_233494) {\n                        ((__local\n                          double *) red_arr_mem_233470)[sext_i32_i64(local_tid_233466)] =\n                            x_214231;\n                        ((__local\n                          double *) red_arr_mem_233472)[sext_i32_i64(local_tid_233466)] =\n                            x_214232;\n                        ((__local\n                          double *) red_arr_mem_233474)[sext_i32_i64(local_tid_233466)] =\n                            x_214233;\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_233478) *\n                      squot64(segred_group_sizze_214217,\n                              segment_sizze_nonzzero_233463) +\n                      sext_i32_i64(local_tid_233466), partition_sizze_203667 *\n                      n_p_203574 * s_n_m_203726) &&\n                slt64(sext_i32_i64(local_tid_233466),\n                      squot64(segred_group_sizze_214217,\n                              segment_sizze_nonzzero_233463))) {\n                double tmp_233503;\n                \n                tmp_233503 = ((__local\n                               double *) red_arr_mem_233470)[(sext_i32_i64(local_tid_233466) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233463 -\n                                                             (",
                   "int64_t) 1];\n                ((__global\n                  double *) mem_230091)[squot64(sext_i32_i64(virt_group_id_233478) *\n                                                squot64(segred_group_sizze_214217,\n                                                        segment_sizze_nonzzero_233463) +\n                                                sext_i32_i64(local_tid_233466),\n                                                n_p_203574 * s_n_m_203726) *\n                                        (s_n_m_203726 * n_p_203574) +\n                                        squot64(sext_i32_i64(virt_group_id_233478) *\n                                                squot64(segred_group_sizze_214217,\n                                                        segment_sizze_nonzzero_233463) +\n                                                sext_i32_i64(local_tid_233466) -\n                                                squot64(sext_i32_i64(virt_group_id_233478) *\n                                                        squot64(segred_group_sizze_214217,\n                                                                segment_sizze_nonzzero_233463) +\n                                                        sext_i32_i64(local_tid_233466),\n                                                        n_p_203574 *\n                                                        s_n_m_203726) *\n                                                (n_p_203574 * s_n_m_203726),\n                                                s_n_m_203726) * s_n_m_203726 +\n                                        (sext_i32_i64(virt_group_id_233478) *\n                                         squot64(segred_group_sizze_214217,\n                                                 segment_sizze_nonzzero_233463) +\n                                         sext_i32_i64(local_tid_233466) -\n                                         squot64(sext_i32_i64(virt_group_id_233478) *\n                                                 squot64(segred_group_sizze_",
                   "214217,\n                                                         segment_sizze_nonzzero_233463) +\n                                                 sext_i32_i64(local_tid_233466),\n                                                 n_p_203574 * s_n_m_203726) *\n                                         (n_p_203574 * s_n_m_203726) -\n                                         squot64(sext_i32_i64(virt_group_id_233478) *\n                                                 squot64(segred_group_sizze_214217,\n                                                         segment_sizze_nonzzero_233463) +\n                                                 sext_i32_i64(local_tid_233466) -\n                                                 squot64(sext_i32_i64(virt_group_id_233478) *\n                                                         squot64(segred_group_sizze_214217,\n                                                                 segment_sizze_nonzzero_233463) +\n                                                         sext_i32_i64(local_tid_233466),\n                                                         n_p_203574 *\n                                                         s_n_m_203726) *\n                                                 (n_p_203574 * s_n_m_203726),\n                                                 s_n_m_203726) *\n                                         s_n_m_203726)] = tmp_233503;\n                \n                double tmp_233504;\n                \n                tmp_233504 = ((__local\n                               double *) red_arr_mem_233472)[(sext_i32_i64(local_tid_233466) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233463 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230096)[squot64(sext_i32_i64(virt_group_id_233478) *\n                                         ",
                   "       squot64(segred_group_sizze_214217,\n                                                        segment_sizze_nonzzero_233463) +\n                                                sext_i32_i64(local_tid_233466),\n                                                n_p_203574 * s_n_m_203726) *\n                                        (s_n_m_203726 * n_p_203574) +\n                                        squot64(sext_i32_i64(virt_group_id_233478) *\n                                                squot64(segred_group_sizze_214217,\n                                                        segment_sizze_nonzzero_233463) +\n                                                sext_i32_i64(local_tid_233466) -\n                                                squot64(sext_i32_i64(virt_group_id_233478) *\n                                                        squot64(segred_group_sizze_214217,\n                                                                segment_sizze_nonzzero_233463) +\n                                                        sext_i32_i64(local_tid_233466),\n                                                        n_p_203574 *\n                                                        s_n_m_203726) *\n                                                (n_p_203574 * s_n_m_203726),\n                                                s_n_m_203726) * s_n_m_203726 +\n                                        (sext_i32_i64(virt_group_id_233478) *\n                                         squot64(segred_group_sizze_214217,\n                                                 segment_sizze_nonzzero_233463) +\n                                         sext_i32_i64(local_tid_233466) -\n                                         squot64(sext_i32_i64(virt_group_id_233478) *\n                                                 squot64(segred_group_sizze_214217,\n                                                         segment_sizze_nonzzero_233463) +\n                                                 sext_i32_i64(local_",
                   "tid_233466),\n                                                 n_p_203574 * s_n_m_203726) *\n                                         (n_p_203574 * s_n_m_203726) -\n                                         squot64(sext_i32_i64(virt_group_id_233478) *\n                                                 squot64(segred_group_sizze_214217,\n                                                         segment_sizze_nonzzero_233463) +\n                                                 sext_i32_i64(local_tid_233466) -\n                                                 squot64(sext_i32_i64(virt_group_id_233478) *\n                                                         squot64(segred_group_sizze_214217,\n                                                                 segment_sizze_nonzzero_233463) +\n                                                         sext_i32_i64(local_tid_233466),\n                                                         n_p_203574 *\n                                                         s_n_m_203726) *\n                                                 (n_p_203574 * s_n_m_203726),\n                                                 s_n_m_203726) *\n                                         s_n_m_203726)] = tmp_233504;\n                \n                double tmp_233505;\n                \n                tmp_233505 = ((__local\n                               double *) red_arr_mem_233474)[(sext_i32_i64(local_tid_233466) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233463 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230101)[squot64(sext_i32_i64(virt_group_id_233478) *\n                                                squot64(segred_group_sizze_214217,\n                                                        segment_sizze_nonzzero_233463) +\n                                   ",
                   "             sext_i32_i64(local_tid_233466),\n                                                n_p_203574 * s_n_m_203726) *\n                                        (s_n_m_203726 * n_p_203574) +\n                                        squot64(sext_i32_i64(virt_group_id_233478) *\n                                                squot64(segred_group_sizze_214217,\n                                                        segment_sizze_nonzzero_233463) +\n                                                sext_i32_i64(local_tid_233466) -\n                                                squot64(sext_i32_i64(virt_group_id_233478) *\n                                                        squot64(segred_group_sizze_214217,\n                                                                segment_sizze_nonzzero_233463) +\n                                                        sext_i32_i64(local_tid_233466),\n                                                        n_p_203574 *\n                                                        s_n_m_203726) *\n                                                (n_p_203574 * s_n_m_203726),\n                                                s_n_m_203726) * s_n_m_203726 +\n                                        (sext_i32_i64(virt_group_id_233478) *\n                                         squot64(segred_group_sizze_214217,\n                                                 segment_sizze_nonzzero_233463) +\n                                         sext_i32_i64(local_tid_233466) -\n                                         squot64(sext_i32_i64(virt_group_id_233478) *\n                                                 squot64(segred_group_sizze_214217,\n                                                         segment_sizze_nonzzero_233463) +\n                                                 sext_i32_i64(local_tid_233466),\n                                                 n_p_203574 * s_n_m_203726) *\n                                         (n_p_203574 * s_n_m_203726) -\n    ",
                   "                                     squot64(sext_i32_i64(virt_group_id_233478) *\n                                                 squot64(segred_group_sizze_214217,\n                                                         segment_sizze_nonzzero_233463) +\n                                                 sext_i32_i64(local_tid_233466) -\n                                                 squot64(sext_i32_i64(virt_group_id_233478) *\n                                                         squot64(segred_group_sizze_214217,\n                                                                 segment_sizze_nonzzero_233463) +\n                                                         sext_i32_i64(local_tid_233466),\n                                                         n_p_203574 *\n                                                         s_n_m_203726) *\n                                                 (n_p_203574 * s_n_m_203726),\n                                                 s_n_m_203726) *\n                                         s_n_m_203726)] = tmp_233505;\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_214217\n}\n__kernel void mainzisegred_small_214321(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233588_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233586_backing_aligned_1,\n                                        int64_t n_p_203574, int64_t q_s_203575,\n                                        int64_t partition_sizze_203667,\n                                        int64_t defunc_0_f_res_203721,\n                                        int64_t s_n_m_203726,\n                                        int64_t num_groups_214313,\n                           ",
                   "             int64_t segment_sizze_nonzzero_233579,\n                                        __global unsigned char *ext_mem_229372,\n                                        __global unsigned char *ext_mem_229373,\n                                        __global unsigned char *ext_mem_229470,\n                                        __global unsigned char *ext_mem_229471,\n                                        __global unsigned char *mem_229634,\n                                        __global unsigned char *mem_229639,\n                                        __global unsigned char *mem_230107,\n                                        __global unsigned char *mem_230112,\n                                        __global unsigned char *mem_230117,\n                                        __global unsigned char *mem_230122,\n                                        __global unsigned char *mem_230128,\n                                        __global unsigned char *mem_230133)\n{\n    #define segred_group_sizze_214312 (mainzisegred_group_sizze_213050)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_233588_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233588_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_233586_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233586_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233581;\n    int32_t local_tid_233582;\n    int64_t group_sizze_233585;\n    int32_t wave_sizze_233584;\n    int32_t group_tid_233583;\n    \n    global_tid_233581 = get_global_id(0);\n    local_tid_233582 = get_local_id(0);\n    group_sizze_233585 = get_local_size(0);\n    wave_sizze_233584 = LOCKSTEP_WIDTH;\n    group_tid_233583 = get_gro",
                   "up_id(0);\n    \n    int32_t phys_tid_214321 = global_tid_233581;\n    __local unsigned char *red_arr_mem_233586;\n    \n    red_arr_mem_233586 = (__local unsigned char *) red_arr_mem_233586_backing_0;\n    \n    __local unsigned char *red_arr_mem_233588;\n    \n    red_arr_mem_233588 = (__local unsigned char *) red_arr_mem_233588_backing_1;\n    \n    int32_t phys_group_id_233590;\n    \n    phys_group_id_233590 = get_group_id(0);\n    for (int32_t i_233591 = 0; i_233591 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * n_p_203574 *\n                                          s_n_m_203726,\n                                          squot64(segred_group_sizze_214312,\n                                                  segment_sizze_nonzzero_233579))) -\n                   phys_group_id_233590, sext_i64_i32(num_groups_214313));\n         i_233591++) {\n        int32_t virt_group_id_233592 = phys_group_id_233590 + i_233591 *\n                sext_i64_i32(num_groups_214313);\n        int64_t slice_233593 = s_n_m_203726;\n        int64_t slice_233594 = n_p_203574 * slice_233593;\n        int64_t slice_233595 = partition_sizze_203667 * slice_233594;\n        int64_t gtid_214317 = squot64(squot64(sext_i32_i64(local_tid_233582),\n                                              segment_sizze_nonzzero_233579) +\n                                      sext_i32_i64(virt_group_id_233592) *\n                                      squot64(segred_group_sizze_214312,\n                                              segment_sizze_nonzzero_233579),\n                                      slice_233594);\n        int64_t remnant_233596 = squot64(sext_i32_i64(local_tid_233582),\n                                         segment_sizze_nonzzero_233579) +\n                sext_i32_i64(virt_group_id_233592) *\n                squot64(segred_group_sizze_214312,\n                        segment_sizze_nonzzero_233579) - gtid_214317 *\n                slice_233594;\n        int64_t gtid_214318 = squot64(remnant_233596, sl",
                   "ice_233593);\n        int64_t remnant_233597 = remnant_233596 - gtid_214318 * slice_233593;\n        int64_t gtid_214319 = remnant_233597;\n        int64_t remnant_233598 = remnant_233597 - gtid_214319;\n        int64_t gtid_214320 = srem64(sext_i32_i64(local_tid_233582),\n                                     q_s_203575);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_s_203575) && (((slt64(gtid_214317,\n                                                           partition_sizze_203667) &&\n                                                     slt64(gtid_214318,\n                                                           n_p_203574)) &&\n                                                    slt64(gtid_214319,\n                                                          s_n_m_203726)) &&\n                                                   slt64(sext_i32_i64(local_tid_233582),\n                                                         q_s_203575 *\n                                                         squot64(segred_group_sizze_214312,\n                                                                 segment_sizze_nonzzero_233579)))) {\n                int64_t x_214341;\n                \n                x_214341 = ((__global int64_t *) ext_mem_229372)[gtid_214317 *\n                                                                 n_p_203574 +\n                                                                 gtid_214318];\n                \n                int64_t x_214348;\n                \n                x_214348 = ((__global int64_t *) ext_mem_229471)[gtid_214317 *\n                                                                 (s_n_m_203726 *\n                                                                  n_p_203574) +\n                                                                 gtid_214318 *\n                                                                 s_n_m_203726 +\n                                                             ",
                   "    gtid_214319];\n                \n                double x_214349;\n                \n                x_214349 = ((__global double *) ext_mem_229470)[gtid_214317 *\n                                                                (s_n_m_203726 *\n                                                                 n_p_203574) +\n                                                                gtid_214318 *\n                                                                s_n_m_203726 +\n                                                                gtid_214319];\n                \n                double a11_214350;\n                \n                a11_214350 = ((__global double *) mem_230107)[gtid_214317 *\n                                                              (s_n_m_203726 *\n                                                               n_p_203574) +\n                                                              gtid_214318 *\n                                                              s_n_m_203726 +\n                                                              gtid_214319];\n                \n                double b11_214351;\n                \n                b11_214351 = ((__global double *) mem_230112)[gtid_214317 *\n                                                              (s_n_m_203726 *\n                                                               n_p_203574) +\n                                                              gtid_214318 *\n                                                              s_n_m_203726 +\n                                                              gtid_214319];\n                \n                double c11_214352;\n                \n                c11_214352 = ((__global double *) mem_230117)[gtid_214317 *\n                                                              (s_n_m_203726 *\n                                                               n_p_203574) +\n                                                              gtid_214318 *\n         ",
                   "                                                     s_n_m_203726 +\n                                                              gtid_214319];\n                \n                int64_t defunc_0_m_fun_res_214353;\n                \n                defunc_0_m_fun_res_214353 = ((__global\n                                              int64_t *) mem_230122)[gtid_214317 *\n                                                                     (s_n_m_203726 *\n                                                                      n_p_203574) +\n                                                                     gtid_214318 *\n                                                                     s_n_m_203726 +\n                                                                     gtid_214319];\n                \n                bool cond_214355 = sle64(x_214341, gtid_214320);\n                int64_t defunc_0_f_res_214356;\n                \n                if (cond_214355) {\n                    defunc_0_f_res_214356 = (int64_t) 0;\n                } else {\n                    int64_t i_214357 = add64(gtid_214320, x_214348);\n                    int64_t defunc_0_add_arg_214358;\n                    \n                    defunc_0_add_arg_214358 = ((__global\n                                                int64_t *) ext_mem_229373)[gtid_214317 *\n                                                                           (defunc_0_f_res_203721 *\n                                                                            n_p_203574) +\n                                                                           gtid_214318 *\n                                                                           defunc_0_f_res_203721 +\n                                                                           i_214357];\n                    \n                    int64_t defunc_1_add_res_214359 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_214358);\n                  ",
                   "  \n                    defunc_0_f_res_214356 = defunc_1_add_res_214359;\n                }\n                \n                double defunc_0_f_res_214360;\n                \n                if (cond_214355) {\n                    defunc_0_f_res_214360 = 0.0;\n                } else {\n                    int64_t i_214361 = add64(gtid_214320, x_214348);\n                    double defunc_0_add_arg_214362;\n                    \n                    defunc_0_add_arg_214362 = ((__global\n                                                double *) mem_229639)[gtid_214317 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_214318 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_214361];\n                    defunc_0_f_res_214360 = defunc_0_add_arg_214362;\n                }\n                \n                int64_t binop_p_214363 = sub64(defunc_0_f_res_214356,\n                                               defunc_0_m_fun_res_214353);\n                double defunc_0_f_res_214364 = sitofp_i64_f64(binop_p_214363);\n                double abs_res_214365 = fabs(defunc_0_f_res_214364);\n                double tmp1_214366 = abs_res_214365 / x_214349;\n                double x_214367 = tmp1_214366 * tmp1_214366;\n                double y_214368 = tmp1_214366 * x_214367;\n                double tmp2_214369 = 1.0 - y_214368;\n                double x_214370 = tmp2_214369 * tmp2_214369;\n                double tmp3_214371 = tmp2_214369 * x_214370;\n                double tmp4_214372 = defunc_0_f_res_214360 * tmp3_214371;\n                double defunc_1_f_res_214373 = defunc_0_f_res_214364 *\n                       tmp4_214372;\n                double defunc_0_f_res_214374;\n                \n",
                   "                if (cond_214355) {\n                    defunc_0_f_res_214374 = 0.0;\n                } else {\n                    int64_t i_214375 = add64(gtid_214320, x_214348);\n                    double defunc_0_add_arg_214376;\n                    \n                    defunc_0_add_arg_214376 = ((__global\n                                                double *) mem_229634)[gtid_214317 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_214318 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_214375];\n                    defunc_0_f_res_214374 = defunc_0_add_arg_214376;\n                }\n                \n                double x_214377 = a11_214350 * tmp4_214372;\n                double y_214378 = b11_214351 * defunc_1_f_res_214373;\n                double x_214379 = x_214377 + y_214378;\n                double defunc_9_fit_fun_res_214380 = defunc_0_f_res_214374 *\n                       x_214379;\n                double x_214381 = b11_214351 * tmp4_214372;\n                double y_214382 = c11_214352 * defunc_1_f_res_214373;\n                double x_214383 = x_214381 + y_214382;\n                double defunc_9_slope_fun_res_214384 = defunc_0_f_res_214374 *\n                       x_214383;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_233586)[sext_i32_i64(local_tid_233582)] =\n                        defunc_9_fit_fun_res_214380;\n                    ((__local\n                      double *) red_arr_mem_233588)[sext_i32_i64(local_tid_233582)] =\n                        defunc_9_slope_fun_res_",
                   "214384;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_233586)[sext_i32_i64(local_tid_233582)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_233588)[sext_i32_i64(local_tid_233582)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_s_203575)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_214322;\n                double x_214323;\n                double x_214324;\n                double x_214325;\n                double x_233599;\n                double x_233600;\n                double x_233601;\n                double x_233602;\n                bool ltid_in_bounds_233605 =\n                     slt64(sext_i32_i64(local_tid_233582), q_s_203575 *\n                           squot64(segred_group_sizze_214312,\n                                   segment_sizze_nonzzero_233579));\n                int32_t skip_threads_233606;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_233605) {\n                        x_214324 = ((volatile __local\n                                     double *) red_arr_mem_233586)[sext_i32_i64(local_tid_233582)];\n                        x_214325 = ((volatile __local\n                                     double *) red_arr_mem_233588)[sext_i32_i64(local_tid_233582)];\n                        if ((local_tid_233582 - squot32(local_tid_233582, 32) *\n                             32) == 0) {\n                            x_214322 = x_214324;\n                            x_214323 = x_214325;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_233606 = 1;\n                    while (slt32(skip_threads_233606, 32)) {\n                        bool thread_a",
                   "ctive_233607 = sle32(skip_threads_233606,\n                                                          local_tid_233582 -\n                                                          squot32(local_tid_233582,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_233605;\n                        \n                        if (thread_active_233607) {\n                            // read operands\n                            {\n                                x_214322 = ((volatile __local\n                                             double *) red_arr_mem_233586)[sext_i32_i64(local_tid_233582) -\n                                                                           sext_i32_i64(skip_threads_233606)];\n                                x_214323 = ((volatile __local\n                                             double *) red_arr_mem_233588)[sext_i32_i64(local_tid_233582) -\n                                                                           sext_i32_i64(skip_threads_233606)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_233608 =\n                                 slt64(srem64(sext_i32_i64(local_tid_233582),\n                                              q_s_203575),\n                                       sext_i32_i64(local_tid_233582) -\n                                       sext_i32_i64(local_tid_233582 -\n                                       skip_threads_233606));\n                            \n                            if (thread_active_233607 && inactive_233608) {\n                                x_214322 = x_214324;\n                                x_214323 = x_214325;\n                            }\n                            if (thread_active_233607) {\n                                if (!inactive_233608) {\n                                    double defunc_1_op_res_214326 = x_214322 +\n ",
                   "                                          x_214324;\n                                    double defunc_1_op_res_214327 = x_214323 +\n                                           x_214325;\n                                    \n                                    x_214322 = defunc_1_op_res_214326;\n                                    x_214323 = defunc_1_op_res_214327;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_233584, skip_threads_233606)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_233607) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233586)[sext_i32_i64(local_tid_233582)] =\n                                    x_214322;\n                                x_214324 = x_214322;\n                                ((volatile __local\n                                  double *) red_arr_mem_233588)[sext_i32_i64(local_tid_233582)] =\n                                    x_214323;\n                                x_214325 = x_214323;\n                            }\n                        }\n                        if (sle32(wave_sizze_233584, skip_threads_233606)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_233606 *= 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_233582 - squot32(local_tid_233582, 32) *\n                         32) == 31 && ltid_in_bounds_233605) {\n                        ((volatile __local\n                          double *) red_arr_mem_233586)[sext_i32_i64(squot32(local_tid_233582,\n                                        ",
                   "                                     32))] =\n                            x_214322;\n                        ((volatile __local\n                          double *) red_arr_mem_233588)[sext_i32_i64(squot32(local_tid_233582,\n                                                                             32))] =\n                            x_214323;\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_233609;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_233582, 32) == 0 &&\n                            ltid_in_bounds_233605) {\n                            x_233601 = ((volatile __local\n                                         double *) red_arr_mem_233586)[sext_i32_i64(local_tid_233582)];\n                            x_233602 = ((volatile __local\n                                         double *) red_arr_mem_233588)[sext_i32_i64(local_tid_233582)];\n                            if ((local_tid_233582 - squot32(local_tid_233582,\n                                                            32) * 32) == 0) {\n                                x_233599 = x_233601;\n                                x_233600 = x_233602;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_233609 = 1;\n                        while (slt32(skip_threads_233609, 32)) {\n                            bool thread_active_233610 =\n                                 sle32(skip_threads_233609, local_tid_233582 -\n                                       squot32(local_tid_233582, 32) * 32) &&\n                                 (squot32(local_tid_233582, 32) == 0 &&\n                                  ltid",
                   "_in_bounds_233605);\n                            \n                            if (thread_active_233610) {\n                                // read operands\n                                {\n                                    x_233599 = ((volatile __local\n                                                 double *) red_arr_mem_233586)[sext_i32_i64(local_tid_233582) -\n                                                                               sext_i32_i64(skip_threads_233609)];\n                                    x_233600 = ((volatile __local\n                                                 double *) red_arr_mem_233588)[sext_i32_i64(local_tid_233582) -\n                                                                               sext_i32_i64(skip_threads_233609)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_233611 =\n                                     slt64(srem64(sext_i32_i64(local_tid_233582 *\n                                                  32 + 32 - 1), q_s_203575),\n                                           sext_i32_i64(local_tid_233582 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_233582 -\n                                                         skip_threads_233609) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_233610 && inactive_233611) {\n                                    x_233599 = x_233601;\n                                    x_233600 = x_233602;\n                                }\n                                if (thread_active_233610) {\n                                    if (!inactive_233611) {\n                                        double defunc_1_op_res_233603 =\n                                               x_233599 + x_233601;\n  ",
                   "                                      double defunc_1_op_res_233604 =\n                                               x_233600 + x_233602;\n                                        \n                                        x_233599 = defunc_1_op_res_233603;\n                                        x_233600 = defunc_1_op_res_233604;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_233584, skip_threads_233609)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_233610) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_233586)[sext_i32_i64(local_tid_233582)] =\n                                        x_233599;\n                                    x_233601 = x_233599;\n                                    ((volatile __local\n                                      double *) red_arr_mem_233588)[sext_i32_i64(local_tid_233582)] =\n                                        x_233600;\n                                    x_233602 = x_233600;\n                                }\n                            }\n                            if (sle32(wave_sizze_233584, skip_threads_233609)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_233609 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_233612 = squot32(local_tid_233582, 32) == 0 ||\n                     !ltid_in_bounds_233605;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!n",
                   "o_carry_in_233612) {\n                            x_214324 = x_214322;\n                            x_214325 = x_214323;\n                            x_214322 = ((__local\n                                         double *) red_arr_mem_233586)[sext_i32_i64(squot32(local_tid_233582,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_214323 = ((__local\n                                         double *) red_arr_mem_233588)[sext_i32_i64(squot32(local_tid_233582,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_233613 =\n                             slt64(srem64(sext_i32_i64(local_tid_233582),\n                                          q_s_203575),\n                                   sext_i32_i64(local_tid_233582) -\n                                   sext_i32_i64(squot32(local_tid_233582, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_233612) {\n                            if (inactive_233613) {\n                                x_214322 = x_214324;\n                                x_214323 = x_214325;\n                            }\n                        }\n                        if (!no_carry_in_233612) {\n                            if (!inactive_233613) {\n                                double defunc_1_op_res_214326 = x_214322 +\n                                       x_214324;\n                                double defunc_1_op_res_214327 = x_214323 +\n                                       x_214325;\n                                \n                                x_214322 =",
                   " defunc_1_op_res_214326;\n                                x_214323 = defunc_1_op_res_214327;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_233612) {\n                            ((__local\n                              double *) red_arr_mem_233586)[sext_i32_i64(local_tid_233582)] =\n                                x_214322;\n                            ((__local\n                              double *) red_arr_mem_233588)[sext_i32_i64(local_tid_233582)] =\n                                x_214323;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_233582, 32) == 0 &&\n                        ltid_in_bounds_233605) {\n                        ((__local\n                          double *) red_arr_mem_233586)[sext_i32_i64(local_tid_233582)] =\n                            x_214324;\n                        ((__local\n                          double *) red_arr_mem_233588)[sext_i32_i64(local_tid_233582)] =\n                            x_214325;\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_233592) *\n                      squot64(segred_group_sizze_214312,\n                              segment_sizze_nonzzero_233579) +\n                      sext_i32_i64(local_tid_233582), partition_sizze_203667 *\n                      n_p_203574 * s_n_m_203726) &&\n                slt64(sext_i32_i64(local_tid_233582),\n                      squot64(segred_group_sizze_214312,\n                              segment_sizze_nonzzero_233579))) {\n                double tmp_233614;\n                \n       ",
                   "         tmp_233614 = ((__local\n                               double *) red_arr_mem_233586)[(sext_i32_i64(local_tid_233582) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233579 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230128)[squot64(sext_i32_i64(virt_group_id_233592) *\n                                                squot64(segred_group_sizze_214312,\n                                                        segment_sizze_nonzzero_233579) +\n                                                sext_i32_i64(local_tid_233582),\n                                                n_p_203574 * s_n_m_203726) *\n                                        (s_n_m_203726 * n_p_203574) +\n                                        squot64(sext_i32_i64(virt_group_id_233592) *\n                                                squot64(segred_group_sizze_214312,\n                                                        segment_sizze_nonzzero_233579) +\n                                                sext_i32_i64(local_tid_233582) -\n                                                squot64(sext_i32_i64(virt_group_id_233592) *\n                                                        squot64(segred_group_sizze_214312,\n                                                                segment_sizze_nonzzero_233579) +\n                                                        sext_i32_i64(local_tid_233582),\n                                                        n_p_203574 *\n                                                        s_n_m_203726) *\n                                                (n_p_203574 * s_n_m_203726),\n                                                s_n_m_203726) * s_n_m_203726 +\n                                        (sext_i32_i64(virt_group_id_233592) *\n                                   ",
                   "      squot64(segred_group_sizze_214312,\n                                                 segment_sizze_nonzzero_233579) +\n                                         sext_i32_i64(local_tid_233582) -\n                                         squot64(sext_i32_i64(virt_group_id_233592) *\n                                                 squot64(segred_group_sizze_214312,\n                                                         segment_sizze_nonzzero_233579) +\n                                                 sext_i32_i64(local_tid_233582),\n                                                 n_p_203574 * s_n_m_203726) *\n                                         (n_p_203574 * s_n_m_203726) -\n                                         squot64(sext_i32_i64(virt_group_id_233592) *\n                                                 squot64(segred_group_sizze_214312,\n                                                         segment_sizze_nonzzero_233579) +\n                                                 sext_i32_i64(local_tid_233582) -\n                                                 squot64(sext_i32_i64(virt_group_id_233592) *\n                                                         squot64(segred_group_sizze_214312,\n                                                                 segment_sizze_nonzzero_233579) +\n                                                         sext_i32_i64(local_tid_233582),\n                                                         n_p_203574 *\n                                                         s_n_m_203726) *\n                                                 (n_p_203574 * s_n_m_203726),\n                                                 s_n_m_203726) *\n                                         s_n_m_203726)] = tmp_233614;\n                \n                double tmp_233615;\n                \n                tmp_233615 = ((__local\n                               double *) red_arr_mem_233588)[(sext_i32_i64(local_tid_233582) +\n                                       ",
                   "                       (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233579 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230133)[squot64(sext_i32_i64(virt_group_id_233592) *\n                                                squot64(segred_group_sizze_214312,\n                                                        segment_sizze_nonzzero_233579) +\n                                                sext_i32_i64(local_tid_233582),\n                                                n_p_203574 * s_n_m_203726) *\n                                        (s_n_m_203726 * n_p_203574) +\n                                        squot64(sext_i32_i64(virt_group_id_233592) *\n                                                squot64(segred_group_sizze_214312,\n                                                        segment_sizze_nonzzero_233579) +\n                                                sext_i32_i64(local_tid_233582) -\n                                                squot64(sext_i32_i64(virt_group_id_233592) *\n                                                        squot64(segred_group_sizze_214312,\n                                                                segment_sizze_nonzzero_233579) +\n                                                        sext_i32_i64(local_tid_233582),\n                                                        n_p_203574 *\n                                                        s_n_m_203726) *\n                                                (n_p_203574 * s_n_m_203726),\n                                                s_n_m_203726) * s_n_m_203726 +\n                                        (sext_i32_i64(virt_group_id_233592) *\n                                         squot64(segred_group_sizze_214312,\n                                                 segment_sizze_nonzzero_233579) +\n                                         se",
                   "xt_i32_i64(local_tid_233582) -\n                                         squot64(sext_i32_i64(virt_group_id_233592) *\n                                                 squot64(segred_group_sizze_214312,\n                                                         segment_sizze_nonzzero_233579) +\n                                                 sext_i32_i64(local_tid_233582),\n                                                 n_p_203574 * s_n_m_203726) *\n                                         (n_p_203574 * s_n_m_203726) -\n                                         squot64(sext_i32_i64(virt_group_id_233592) *\n                                                 squot64(segred_group_sizze_214312,\n                                                         segment_sizze_nonzzero_233579) +\n                                                 sext_i32_i64(local_tid_233582) -\n                                                 squot64(sext_i32_i64(virt_group_id_233592) *\n                                                         squot64(segred_group_sizze_214312,\n                                                                 segment_sizze_nonzzero_233579) +\n                                                         sext_i32_i64(local_tid_233582),\n                                                         n_p_203574 *\n                                                         s_n_m_203726) *\n                                                 (n_p_203574 * s_n_m_203726),\n                                                 s_n_m_203726) *\n                                         s_n_m_203726)] = tmp_233615;\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_214312\n}\n__kernel void mainzisegred_small_216874(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233875_backing_aligned_0",
                   ",\n                                        __local volatile\n                                        int64_t *red_arr_mem_233873_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233871_backing_aligned_2,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233869_backing_aligned_3,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233867_backing_aligned_4,\n                                        int64_t n_p_203574, int64_t q_s_203575,\n                                        int64_t partition_sizze_203667,\n                                        int64_t defunc_0_f_res_203721,\n                                        int64_t s_n_m_203726,\n                                        int64_t num_groups_216863,\n                                        int64_t segment_sizze_nonzzero_233860,\n                                        __global unsigned char *ext_mem_229372,\n                                        __global unsigned char *ext_mem_229373,\n                                        __global unsigned char *ext_mem_229470,\n                                        __global unsigned char *ext_mem_229471,\n                                        __global unsigned char *mem_229639,\n                                        __global unsigned char *mem_230420,\n                                        __global unsigned char *mem_230430,\n                                        __global unsigned char *mem_230435,\n                                        __global unsigned char *mem_230440,\n                                        __global unsigned char *mem_230445,\n                                        __global unsigned char *mem_230450)\n{\n    #define segred_group_sizze_216862 (mainzisegred_group_sizze_215602)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n",
                   "    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_233875_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233875_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_233873_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233873_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_233871_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233871_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_233869_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233869_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_233867_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233867_backing_aligned_4;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233862;\n    int32_t local_tid_233863;\n    int64_t group_sizze_233866;\n    int32_t wave_sizze_233865;\n    int32_t group_tid_233864;\n    \n    global_tid_233862 = get_global_id(0);\n    local_tid_233863 = get_local_id(0);\n    group_sizze_233866 = get_local_size(0);\n    wave_sizze_233865 = LOCKSTEP_WIDTH;\n    group_tid_233864 = get_group_id(0);\n    \n    int32_t phys_tid_216874 = global_tid_233862;\n    __local unsigned char *red_arr_mem_233867;\n    \n    red_arr_mem_233867 = (__local unsigned char *) red_arr_mem_233867_backing_0;\n    \n    __local unsigned char *red_arr_mem_233869;\n    \n    red_arr_mem_233869 = (__local unsigned char *) red_arr_mem_233869_backing_1;\n    \n    __local unsigned char *red_arr_mem_233871;\n    \n    red_arr_mem_233871 = (__local unsigned char *) red_arr_mem_2338",
                   "71_backing_2;\n    \n    __local unsigned char *red_arr_mem_233873;\n    \n    red_arr_mem_233873 = (__local unsigned char *) red_arr_mem_233873_backing_3;\n    \n    __local unsigned char *red_arr_mem_233875;\n    \n    red_arr_mem_233875 = (__local unsigned char *) red_arr_mem_233875_backing_4;\n    \n    int32_t phys_group_id_233877;\n    \n    phys_group_id_233877 = get_group_id(0);\n    for (int32_t i_233878 = 0; i_233878 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * n_p_203574 *\n                                          s_n_m_203726,\n                                          squot64(segred_group_sizze_216862,\n                                                  segment_sizze_nonzzero_233860))) -\n                   phys_group_id_233877, sext_i64_i32(num_groups_216863));\n         i_233878++) {\n        int32_t virt_group_id_233879 = phys_group_id_233877 + i_233878 *\n                sext_i64_i32(num_groups_216863);\n        int64_t slice_233880 = s_n_m_203726;\n        int64_t slice_233881 = n_p_203574 * slice_233880;\n        int64_t slice_233882 = partition_sizze_203667 * slice_233881;\n        int64_t gtid_216870 = squot64(squot64(sext_i32_i64(local_tid_233863),\n                                              segment_sizze_nonzzero_233860) +\n                                      sext_i32_i64(virt_group_id_233879) *\n                                      squot64(segred_group_sizze_216862,\n                                              segment_sizze_nonzzero_233860),\n                                      slice_233881);\n        int64_t remnant_233883 = squot64(sext_i32_i64(local_tid_233863),\n                                         segment_sizze_nonzzero_233860) +\n                sext_i32_i64(virt_group_id_233879) *\n                squot64(segred_group_sizze_216862,\n                        segment_sizze_nonzzero_233860) - gtid_216870 *\n                slice_233881;\n        int64_t gtid_216871 = squot64(remnant_233883, slice_233880);\n        int64_t remnant_233884 =",
                   " remnant_233883 - gtid_216871 * slice_233880;\n        int64_t gtid_216872 = remnant_233884;\n        int64_t remnant_233885 = remnant_233884 - gtid_216872;\n        int64_t gtid_216873 = srem64(sext_i32_i64(local_tid_233863),\n                                     q_s_203575);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_s_203575) && (((slt64(gtid_216870,\n                                                           partition_sizze_203667) &&\n                                                     slt64(gtid_216871,\n                                                           n_p_203574)) &&\n                                                    slt64(gtid_216872,\n                                                          s_n_m_203726)) &&\n                                                   slt64(sext_i32_i64(local_tid_233863),\n                                                         q_s_203575 *\n                                                         squot64(segred_group_sizze_216862,\n                                                                 segment_sizze_nonzzero_233860)))) {\n                int64_t x_216898;\n                \n                x_216898 = ((__global int64_t *) ext_mem_229372)[gtid_216870 *\n                                                                 n_p_203574 +\n                                                                 gtid_216871];\n                \n                int64_t x_216902;\n                \n                x_216902 = ((__global int64_t *) ext_mem_229471)[gtid_216870 *\n                                                                 (s_n_m_203726 *\n                                                                  n_p_203574) +\n                                                                 gtid_216871 *\n                                                                 s_n_m_203726 +\n                                                                 gtid_216872];\n                \n          ",
                   "      double x_216903;\n                \n                x_216903 = ((__global double *) ext_mem_229470)[gtid_216870 *\n                                                                (s_n_m_203726 *\n                                                                 n_p_203574) +\n                                                                gtid_216871 *\n                                                                s_n_m_203726 +\n                                                                gtid_216872];\n                \n                int64_t defunc_0_m_fun_res_216904;\n                \n                defunc_0_m_fun_res_216904 = ((__global\n                                              int64_t *) mem_230420)[gtid_216870 *\n                                                                     (s_n_m_203726 *\n                                                                      n_p_203574) +\n                                                                     gtid_216871 *\n                                                                     s_n_m_203726 +\n                                                                     gtid_216872];\n                \n                bool cond_216906 = sle64(x_216898, gtid_216873);\n                int64_t defunc_0_f_res_216907;\n                \n                if (cond_216906) {\n                    defunc_0_f_res_216907 = (int64_t) 0;\n                } else {\n                    int64_t i_216908 = add64(gtid_216873, x_216902);\n                    int64_t defunc_0_add_arg_216909;\n                    \n                    defunc_0_add_arg_216909 = ((__global\n                                                int64_t *) ext_mem_229373)[gtid_216870 *\n                                                                           (defunc_0_f_res_203721 *\n                                                                            n_p_203574) +\n                                                                           gtid_216871 *\n               ",
                   "                                                            defunc_0_f_res_203721 +\n                                                                           i_216908];\n                    \n                    int64_t defunc_1_add_res_216910 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_216909);\n                    \n                    defunc_0_f_res_216907 = defunc_1_add_res_216910;\n                }\n                \n                double defunc_0_f_res_216911;\n                \n                if (cond_216906) {\n                    defunc_0_f_res_216911 = 0.0;\n                } else {\n                    int64_t i_216912 = add64(gtid_216873, x_216902);\n                    double defunc_0_add_arg_216913;\n                    \n                    defunc_0_add_arg_216913 = ((__global\n                                                double *) mem_229639)[gtid_216870 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_216871 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_216912];\n                    defunc_0_f_res_216911 = defunc_0_add_arg_216913;\n                }\n                \n                int64_t binop_p_216914 = sub64(defunc_0_f_res_216907,\n                                               defunc_0_m_fun_res_216904);\n                double defunc_0_f_res_216915 = sitofp_i64_f64(binop_p_216914);\n                double abs_res_216916 = fabs(defunc_0_f_res_216915);\n                double tmp1_216917 = abs_res_216916 / x_216903;\n                double x_216918 = tmp1_216917 * tmp1_216917;\n                double y_216919 = tmp1_216917 * x_216918;\n                double tmp2_216920 = 1.0 - y_216919",
                   ";\n                double x_216921 = tmp2_216920 * tmp2_216920;\n                double tmp3_216922 = tmp2_216920 * x_216921;\n                double w_j_216923 = defunc_0_f_res_216911 * tmp3_216922;\n                double xw_j_216924 = defunc_0_f_res_216915 * w_j_216923;\n                double x2w_j_216925 = defunc_0_f_res_216915 * xw_j_216924;\n                double x3w_j_216926 = defunc_0_f_res_216915 * x2w_j_216925;\n                double x4w_j_216927 = defunc_0_f_res_216915 * x3w_j_216926;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_233867)[sext_i32_i64(local_tid_233863)] =\n                        w_j_216923;\n                    ((__local\n                      double *) red_arr_mem_233869)[sext_i32_i64(local_tid_233863)] =\n                        xw_j_216924;\n                    ((__local\n                      double *) red_arr_mem_233871)[sext_i32_i64(local_tid_233863)] =\n                        x2w_j_216925;\n                    ((__local\n                      double *) red_arr_mem_233873)[sext_i32_i64(local_tid_233863)] =\n                        x3w_j_216926;\n                    ((__local\n                      double *) red_arr_mem_233875)[sext_i32_i64(local_tid_233863)] =\n                        x4w_j_216927;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_233867)[sext_i32_i64(local_tid_233863)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_233869)[sext_i32_i64(local_tid_233863)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_233871)[sext_i32_i64(local_tid_233863)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_233873)[sext_i32_i64(local_tid_233863)] =\n                    0.0;\n                ((__loca",
                   "l\n                  double *) red_arr_mem_233875)[sext_i32_i64(local_tid_233863)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_s_203575)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_216875;\n                double x_216876;\n                double x_216877;\n                double x_216878;\n                double x_216879;\n                double x_216880;\n                double x_216881;\n                double x_216882;\n                double x_216883;\n                double x_216884;\n                double x_233886;\n                double x_233887;\n                double x_233888;\n                double x_233889;\n                double x_233890;\n                double x_233891;\n                double x_233892;\n                double x_233893;\n                double x_233894;\n                double x_233895;\n                bool ltid_in_bounds_233901 =\n                     slt64(sext_i32_i64(local_tid_233863), q_s_203575 *\n                           squot64(segred_group_sizze_216862,\n                                   segment_sizze_nonzzero_233860));\n                int32_t skip_threads_233902;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_233901) {\n                        x_216880 = ((volatile __local\n                                     double *) red_arr_mem_233867)[sext_i32_i64(local_tid_233863)];\n                        x_216881 = ((volatile __local\n                                     double *) red_arr_mem_233869)[sext_i32_i64(local_tid_233863)];\n                        x_216882 = ((volatile __local\n                                     double *) red_arr_mem_233871)[sext_i32_i64(local_tid_233863)];\n                        x_216883 = ((volatile __local\n                                     double *) red_arr_mem_233873)[sext_i32_i64(local_tid_233863)];\n          ",
                   "              x_216884 = ((volatile __local\n                                     double *) red_arr_mem_233875)[sext_i32_i64(local_tid_233863)];\n                        if ((local_tid_233863 - squot32(local_tid_233863, 32) *\n                             32) == 0) {\n                            x_216875 = x_216880;\n                            x_216876 = x_216881;\n                            x_216877 = x_216882;\n                            x_216878 = x_216883;\n                            x_216879 = x_216884;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_233902 = 1;\n                    while (slt32(skip_threads_233902, 32)) {\n                        bool thread_active_233903 = sle32(skip_threads_233902,\n                                                          local_tid_233863 -\n                                                          squot32(local_tid_233863,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_233901;\n                        \n                        if (thread_active_233903) {\n                            // read operands\n                            {\n                                x_216875 = ((volatile __local\n                                             double *) red_arr_mem_233867)[sext_i32_i64(local_tid_233863) -\n                                                                           sext_i32_i64(skip_threads_233902)];\n                                x_216876 = ((volatile __local\n                                             double *) red_arr_mem_233869)[sext_i32_i64(local_tid_233863) -\n                                                                           sext_i32_i64(skip_threads_233902)];\n                                x_216877 = ((volatile __local\n                                             double *) red_arr_mem_233871)[sext_i32_i64(l",
                   "ocal_tid_233863) -\n                                                                           sext_i32_i64(skip_threads_233902)];\n                                x_216878 = ((volatile __local\n                                             double *) red_arr_mem_233873)[sext_i32_i64(local_tid_233863) -\n                                                                           sext_i32_i64(skip_threads_233902)];\n                                x_216879 = ((volatile __local\n                                             double *) red_arr_mem_233875)[sext_i32_i64(local_tid_233863) -\n                                                                           sext_i32_i64(skip_threads_233902)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_233904 =\n                                 slt64(srem64(sext_i32_i64(local_tid_233863),\n                                              q_s_203575),\n                                       sext_i32_i64(local_tid_233863) -\n                                       sext_i32_i64(local_tid_233863 -\n                                       skip_threads_233902));\n                            \n                            if (thread_active_233903 && inactive_233904) {\n                                x_216875 = x_216880;\n                                x_216876 = x_216881;\n                                x_216877 = x_216882;\n                                x_216878 = x_216883;\n                                x_216879 = x_216884;\n                            }\n                            if (thread_active_233903) {\n                                if (!inactive_233904) {\n                                    double defunc_1_op_res_216885 = x_216875 +\n                                           x_216880;\n                                    double defunc_1_op_res_216886 = x_216876 +\n                                           x_216881;\n             ",
                   "                       double defunc_1_op_res_216887 = x_216877 +\n                                           x_216882;\n                                    double defunc_1_op_res_216888 = x_216878 +\n                                           x_216883;\n                                    double defunc_1_op_res_216889 = x_216879 +\n                                           x_216884;\n                                    \n                                    x_216875 = defunc_1_op_res_216885;\n                                    x_216876 = defunc_1_op_res_216886;\n                                    x_216877 = defunc_1_op_res_216887;\n                                    x_216878 = defunc_1_op_res_216888;\n                                    x_216879 = defunc_1_op_res_216889;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_233865, skip_threads_233902)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_233903) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233867)[sext_i32_i64(local_tid_233863)] =\n                                    x_216875;\n                                x_216880 = x_216875;\n                                ((volatile __local\n                                  double *) red_arr_mem_233869)[sext_i32_i64(local_tid_233863)] =\n                                    x_216876;\n                                x_216881 = x_216876;\n                                ((volatile __local\n                                  double *) red_arr_mem_233871)[sext_i32_i64(local_tid_233863)] =\n                                    x_216877;\n                                x_216882 = x_216877;\n                                ((volatile __local\n                                  double *) red_arr_m",
                   "em_233873)[sext_i32_i64(local_tid_233863)] =\n                                    x_216878;\n                                x_216883 = x_216878;\n                                ((volatile __local\n                                  double *) red_arr_mem_233875)[sext_i32_i64(local_tid_233863)] =\n                                    x_216879;\n                                x_216884 = x_216879;\n                            }\n                        }\n                        if (sle32(wave_sizze_233865, skip_threads_233902)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_233902 *= 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_233863 - squot32(local_tid_233863, 32) *\n                         32) == 31 && ltid_in_bounds_233901) {\n                        ((volatile __local\n                          double *) red_arr_mem_233867)[sext_i32_i64(squot32(local_tid_233863,\n                                                                             32))] =\n                            x_216875;\n                        ((volatile __local\n                          double *) red_arr_mem_233869)[sext_i32_i64(squot32(local_tid_233863,\n                                                                             32))] =\n                            x_216876;\n                        ((volatile __local\n                          double *) red_arr_mem_233871)[sext_i32_i64(squot32(local_tid_233863,\n                                                                             32))] =\n                            x_216877;\n                        ((volatile __local\n                          double *) red_arr_mem_233873)[sext_i32_i64(squot32(local_tid_233863,\n                                                                             32))] =\n                ",
                   "            x_216878;\n                        ((volatile __local\n                          double *) red_arr_mem_233875)[sext_i32_i64(squot32(local_tid_233863,\n                                                                             32))] =\n                            x_216879;\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_233905;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_233863, 32) == 0 &&\n                            ltid_in_bounds_233901) {\n                            x_233891 = ((volatile __local\n                                         double *) red_arr_mem_233867)[sext_i32_i64(local_tid_233863)];\n                            x_233892 = ((volatile __local\n                                         double *) red_arr_mem_233869)[sext_i32_i64(local_tid_233863)];\n                            x_233893 = ((volatile __local\n                                         double *) red_arr_mem_233871)[sext_i32_i64(local_tid_233863)];\n                            x_233894 = ((volatile __local\n                                         double *) red_arr_mem_233873)[sext_i32_i64(local_tid_233863)];\n                            x_233895 = ((volatile __local\n                                         double *) red_arr_mem_233875)[sext_i32_i64(local_tid_233863)];\n                            if ((local_tid_233863 - squot32(local_tid_233863,\n                                                            32) * 32) == 0) {\n                                x_233886 = x_233891;\n                                x_233887 = x_233892;\n                                x_233888 = x_233893;\n                                x_233889 = x_233894;\n                                x_233890 = x_233895;\n                     ",
                   "       }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_233905 = 1;\n                        while (slt32(skip_threads_233905, 32)) {\n                            bool thread_active_233906 =\n                                 sle32(skip_threads_233905, local_tid_233863 -\n                                       squot32(local_tid_233863, 32) * 32) &&\n                                 (squot32(local_tid_233863, 32) == 0 &&\n                                  ltid_in_bounds_233901);\n                            \n                            if (thread_active_233906) {\n                                // read operands\n                                {\n                                    x_233886 = ((volatile __local\n                                                 double *) red_arr_mem_233867)[sext_i32_i64(local_tid_233863) -\n                                                                               sext_i32_i64(skip_threads_233905)];\n                                    x_233887 = ((volatile __local\n                                                 double *) red_arr_mem_233869)[sext_i32_i64(local_tid_233863) -\n                                                                               sext_i32_i64(skip_threads_233905)];\n                                    x_233888 = ((volatile __local\n                                                 double *) red_arr_mem_233871)[sext_i32_i64(local_tid_233863) -\n                                                                               sext_i32_i64(skip_threads_233905)];\n                                    x_233889 = ((volatile __local\n                                                 double *) red_arr_mem_233873)[sext_i32_i64(local_tid_233863) -\n                                                                               sext_i32_i64(skip_threads_233905)];\n                                    x_233890 = ((volatil",
                   "e __local\n                                                 double *) red_arr_mem_233875)[sext_i32_i64(local_tid_233863) -\n                                                                               sext_i32_i64(skip_threads_233905)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_233907 =\n                                     slt64(srem64(sext_i32_i64(local_tid_233863 *\n                                                  32 + 32 - 1), q_s_203575),\n                                           sext_i32_i64(local_tid_233863 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_233863 -\n                                                         skip_threads_233905) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_233906 && inactive_233907) {\n                                    x_233886 = x_233891;\n                                    x_233887 = x_233892;\n                                    x_233888 = x_233893;\n                                    x_233889 = x_233894;\n                                    x_233890 = x_233895;\n                                }\n                                if (thread_active_233906) {\n                                    if (!inactive_233907) {\n                                        double defunc_1_op_res_233896 =\n                                               x_233886 + x_233891;\n                                        double defunc_1_op_res_233897 =\n                                               x_233887 + x_233892;\n                                        double defunc_1_op_res_233898 =\n                                               x_233888 + x_233893;\n                                        double defunc_1_op_res_233899 =\n                ",
                   "                               x_233889 + x_233894;\n                                        double defunc_1_op_res_233900 =\n                                               x_233890 + x_233895;\n                                        \n                                        x_233886 = defunc_1_op_res_233896;\n                                        x_233887 = defunc_1_op_res_233897;\n                                        x_233888 = defunc_1_op_res_233898;\n                                        x_233889 = defunc_1_op_res_233899;\n                                        x_233890 = defunc_1_op_res_233900;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_233865, skip_threads_233905)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_233906) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_233867)[sext_i32_i64(local_tid_233863)] =\n                                        x_233886;\n                                    x_233891 = x_233886;\n                                    ((volatile __local\n                                      double *) red_arr_mem_233869)[sext_i32_i64(local_tid_233863)] =\n                                        x_233887;\n                                    x_233892 = x_233887;\n                                    ((volatile __local\n                                      double *) red_arr_mem_233871)[sext_i32_i64(local_tid_233863)] =\n                                        x_233888;\n                                    x_233893 = x_233888;\n                                    ((volatile __local\n                                      double *) red_arr_mem_233873)[sext_i32_i64(local_tid_233863)] =\n                              ",
                   "          x_233889;\n                                    x_233894 = x_233889;\n                                    ((volatile __local\n                                      double *) red_arr_mem_233875)[sext_i32_i64(local_tid_233863)] =\n                                        x_233890;\n                                    x_233895 = x_233890;\n                                }\n                            }\n                            if (sle32(wave_sizze_233865, skip_threads_233905)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_233905 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_233908 = squot32(local_tid_233863, 32) == 0 ||\n                     !ltid_in_bounds_233901;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_233908) {\n                            x_216880 = x_216875;\n                            x_216881 = x_216876;\n                            x_216882 = x_216877;\n                            x_216883 = x_216878;\n                            x_216884 = x_216879;\n                            x_216875 = ((__local\n                                         double *) red_arr_mem_233867)[sext_i32_i64(squot32(local_tid_233863,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_216876 = ((__local\n                                         double *) red_arr_mem_233869)[sext_i32_i64(squot32(local_tid_233863,\n                                                                                            32)) -\n                                                              ",
                   "         (int64_t) 1];\n                            x_216877 = ((__local\n                                         double *) red_arr_mem_233871)[sext_i32_i64(squot32(local_tid_233863,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_216878 = ((__local\n                                         double *) red_arr_mem_233873)[sext_i32_i64(squot32(local_tid_233863,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_216879 = ((__local\n                                         double *) red_arr_mem_233875)[sext_i32_i64(squot32(local_tid_233863,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_233909 =\n                             slt64(srem64(sext_i32_i64(local_tid_233863),\n                                          q_s_203575),\n                                   sext_i32_i64(local_tid_233863) -\n                                   sext_i32_i64(squot32(local_tid_233863, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_233908) {\n                            if (inactive_233909) {\n                                x_216875 = x_216880;\n                                x_216876 = x_216881;\n                                x_216877 = x_216882;\n                                x_216878 = x_216883;\n                                x_216879 = x_216884;\n                            }\n                        }\n                    ",
                   "    if (!no_carry_in_233908) {\n                            if (!inactive_233909) {\n                                double defunc_1_op_res_216885 = x_216875 +\n                                       x_216880;\n                                double defunc_1_op_res_216886 = x_216876 +\n                                       x_216881;\n                                double defunc_1_op_res_216887 = x_216877 +\n                                       x_216882;\n                                double defunc_1_op_res_216888 = x_216878 +\n                                       x_216883;\n                                double defunc_1_op_res_216889 = x_216879 +\n                                       x_216884;\n                                \n                                x_216875 = defunc_1_op_res_216885;\n                                x_216876 = defunc_1_op_res_216886;\n                                x_216877 = defunc_1_op_res_216887;\n                                x_216878 = defunc_1_op_res_216888;\n                                x_216879 = defunc_1_op_res_216889;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_233908) {\n                            ((__local\n                              double *) red_arr_mem_233867)[sext_i32_i64(local_tid_233863)] =\n                                x_216875;\n                            ((__local\n                              double *) red_arr_mem_233869)[sext_i32_i64(local_tid_233863)] =\n                                x_216876;\n                            ((__local\n                              double *) red_arr_mem_233871)[sext_i32_i64(local_tid_233863)] =\n                                x_216877;\n                            ((__local\n                              double *) red_arr_mem_233873)[sext_i32_i64(local_tid_233863)] =\n                                x_216878;\n                            ((__local\n  ",
                   "                            double *) red_arr_mem_233875)[sext_i32_i64(local_tid_233863)] =\n                                x_216879;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_233863, 32) == 0 &&\n                        ltid_in_bounds_233901) {\n                        ((__local\n                          double *) red_arr_mem_233867)[sext_i32_i64(local_tid_233863)] =\n                            x_216880;\n                        ((__local\n                          double *) red_arr_mem_233869)[sext_i32_i64(local_tid_233863)] =\n                            x_216881;\n                        ((__local\n                          double *) red_arr_mem_233871)[sext_i32_i64(local_tid_233863)] =\n                            x_216882;\n                        ((__local\n                          double *) red_arr_mem_233873)[sext_i32_i64(local_tid_233863)] =\n                            x_216883;\n                        ((__local\n                          double *) red_arr_mem_233875)[sext_i32_i64(local_tid_233863)] =\n                            x_216884;\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_233879) *\n                      squot64(segred_group_sizze_216862,\n                              segment_sizze_nonzzero_233860) +\n                      sext_i32_i64(local_tid_233863), partition_sizze_203667 *\n                      n_p_203574 * s_n_m_203726) &&\n                slt64(sext_i32_i64(local_tid_233863),\n                      squot64(segred_group_sizze_216862,\n                              segment_sizze_nonzzero_233860))) {\n                double tmp_233910;\n                \n                tmp_",
                   "233910 = ((__local\n                               double *) red_arr_mem_233867)[(sext_i32_i64(local_tid_233863) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233860 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230430)[squot64(sext_i32_i64(virt_group_id_233879) *\n                                                squot64(segred_group_sizze_216862,\n                                                        segment_sizze_nonzzero_233860) +\n                                                sext_i32_i64(local_tid_233863),\n                                                n_p_203574 * s_n_m_203726) *\n                                        (s_n_m_203726 * n_p_203574) +\n                                        squot64(sext_i32_i64(virt_group_id_233879) *\n                                                squot64(segred_group_sizze_216862,\n                                                        segment_sizze_nonzzero_233860) +\n                                                sext_i32_i64(local_tid_233863) -\n                                                squot64(sext_i32_i64(virt_group_id_233879) *\n                                                        squot64(segred_group_sizze_216862,\n                                                                segment_sizze_nonzzero_233860) +\n                                                        sext_i32_i64(local_tid_233863),\n                                                        n_p_203574 *\n                                                        s_n_m_203726) *\n                                                (n_p_203574 * s_n_m_203726),\n                                                s_n_m_203726) * s_n_m_203726 +\n                                        (sext_i32_i64(virt_group_id_233879) *\n                                         squot64",
                   "(segred_group_sizze_216862,\n                                                 segment_sizze_nonzzero_233860) +\n                                         sext_i32_i64(local_tid_233863) -\n                                         squot64(sext_i32_i64(virt_group_id_233879) *\n                                                 squot64(segred_group_sizze_216862,\n                                                         segment_sizze_nonzzero_233860) +\n                                                 sext_i32_i64(local_tid_233863),\n                                                 n_p_203574 * s_n_m_203726) *\n                                         (n_p_203574 * s_n_m_203726) -\n                                         squot64(sext_i32_i64(virt_group_id_233879) *\n                                                 squot64(segred_group_sizze_216862,\n                                                         segment_sizze_nonzzero_233860) +\n                                                 sext_i32_i64(local_tid_233863) -\n                                                 squot64(sext_i32_i64(virt_group_id_233879) *\n                                                         squot64(segred_group_sizze_216862,\n                                                                 segment_sizze_nonzzero_233860) +\n                                                         sext_i32_i64(local_tid_233863),\n                                                         n_p_203574 *\n                                                         s_n_m_203726) *\n                                                 (n_p_203574 * s_n_m_203726),\n                                                 s_n_m_203726) *\n                                         s_n_m_203726)] = tmp_233910;\n                \n                double tmp_233911;\n                \n                tmp_233911 = ((__local\n                               double *) red_arr_mem_233869)[(sext_i32_i64(local_tid_233863) +\n                                                    ",
                   "          (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233860 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230435)[squot64(sext_i32_i64(virt_group_id_233879) *\n                                                squot64(segred_group_sizze_216862,\n                                                        segment_sizze_nonzzero_233860) +\n                                                sext_i32_i64(local_tid_233863),\n                                                n_p_203574 * s_n_m_203726) *\n                                        (s_n_m_203726 * n_p_203574) +\n                                        squot64(sext_i32_i64(virt_group_id_233879) *\n                                                squot64(segred_group_sizze_216862,\n                                                        segment_sizze_nonzzero_233860) +\n                                                sext_i32_i64(local_tid_233863) -\n                                                squot64(sext_i32_i64(virt_group_id_233879) *\n                                                        squot64(segred_group_sizze_216862,\n                                                                segment_sizze_nonzzero_233860) +\n                                                        sext_i32_i64(local_tid_233863),\n                                                        n_p_203574 *\n                                                        s_n_m_203726) *\n                                                (n_p_203574 * s_n_m_203726),\n                                                s_n_m_203726) * s_n_m_203726 +\n                                        (sext_i32_i64(virt_group_id_233879) *\n                                         squot64(segred_group_sizze_216862,\n                                                 segment_sizze_nonzzero_233860) +\n                                         sext_i32_i64(lo",
                   "cal_tid_233863) -\n                                         squot64(sext_i32_i64(virt_group_id_233879) *\n                                                 squot64(segred_group_sizze_216862,\n                                                         segment_sizze_nonzzero_233860) +\n                                                 sext_i32_i64(local_tid_233863),\n                                                 n_p_203574 * s_n_m_203726) *\n                                         (n_p_203574 * s_n_m_203726) -\n                                         squot64(sext_i32_i64(virt_group_id_233879) *\n                                                 squot64(segred_group_sizze_216862,\n                                                         segment_sizze_nonzzero_233860) +\n                                                 sext_i32_i64(local_tid_233863) -\n                                                 squot64(sext_i32_i64(virt_group_id_233879) *\n                                                         squot64(segred_group_sizze_216862,\n                                                                 segment_sizze_nonzzero_233860) +\n                                                         sext_i32_i64(local_tid_233863),\n                                                         n_p_203574 *\n                                                         s_n_m_203726) *\n                                                 (n_p_203574 * s_n_m_203726),\n                                                 s_n_m_203726) *\n                                         s_n_m_203726)] = tmp_233911;\n                \n                double tmp_233912;\n                \n                tmp_233912 = ((__local\n                               double *) red_arr_mem_233871)[(sext_i32_i64(local_tid_233863) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233860 -\n                                                ",
                   "             (int64_t) 1];\n                ((__global\n                  double *) mem_230440)[squot64(sext_i32_i64(virt_group_id_233879) *\n                                                squot64(segred_group_sizze_216862,\n                                                        segment_sizze_nonzzero_233860) +\n                                                sext_i32_i64(local_tid_233863),\n                                                n_p_203574 * s_n_m_203726) *\n                                        (s_n_m_203726 * n_p_203574) +\n                                        squot64(sext_i32_i64(virt_group_id_233879) *\n                                                squot64(segred_group_sizze_216862,\n                                                        segment_sizze_nonzzero_233860) +\n                                                sext_i32_i64(local_tid_233863) -\n                                                squot64(sext_i32_i64(virt_group_id_233879) *\n                                                        squot64(segred_group_sizze_216862,\n                                                                segment_sizze_nonzzero_233860) +\n                                                        sext_i32_i64(local_tid_233863),\n                                                        n_p_203574 *\n                                                        s_n_m_203726) *\n                                                (n_p_203574 * s_n_m_203726),\n                                                s_n_m_203726) * s_n_m_203726 +\n                                        (sext_i32_i64(virt_group_id_233879) *\n                                         squot64(segred_group_sizze_216862,\n                                                 segment_sizze_nonzzero_233860) +\n                                         sext_i32_i64(local_tid_233863) -\n                                         squot64(sext_i32_i64(virt_group_id_233879) *\n                                                 squot64(segre",
                   "d_group_sizze_216862,\n                                                         segment_sizze_nonzzero_233860) +\n                                                 sext_i32_i64(local_tid_233863),\n                                                 n_p_203574 * s_n_m_203726) *\n                                         (n_p_203574 * s_n_m_203726) -\n                                         squot64(sext_i32_i64(virt_group_id_233879) *\n                                                 squot64(segred_group_sizze_216862,\n                                                         segment_sizze_nonzzero_233860) +\n                                                 sext_i32_i64(local_tid_233863) -\n                                                 squot64(sext_i32_i64(virt_group_id_233879) *\n                                                         squot64(segred_group_sizze_216862,\n                                                                 segment_sizze_nonzzero_233860) +\n                                                         sext_i32_i64(local_tid_233863),\n                                                         n_p_203574 *\n                                                         s_n_m_203726) *\n                                                 (n_p_203574 * s_n_m_203726),\n                                                 s_n_m_203726) *\n                                         s_n_m_203726)] = tmp_233912;\n                \n                double tmp_233913;\n                \n                tmp_233913 = ((__local\n                               double *) red_arr_mem_233873)[(sext_i32_i64(local_tid_233863) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233860 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230445)[squot64(sext_i32_i64(virt_group_id_233879) *\n                           ",
                   "                     squot64(segred_group_sizze_216862,\n                                                        segment_sizze_nonzzero_233860) +\n                                                sext_i32_i64(local_tid_233863),\n                                                n_p_203574 * s_n_m_203726) *\n                                        (s_n_m_203726 * n_p_203574) +\n                                        squot64(sext_i32_i64(virt_group_id_233879) *\n                                                squot64(segred_group_sizze_216862,\n                                                        segment_sizze_nonzzero_233860) +\n                                                sext_i32_i64(local_tid_233863) -\n                                                squot64(sext_i32_i64(virt_group_id_233879) *\n                                                        squot64(segred_group_sizze_216862,\n                                                                segment_sizze_nonzzero_233860) +\n                                                        sext_i32_i64(local_tid_233863),\n                                                        n_p_203574 *\n                                                        s_n_m_203726) *\n                                                (n_p_203574 * s_n_m_203726),\n                                                s_n_m_203726) * s_n_m_203726 +\n                                        (sext_i32_i64(virt_group_id_233879) *\n                                         squot64(segred_group_sizze_216862,\n                                                 segment_sizze_nonzzero_233860) +\n                                         sext_i32_i64(local_tid_233863) -\n                                         squot64(sext_i32_i64(virt_group_id_233879) *\n                                                 squot64(segred_group_sizze_216862,\n                                                         segment_sizze_nonzzero_233860) +\n                                                 sext_",
                   "i32_i64(local_tid_233863),\n                                                 n_p_203574 * s_n_m_203726) *\n                                         (n_p_203574 * s_n_m_203726) -\n                                         squot64(sext_i32_i64(virt_group_id_233879) *\n                                                 squot64(segred_group_sizze_216862,\n                                                         segment_sizze_nonzzero_233860) +\n                                                 sext_i32_i64(local_tid_233863) -\n                                                 squot64(sext_i32_i64(virt_group_id_233879) *\n                                                         squot64(segred_group_sizze_216862,\n                                                                 segment_sizze_nonzzero_233860) +\n                                                         sext_i32_i64(local_tid_233863),\n                                                         n_p_203574 *\n                                                         s_n_m_203726) *\n                                                 (n_p_203574 * s_n_m_203726),\n                                                 s_n_m_203726) *\n                                         s_n_m_203726)] = tmp_233913;\n                \n                double tmp_233914;\n                \n                tmp_233914 = ((__local\n                               double *) red_arr_mem_233875)[(sext_i32_i64(local_tid_233863) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233860 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230450)[squot64(sext_i32_i64(virt_group_id_233879) *\n                                                squot64(segred_group_sizze_216862,\n                                                        segment_sizze_nonzzero_233860) +\n                     ",
                   "                           sext_i32_i64(local_tid_233863),\n                                                n_p_203574 * s_n_m_203726) *\n                                        (s_n_m_203726 * n_p_203574) +\n                                        squot64(sext_i32_i64(virt_group_id_233879) *\n                                                squot64(segred_group_sizze_216862,\n                                                        segment_sizze_nonzzero_233860) +\n                                                sext_i32_i64(local_tid_233863) -\n                                                squot64(sext_i32_i64(virt_group_id_233879) *\n                                                        squot64(segred_group_sizze_216862,\n                                                                segment_sizze_nonzzero_233860) +\n                                                        sext_i32_i64(local_tid_233863),\n                                                        n_p_203574 *\n                                                        s_n_m_203726) *\n                                                (n_p_203574 * s_n_m_203726),\n                                                s_n_m_203726) * s_n_m_203726 +\n                                        (sext_i32_i64(virt_group_id_233879) *\n                                         squot64(segred_group_sizze_216862,\n                                                 segment_sizze_nonzzero_233860) +\n                                         sext_i32_i64(local_tid_233863) -\n                                         squot64(sext_i32_i64(virt_group_id_233879) *\n                                                 squot64(segred_group_sizze_216862,\n                                                         segment_sizze_nonzzero_233860) +\n                                                 sext_i32_i64(local_tid_233863),\n                                                 n_p_203574 * s_n_m_203726) *\n                                         (n_p_203574 * s_n_m_",
                   "203726) -\n                                         squot64(sext_i32_i64(virt_group_id_233879) *\n                                                 squot64(segred_group_sizze_216862,\n                                                         segment_sizze_nonzzero_233860) +\n                                                 sext_i32_i64(local_tid_233863) -\n                                                 squot64(sext_i32_i64(virt_group_id_233879) *\n                                                         squot64(segred_group_sizze_216862,\n                                                                 segment_sizze_nonzzero_233860) +\n                                                         sext_i32_i64(local_tid_233863),\n                                                         n_p_203574 *\n                                                         s_n_m_203726) *\n                                                 (n_p_203574 * s_n_m_203726),\n                                                 s_n_m_203726) *\n                                         s_n_m_203726)] = tmp_233914;\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_216862\n}\n__kernel void mainzisegred_small_216997(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234013_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234011_backing_aligned_1,\n                                        int64_t n_p_203574, int64_t q_s_203575,\n                                        int64_t partition_sizze_203667,\n                                        int64_t defunc_0_f_res_203721,\n                                        int64_t s_n_m_203726,\n                                        int64_t num_groups_216989,\n             ",
                   "                           int64_t segment_sizze_nonzzero_234004,\n                                        __global unsigned char *ext_mem_229372,\n                                        __global unsigned char *ext_mem_229373,\n                                        __global unsigned char *ext_mem_229470,\n                                        __global unsigned char *ext_mem_229471,\n                                        __global unsigned char *mem_229634,\n                                        __global unsigned char *mem_229639,\n                                        __global unsigned char *mem_230456,\n                                        __global unsigned char *mem_230461,\n                                        __global unsigned char *mem_230466,\n                                        __global unsigned char *mem_230471,\n                                        __global unsigned char *mem_230476,\n                                        __global unsigned char *mem_230481,\n                                        __global unsigned char *mem_230487,\n                                        __global unsigned char *mem_230492)\n{\n    #define segred_group_sizze_216988 (mainzisegred_group_sizze_215433)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_234013_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234013_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_234011_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234011_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234006;\n    int32_t local_tid_234007;\n    int64_t group_sizze_234010;\n    int32_t wave_sizze_234009;\n    int32_t group_tid_234008;\n    \n    global_tid_234006 = get_gl",
                   "obal_id(0);\n    local_tid_234007 = get_local_id(0);\n    group_sizze_234010 = get_local_size(0);\n    wave_sizze_234009 = LOCKSTEP_WIDTH;\n    group_tid_234008 = get_group_id(0);\n    \n    int32_t phys_tid_216997 = global_tid_234006;\n    __local unsigned char *red_arr_mem_234011;\n    \n    red_arr_mem_234011 = (__local unsigned char *) red_arr_mem_234011_backing_0;\n    \n    __local unsigned char *red_arr_mem_234013;\n    \n    red_arr_mem_234013 = (__local unsigned char *) red_arr_mem_234013_backing_1;\n    \n    int32_t phys_group_id_234015;\n    \n    phys_group_id_234015 = get_group_id(0);\n    for (int32_t i_234016 = 0; i_234016 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * n_p_203574 *\n                                          s_n_m_203726,\n                                          squot64(segred_group_sizze_216988,\n                                                  segment_sizze_nonzzero_234004))) -\n                   phys_group_id_234015, sext_i64_i32(num_groups_216989));\n         i_234016++) {\n        int32_t virt_group_id_234017 = phys_group_id_234015 + i_234016 *\n                sext_i64_i32(num_groups_216989);\n        int64_t slice_234018 = s_n_m_203726;\n        int64_t slice_234019 = n_p_203574 * slice_234018;\n        int64_t slice_234020 = partition_sizze_203667 * slice_234019;\n        int64_t gtid_216993 = squot64(squot64(sext_i32_i64(local_tid_234007),\n                                              segment_sizze_nonzzero_234004) +\n                                      sext_i32_i64(virt_group_id_234017) *\n                                      squot64(segred_group_sizze_216988,\n                                              segment_sizze_nonzzero_234004),\n                                      slice_234019);\n        int64_t remnant_234021 = squot64(sext_i32_i64(local_tid_234007),\n                                         segment_sizze_nonzzero_234004) +\n                sext_i32_i64(virt_group_id_234017) *\n                squot64(segred_group_sizze",
                   "_216988,\n                        segment_sizze_nonzzero_234004) - gtid_216993 *\n                slice_234019;\n        int64_t gtid_216994 = squot64(remnant_234021, slice_234018);\n        int64_t remnant_234022 = remnant_234021 - gtid_216994 * slice_234018;\n        int64_t gtid_216995 = remnant_234022;\n        int64_t remnant_234023 = remnant_234022 - gtid_216995;\n        int64_t gtid_216996 = srem64(sext_i32_i64(local_tid_234007),\n                                     q_s_203575);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_s_203575) && (((slt64(gtid_216993,\n                                                           partition_sizze_203667) &&\n                                                     slt64(gtid_216994,\n                                                           n_p_203574)) &&\n                                                    slt64(gtid_216995,\n                                                          s_n_m_203726)) &&\n                                                   slt64(sext_i32_i64(local_tid_234007),\n                                                         q_s_203575 *\n                                                         squot64(segred_group_sizze_216988,\n                                                                 segment_sizze_nonzzero_234004)))) {\n                int64_t x_217019;\n                \n                x_217019 = ((__global int64_t *) ext_mem_229372)[gtid_216993 *\n                                                                 n_p_203574 +\n                                                                 gtid_216994];\n                \n                int64_t x_217028;\n                \n                x_217028 = ((__global int64_t *) ext_mem_229471)[gtid_216993 *\n                                                                 (s_n_m_203726 *\n                                                                  n_p_203574) +\n                                                      ",
                   "           gtid_216994 *\n                                                                 s_n_m_203726 +\n                                                                 gtid_216995];\n                \n                double x_217029;\n                \n                x_217029 = ((__global double *) ext_mem_229470)[gtid_216993 *\n                                                                (s_n_m_203726 *\n                                                                 n_p_203574) +\n                                                                gtid_216994 *\n                                                                s_n_m_203726 +\n                                                                gtid_216995];\n                \n                double a12_217030;\n                \n                a12_217030 = ((__global double *) mem_230456)[gtid_216993 *\n                                                              (s_n_m_203726 *\n                                                               n_p_203574) +\n                                                              gtid_216994 *\n                                                              s_n_m_203726 +\n                                                              gtid_216995];\n                \n                double b12_217031;\n                \n                b12_217031 = ((__global double *) mem_230461)[gtid_216993 *\n                                                              (s_n_m_203726 *\n                                                               n_p_203574) +\n                                                              gtid_216994 *\n                                                              s_n_m_203726 +\n                                                              gtid_216995];\n                \n                double c12_217032;\n                \n                c12_217032 = ((__global double *) mem_230466)[gtid_216993 *\n                                                              (s_n_m_20372",
                   "6 *\n                                                               n_p_203574) +\n                                                              gtid_216994 *\n                                                              s_n_m_203726 +\n                                                              gtid_216995];\n                \n                double b2_217033;\n                \n                b2_217033 = ((__global double *) mem_230471)[gtid_216993 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_216994 *\n                                                             s_n_m_203726 +\n                                                             gtid_216995];\n                \n                double c2_217034;\n                \n                c2_217034 = ((__global double *) mem_230476)[gtid_216993 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_216994 *\n                                                             s_n_m_203726 +\n                                                             gtid_216995];\n                \n                int64_t defunc_0_m_fun_res_217035;\n                \n                defunc_0_m_fun_res_217035 = ((__global\n                                              int64_t *) mem_230481)[gtid_216993 *\n                                                                     (s_n_m_203726 *\n                                                                      n_p_203574) +\n                                                                     gtid_216994 *\n                                                                     s_n_m_203726 +\n                                                                     gtid_216995];\n    ",
                   "            \n                bool cond_217037 = sle64(x_217019, gtid_216996);\n                int64_t defunc_0_f_res_217038;\n                \n                if (cond_217037) {\n                    defunc_0_f_res_217038 = (int64_t) 0;\n                } else {\n                    int64_t i_217039 = add64(gtid_216996, x_217028);\n                    int64_t defunc_0_add_arg_217040;\n                    \n                    defunc_0_add_arg_217040 = ((__global\n                                                int64_t *) ext_mem_229373)[gtid_216993 *\n                                                                           (defunc_0_f_res_203721 *\n                                                                            n_p_203574) +\n                                                                           gtid_216994 *\n                                                                           defunc_0_f_res_203721 +\n                                                                           i_217039];\n                    \n                    int64_t defunc_1_add_res_217041 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_217040);\n                    \n                    defunc_0_f_res_217038 = defunc_1_add_res_217041;\n                }\n                \n                double defunc_0_f_res_217042;\n                \n                if (cond_217037) {\n                    defunc_0_f_res_217042 = 0.0;\n                } else {\n                    int64_t i_217043 = add64(gtid_216996, x_217028);\n                    double defunc_0_add_arg_217044;\n                    \n                    defunc_0_add_arg_217044 = ((__global\n                                                double *) mem_229639)[gtid_216993 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                ",
                   "                      gtid_216994 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_217043];\n                    defunc_0_f_res_217042 = defunc_0_add_arg_217044;\n                }\n                \n                int64_t binop_p_217045 = sub64(defunc_0_f_res_217038,\n                                               defunc_0_m_fun_res_217035);\n                double defunc_0_f_res_217046 = sitofp_i64_f64(binop_p_217045);\n                double abs_res_217047 = fabs(defunc_0_f_res_217046);\n                double tmp1_217048 = abs_res_217047 / x_217029;\n                double x_217049 = tmp1_217048 * tmp1_217048;\n                double y_217050 = tmp1_217048 * x_217049;\n                double tmp2_217051 = 1.0 - y_217050;\n                double x_217052 = tmp2_217051 * tmp2_217051;\n                double tmp3_217053 = tmp2_217051 * x_217052;\n                double tmp4_217054 = defunc_0_f_res_217042 * tmp3_217053;\n                double defunc_1_f_res_217055 = defunc_0_f_res_217046 *\n                       tmp4_217054;\n                double defunc_1_f_res_217056 = defunc_0_f_res_217046 *\n                       defunc_1_f_res_217055;\n                double defunc_0_f_res_217057;\n                \n                if (cond_217037) {\n                    defunc_0_f_res_217057 = 0.0;\n                } else {\n                    int64_t i_217058 = add64(gtid_216996, x_217028);\n                    double defunc_0_add_arg_217059;\n                    \n                    defunc_0_add_arg_217059 = ((__global\n                                                double *) mem_229634)[gtid_216993 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_216994 *\n                 ",
                   "                                                     defunc_0_f_res_203721 +\n                                                                      i_217058];\n                    defunc_0_f_res_217057 = defunc_0_add_arg_217059;\n                }\n                \n                double x_217060 = a12_217030 * tmp4_217054;\n                double y_217061 = b12_217031 * defunc_1_f_res_217055;\n                double x_217062 = x_217060 + y_217061;\n                double y_217063 = c12_217032 * defunc_1_f_res_217056;\n                double x_217064 = x_217062 + y_217063;\n                double defunc_9_fit_fun_res_217065 = defunc_0_f_res_217057 *\n                       x_217064;\n                double x_217066 = b12_217031 * tmp4_217054;\n                double y_217067 = b2_217033 * defunc_1_f_res_217055;\n                double x_217068 = x_217066 + y_217067;\n                double y_217069 = c2_217034 * defunc_1_f_res_217056;\n                double x_217070 = x_217068 + y_217069;\n                double defunc_9_slope_fun_res_217071 = defunc_0_f_res_217057 *\n                       x_217070;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_234011)[sext_i32_i64(local_tid_234007)] =\n                        defunc_9_fit_fun_res_217065;\n                    ((__local\n                      double *) red_arr_mem_234013)[sext_i32_i64(local_tid_234007)] =\n                        defunc_9_slope_fun_res_217071;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_234011)[sext_i32_i64(local_tid_234007)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_234013)[sext_i32_i64(local_tid_234007)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_s_203575)) {\n    ",
                   "        // perform segmented scan to imitate reduction\n            {\n                double x_216998;\n                double x_216999;\n                double x_217000;\n                double x_217001;\n                double x_234024;\n                double x_234025;\n                double x_234026;\n                double x_234027;\n                bool ltid_in_bounds_234030 =\n                     slt64(sext_i32_i64(local_tid_234007), q_s_203575 *\n                           squot64(segred_group_sizze_216988,\n                                   segment_sizze_nonzzero_234004));\n                int32_t skip_threads_234031;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_234030) {\n                        x_217000 = ((volatile __local\n                                     double *) red_arr_mem_234011)[sext_i32_i64(local_tid_234007)];\n                        x_217001 = ((volatile __local\n                                     double *) red_arr_mem_234013)[sext_i32_i64(local_tid_234007)];\n                        if ((local_tid_234007 - squot32(local_tid_234007, 32) *\n                             32) == 0) {\n                            x_216998 = x_217000;\n                            x_216999 = x_217001;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_234031 = 1;\n                    while (slt32(skip_threads_234031, 32)) {\n                        bool thread_active_234032 = sle32(skip_threads_234031,\n                                                          local_tid_234007 -\n                                                          squot32(local_tid_234007,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_234030;\n                        \n                        if (thread_active_234032) {\n              ",
                   "              // read operands\n                            {\n                                x_216998 = ((volatile __local\n                                             double *) red_arr_mem_234011)[sext_i32_i64(local_tid_234007) -\n                                                                           sext_i32_i64(skip_threads_234031)];\n                                x_216999 = ((volatile __local\n                                             double *) red_arr_mem_234013)[sext_i32_i64(local_tid_234007) -\n                                                                           sext_i32_i64(skip_threads_234031)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234033 =\n                                 slt64(srem64(sext_i32_i64(local_tid_234007),\n                                              q_s_203575),\n                                       sext_i32_i64(local_tid_234007) -\n                                       sext_i32_i64(local_tid_234007 -\n                                       skip_threads_234031));\n                            \n                            if (thread_active_234032 && inactive_234033) {\n                                x_216998 = x_217000;\n                                x_216999 = x_217001;\n                            }\n                            if (thread_active_234032) {\n                                if (!inactive_234033) {\n                                    double defunc_1_op_res_217002 = x_216998 +\n                                           x_217000;\n                                    double defunc_1_op_res_217003 = x_216999 +\n                                           x_217001;\n                                    \n                                    x_216998 = defunc_1_op_res_217002;\n                                    x_216999 = defunc_1_op_res_217003;\n                                }\n                            ",
                   "}\n                        }\n                        if (sle32(wave_sizze_234009, skip_threads_234031)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234032) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234011)[sext_i32_i64(local_tid_234007)] =\n                                    x_216998;\n                                x_217000 = x_216998;\n                                ((volatile __local\n                                  double *) red_arr_mem_234013)[sext_i32_i64(local_tid_234007)] =\n                                    x_216999;\n                                x_217001 = x_216999;\n                            }\n                        }\n                        if (sle32(wave_sizze_234009, skip_threads_234031)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_234031 *= 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_234007 - squot32(local_tid_234007, 32) *\n                         32) == 31 && ltid_in_bounds_234030) {\n                        ((volatile __local\n                          double *) red_arr_mem_234011)[sext_i32_i64(squot32(local_tid_234007,\n                                                                             32))] =\n                            x_216998;\n                        ((volatile __local\n                          double *) red_arr_mem_234013)[sext_i32_i64(squot32(local_tid_234007,\n                                                                             32))] =\n                            x_216999;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FEN",
                   "CE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_234034;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_234007, 32) == 0 &&\n                            ltid_in_bounds_234030) {\n                            x_234026 = ((volatile __local\n                                         double *) red_arr_mem_234011)[sext_i32_i64(local_tid_234007)];\n                            x_234027 = ((volatile __local\n                                         double *) red_arr_mem_234013)[sext_i32_i64(local_tid_234007)];\n                            if ((local_tid_234007 - squot32(local_tid_234007,\n                                                            32) * 32) == 0) {\n                                x_234024 = x_234026;\n                                x_234025 = x_234027;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_234034 = 1;\n                        while (slt32(skip_threads_234034, 32)) {\n                            bool thread_active_234035 =\n                                 sle32(skip_threads_234034, local_tid_234007 -\n                                       squot32(local_tid_234007, 32) * 32) &&\n                                 (squot32(local_tid_234007, 32) == 0 &&\n                                  ltid_in_bounds_234030);\n                            \n                            if (thread_active_234035) {\n                                // read operands\n                                {\n                                    x_234024 = ((volatile __local\n                                                 double *) red_arr_mem_234011)[sext_i32_i64(local_tid_234007) -\n                                                           ",
                   "                    sext_i32_i64(skip_threads_234034)];\n                                    x_234025 = ((volatile __local\n                                                 double *) red_arr_mem_234013)[sext_i32_i64(local_tid_234007) -\n                                                                               sext_i32_i64(skip_threads_234034)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_234036 =\n                                     slt64(srem64(sext_i32_i64(local_tid_234007 *\n                                                  32 + 32 - 1), q_s_203575),\n                                           sext_i32_i64(local_tid_234007 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_234007 -\n                                                         skip_threads_234034) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_234035 && inactive_234036) {\n                                    x_234024 = x_234026;\n                                    x_234025 = x_234027;\n                                }\n                                if (thread_active_234035) {\n                                    if (!inactive_234036) {\n                                        double defunc_1_op_res_234028 =\n                                               x_234024 + x_234026;\n                                        double defunc_1_op_res_234029 =\n                                               x_234025 + x_234027;\n                                        \n                                        x_234024 = defunc_1_op_res_234028;\n                                        x_234025 = defunc_1_op_res_234029;\n                                    }\n                                }\n                        ",
                   "    }\n                            if (sle32(wave_sizze_234009, skip_threads_234034)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_234035) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_234011)[sext_i32_i64(local_tid_234007)] =\n                                        x_234024;\n                                    x_234026 = x_234024;\n                                    ((volatile __local\n                                      double *) red_arr_mem_234013)[sext_i32_i64(local_tid_234007)] =\n                                        x_234025;\n                                    x_234027 = x_234025;\n                                }\n                            }\n                            if (sle32(wave_sizze_234009, skip_threads_234034)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_234034 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_234037 = squot32(local_tid_234007, 32) == 0 ||\n                     !ltid_in_bounds_234030;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_234037) {\n                            x_217000 = x_216998;\n                            x_217001 = x_216999;\n                            x_216998 = ((__local\n                                         double *) red_arr_mem_234011)[sext_i32_i64(squot32(local_tid_234007,\n                                                                                            32)) -\n                                                ",
                   "                       (int64_t) 1];\n                            x_216999 = ((__local\n                                         double *) red_arr_mem_234013)[sext_i32_i64(squot32(local_tid_234007,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234038 =\n                             slt64(srem64(sext_i32_i64(local_tid_234007),\n                                          q_s_203575),\n                                   sext_i32_i64(local_tid_234007) -\n                                   sext_i32_i64(squot32(local_tid_234007, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_234037) {\n                            if (inactive_234038) {\n                                x_216998 = x_217000;\n                                x_216999 = x_217001;\n                            }\n                        }\n                        if (!no_carry_in_234037) {\n                            if (!inactive_234038) {\n                                double defunc_1_op_res_217002 = x_216998 +\n                                       x_217000;\n                                double defunc_1_op_res_217003 = x_216999 +\n                                       x_217001;\n                                \n                                x_216998 = defunc_1_op_res_217002;\n                                x_216999 = defunc_1_op_res_217003;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_234037) {\n                            ((__local\n                              double *) red_arr_mem_234011)[sext_i32_i64(local_tid_234007)] =\n        ",
                   "                        x_216998;\n                            ((__local\n                              double *) red_arr_mem_234013)[sext_i32_i64(local_tid_234007)] =\n                                x_216999;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_234007, 32) == 0 &&\n                        ltid_in_bounds_234030) {\n                        ((__local\n                          double *) red_arr_mem_234011)[sext_i32_i64(local_tid_234007)] =\n                            x_217000;\n                        ((__local\n                          double *) red_arr_mem_234013)[sext_i32_i64(local_tid_234007)] =\n                            x_217001;\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_234017) *\n                      squot64(segred_group_sizze_216988,\n                              segment_sizze_nonzzero_234004) +\n                      sext_i32_i64(local_tid_234007), partition_sizze_203667 *\n                      n_p_203574 * s_n_m_203726) &&\n                slt64(sext_i32_i64(local_tid_234007),\n                      squot64(segred_group_sizze_216988,\n                              segment_sizze_nonzzero_234004))) {\n                double tmp_234039;\n                \n                tmp_234039 = ((__local\n                               double *) red_arr_mem_234011)[(sext_i32_i64(local_tid_234007) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234004 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *",
                   ") mem_230487)[squot64(sext_i32_i64(virt_group_id_234017) *\n                                                squot64(segred_group_sizze_216988,\n                                                        segment_sizze_nonzzero_234004) +\n                                                sext_i32_i64(local_tid_234007),\n                                                n_p_203574 * s_n_m_203726) *\n                                        (s_n_m_203726 * n_p_203574) +\n                                        squot64(sext_i32_i64(virt_group_id_234017) *\n                                                squot64(segred_group_sizze_216988,\n                                                        segment_sizze_nonzzero_234004) +\n                                                sext_i32_i64(local_tid_234007) -\n                                                squot64(sext_i32_i64(virt_group_id_234017) *\n                                                        squot64(segred_group_sizze_216988,\n                                                                segment_sizze_nonzzero_234004) +\n                                                        sext_i32_i64(local_tid_234007),\n                                                        n_p_203574 *\n                                                        s_n_m_203726) *\n                                                (n_p_203574 * s_n_m_203726),\n                                                s_n_m_203726) * s_n_m_203726 +\n                                        (sext_i32_i64(virt_group_id_234017) *\n                                         squot64(segred_group_sizze_216988,\n                                                 segment_sizze_nonzzero_234004) +\n                                         sext_i32_i64(local_tid_234007) -\n                                         squot64(sext_i32_i64(virt_group_id_234017) *\n                                                 squot64(segred_group_sizze_216988,\n                                                         s",
                   "egment_sizze_nonzzero_234004) +\n                                                 sext_i32_i64(local_tid_234007),\n                                                 n_p_203574 * s_n_m_203726) *\n                                         (n_p_203574 * s_n_m_203726) -\n                                         squot64(sext_i32_i64(virt_group_id_234017) *\n                                                 squot64(segred_group_sizze_216988,\n                                                         segment_sizze_nonzzero_234004) +\n                                                 sext_i32_i64(local_tid_234007) -\n                                                 squot64(sext_i32_i64(virt_group_id_234017) *\n                                                         squot64(segred_group_sizze_216988,\n                                                                 segment_sizze_nonzzero_234004) +\n                                                         sext_i32_i64(local_tid_234007),\n                                                         n_p_203574 *\n                                                         s_n_m_203726) *\n                                                 (n_p_203574 * s_n_m_203726),\n                                                 s_n_m_203726) *\n                                         s_n_m_203726)] = tmp_234039;\n                \n                double tmp_234040;\n                \n                tmp_234040 = ((__local\n                               double *) red_arr_mem_234013)[(sext_i32_i64(local_tid_234007) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234004 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230492)[squot64(sext_i32_i64(virt_group_id_234017) *\n                                                squot64(segred_group_sizze_216988,\n                        ",
                   "                                segment_sizze_nonzzero_234004) +\n                                                sext_i32_i64(local_tid_234007),\n                                                n_p_203574 * s_n_m_203726) *\n                                        (s_n_m_203726 * n_p_203574) +\n                                        squot64(sext_i32_i64(virt_group_id_234017) *\n                                                squot64(segred_group_sizze_216988,\n                                                        segment_sizze_nonzzero_234004) +\n                                                sext_i32_i64(local_tid_234007) -\n                                                squot64(sext_i32_i64(virt_group_id_234017) *\n                                                        squot64(segred_group_sizze_216988,\n                                                                segment_sizze_nonzzero_234004) +\n                                                        sext_i32_i64(local_tid_234007),\n                                                        n_p_203574 *\n                                                        s_n_m_203726) *\n                                                (n_p_203574 * s_n_m_203726),\n                                                s_n_m_203726) * s_n_m_203726 +\n                                        (sext_i32_i64(virt_group_id_234017) *\n                                         squot64(segred_group_sizze_216988,\n                                                 segment_sizze_nonzzero_234004) +\n                                         sext_i32_i64(local_tid_234007) -\n                                         squot64(sext_i32_i64(virt_group_id_234017) *\n                                                 squot64(segred_group_sizze_216988,\n                                                         segment_sizze_nonzzero_234004) +\n                                                 sext_i32_i64(local_tid_234007),\n                                                 n_p_",
                   "203574 * s_n_m_203726) *\n                                         (n_p_203574 * s_n_m_203726) -\n                                         squot64(sext_i32_i64(virt_group_id_234017) *\n                                                 squot64(segred_group_sizze_216988,\n                                                         segment_sizze_nonzzero_234004) +\n                                                 sext_i32_i64(local_tid_234007) -\n                                                 squot64(sext_i32_i64(virt_group_id_234017) *\n                                                         squot64(segred_group_sizze_216988,\n                                                                 segment_sizze_nonzzero_234004) +\n                                                         sext_i32_i64(local_tid_234007),\n                                                         n_p_203574 *\n                                                         s_n_m_203726) *\n                                                 (n_p_203574 * s_n_m_203726),\n                                                 s_n_m_203726) *\n                                         s_n_m_203726)] = tmp_234040;\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_216988\n}\n__kernel void mainzisegred_small_218721(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234218_backing_aligned_0,\n                                        int64_t n_p_203574,\n                                        int64_t partition_sizze_203667,\n                                        int64_t C_len_203724,\n                                        int64_t num_groups_218716,\n                                        int64_t segment_sizze_nonzzero_234211,\n                                        __global unsigned char *mem_230608,\n       ",
                   "                                 __global unsigned char *mem_230619)\n{\n    #define segred_group_sizze_218715 (mainzisegred_group_sizze_218698)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_234218_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234218_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234213;\n    int32_t local_tid_234214;\n    int64_t group_sizze_234217;\n    int32_t wave_sizze_234216;\n    int32_t group_tid_234215;\n    \n    global_tid_234213 = get_global_id(0);\n    local_tid_234214 = get_local_id(0);\n    group_sizze_234217 = get_local_size(0);\n    wave_sizze_234216 = LOCKSTEP_WIDTH;\n    group_tid_234215 = get_group_id(0);\n    \n    int32_t phys_tid_218721 = global_tid_234213;\n    __local unsigned char *red_arr_mem_234218;\n    \n    red_arr_mem_234218 = (__local unsigned char *) red_arr_mem_234218_backing_0;\n    \n    int32_t phys_group_id_234220;\n    \n    phys_group_id_234220 = get_group_id(0);\n    for (int32_t i_234221 = 0; i_234221 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667,\n                                          squot64(segred_group_sizze_218715,\n                                                  segment_sizze_nonzzero_234211))) -\n                   phys_group_id_234220, sext_i64_i32(num_groups_218716));\n         i_234221++) {\n        int32_t virt_group_id_234222 = phys_group_id_234220 + i_234221 *\n                sext_i64_i32(num_groups_218716);\n        int64_t slice_234223 = partition_sizze_203667;\n        int64_t gtid_218719 = squot64(sext_i32_i64(local_tid_234214),\n                                      segment_sizze_nonzzero_234211) +\n                sext_i32_i64(virt_group_id_234222) *\n                squot64(segred_group_sizze_218715,\n                        segment_sizze_nonzzero_234211);\n",
                   "        int64_t remnant_234224 = squot64(sext_i32_i64(local_tid_234214),\n                                         segment_sizze_nonzzero_234211) +\n                sext_i32_i64(virt_group_id_234222) *\n                squot64(segred_group_sizze_218715,\n                        segment_sizze_nonzzero_234211) - gtid_218719;\n        int64_t gtid_218720 = srem64(sext_i32_i64(local_tid_234214),\n                                     n_p_203574);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, n_p_203574) && (slt64(gtid_218719,\n                                                         partition_sizze_203667) &&\n                                                   slt64(sext_i32_i64(local_tid_234214),\n                                                         n_p_203574 *\n                                                         squot64(segred_group_sizze_218715,\n                                                                 segment_sizze_nonzzero_234211)))) {\n                double x_218726;\n                \n                x_218726 = ((__global double *) mem_230608)[gtid_218719 *\n                                                            C_len_203724 +\n                                                            gtid_218720];\n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_234218)[sext_i32_i64(local_tid_234214)] =\n                        x_218726;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_234218)[sext_i32_i64(local_tid_234214)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, n_p_203574)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_218722;\n                double x_218723;\n                double x_2",
                   "34225;\n                double x_234226;\n                bool ltid_in_bounds_234228 =\n                     slt64(sext_i32_i64(local_tid_234214), n_p_203574 *\n                           squot64(segred_group_sizze_218715,\n                                   segment_sizze_nonzzero_234211));\n                int32_t skip_threads_234229;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_234228) {\n                        x_218723 = ((volatile __local\n                                     double *) red_arr_mem_234218)[sext_i32_i64(local_tid_234214)];\n                        if ((local_tid_234214 - squot32(local_tid_234214, 32) *\n                             32) == 0) {\n                            x_218722 = x_218723;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_234229 = 1;\n                    while (slt32(skip_threads_234229, 32)) {\n                        bool thread_active_234230 = sle32(skip_threads_234229,\n                                                          local_tid_234214 -\n                                                          squot32(local_tid_234214,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_234228;\n                        \n                        if (thread_active_234230) {\n                            // read operands\n                            {\n                                x_218722 = ((volatile __local\n                                             double *) red_arr_mem_234218)[sext_i32_i64(local_tid_234214) -\n                                                                           sext_i32_i64(skip_threads_234229)];\n                            }\n                        }\n                        // perform operation\n                        {\n                           ",
                   " bool inactive_234231 =\n                                 slt64(srem64(sext_i32_i64(local_tid_234214),\n                                              n_p_203574),\n                                       sext_i32_i64(local_tid_234214) -\n                                       sext_i32_i64(local_tid_234214 -\n                                       skip_threads_234229));\n                            \n                            if (thread_active_234230 && inactive_234231) {\n                                x_218722 = x_218723;\n                            }\n                            if (thread_active_234230) {\n                                if (!inactive_234231) {\n                                    double defunc_1_op_res_218724 = x_218722 +\n                                           x_218723;\n                                    \n                                    x_218722 = defunc_1_op_res_218724;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_234216, skip_threads_234229)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234230) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234218)[sext_i32_i64(local_tid_234214)] =\n                                    x_218722;\n                                x_218723 = x_218722;\n                            }\n                        }\n                        if (sle32(wave_sizze_234216, skip_threads_234229)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_234229 *= 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_234214 - squot32(local_tid_234214, 32) *\n                         32) == 31 && ltid_in_bounds_234228) {\n                        ((volatile __local\n                          double *) red_arr_mem_234218)[sext_i32_i64(squot32(local_tid_234214,\n                                                                             32))] =\n                            x_218722;\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_234232;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_234214, 32) == 0 &&\n                            ltid_in_bounds_234228) {\n                            x_234226 = ((volatile __local\n                                         double *) red_arr_mem_234218)[sext_i32_i64(local_tid_234214)];\n                            if ((local_tid_234214 - squot32(local_tid_234214,\n                                                            32) * 32) == 0) {\n                                x_234225 = x_234226;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_234232 = 1;\n                        while (slt32(skip_threads_234232, 32)) {\n                            bool thread_active_234233 =\n                                 sle32(skip_threads_234232, local_tid_234214 -\n                                       squot32(local_tid_234214, 32) * 32) &&\n                                 (squot32(local_tid_234214, 32) == 0 &&\n                                  ltid_in_bounds_234228);\n                            \n                            if (thread_active_234233) {\n                                // read operands\n                            ",
                   "    {\n                                    x_234225 = ((volatile __local\n                                                 double *) red_arr_mem_234218)[sext_i32_i64(local_tid_234214) -\n                                                                               sext_i32_i64(skip_threads_234232)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_234234 =\n                                     slt64(srem64(sext_i32_i64(local_tid_234214 *\n                                                  32 + 32 - 1), n_p_203574),\n                                           sext_i32_i64(local_tid_234214 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_234214 -\n                                                         skip_threads_234232) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_234233 && inactive_234234) {\n                                    x_234225 = x_234226;\n                                }\n                                if (thread_active_234233) {\n                                    if (!inactive_234234) {\n                                        double defunc_1_op_res_234227 =\n                                               x_234225 + x_234226;\n                                        \n                                        x_234225 = defunc_1_op_res_234227;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_234216, skip_threads_234232)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_234233) {\n                                // write result\n                                {\n     ",
                   "                               ((volatile __local\n                                      double *) red_arr_mem_234218)[sext_i32_i64(local_tid_234214)] =\n                                        x_234225;\n                                    x_234226 = x_234225;\n                                }\n                            }\n                            if (sle32(wave_sizze_234216, skip_threads_234232)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_234232 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_234235 = squot32(local_tid_234214, 32) == 0 ||\n                     !ltid_in_bounds_234228;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_234235) {\n                            x_218723 = x_218722;\n                            x_218722 = ((__local\n                                         double *) red_arr_mem_234218)[sext_i32_i64(squot32(local_tid_234214,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234236 =\n                             slt64(srem64(sext_i32_i64(local_tid_234214),\n                                          n_p_203574),\n                                   sext_i32_i64(local_tid_234214) -\n                                   sext_i32_i64(squot32(local_tid_234214, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_234235) {\n                            if (inactive_2",
                   "34236) {\n                                x_218722 = x_218723;\n                            }\n                        }\n                        if (!no_carry_in_234235) {\n                            if (!inactive_234236) {\n                                double defunc_1_op_res_218724 = x_218722 +\n                                       x_218723;\n                                \n                                x_218722 = defunc_1_op_res_218724;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_234235) {\n                            ((__local\n                              double *) red_arr_mem_234218)[sext_i32_i64(local_tid_234214)] =\n                                x_218722;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_234214, 32) == 0 &&\n                        ltid_in_bounds_234228) {\n                        ((__local\n                          double *) red_arr_mem_234218)[sext_i32_i64(local_tid_234214)] =\n                            x_218723;\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_234222) *\n                      squot64(segred_group_sizze_218715,\n                              segment_sizze_nonzzero_234211) +\n                      sext_i32_i64(local_tid_234214), partition_sizze_203667) &&\n                slt64(sext_i32_i64(local_tid_234214),\n                      squot64(segred_group_sizze_218715,\n                              segment_sizze_nonzzero_234211))) {\n                double tmp_234237;\n                \n                tmp_234237 = ((__local\n ",
                   "                              double *) red_arr_mem_234218)[(sext_i32_i64(local_tid_234214) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234211 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230619)[sext_i32_i64(virt_group_id_234222) *\n                                        squot64(segred_group_sizze_218715,\n                                                segment_sizze_nonzzero_234211) +\n                                        sext_i32_i64(local_tid_234214)] =\n                    tmp_234237;\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_218715\n}\n__kernel void mainzisegred_small_218852(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234361_backing_aligned_0,\n                                        int64_t n_p_203574,\n                                        int64_t partition_sizze_203667,\n                                        int64_t lifted_single_ma_l_arg_204224,\n                                        int64_t num_groups_218847,\n                                        int64_t segment_sizze_nonzzero_234354,\n                                        __global unsigned char *mem_230625,\n                                        __global unsigned char *mem_230636)\n{\n    #define segred_group_sizze_218846 (mainzisegred_group_sizze_218829)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_234361_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234361_backin",
                   "g_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234356;\n    int32_t local_tid_234357;\n    int64_t group_sizze_234360;\n    int32_t wave_sizze_234359;\n    int32_t group_tid_234358;\n    \n    global_tid_234356 = get_global_id(0);\n    local_tid_234357 = get_local_id(0);\n    group_sizze_234360 = get_local_size(0);\n    wave_sizze_234359 = LOCKSTEP_WIDTH;\n    group_tid_234358 = get_group_id(0);\n    \n    int32_t phys_tid_218852 = global_tid_234356;\n    __local unsigned char *red_arr_mem_234361;\n    \n    red_arr_mem_234361 = (__local unsigned char *) red_arr_mem_234361_backing_0;\n    \n    int32_t phys_group_id_234363;\n    \n    phys_group_id_234363 = get_group_id(0);\n    for (int32_t i_234364 = 0; i_234364 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667,\n                                          squot64(segred_group_sizze_218846,\n                                                  segment_sizze_nonzzero_234354))) -\n                   phys_group_id_234363, sext_i64_i32(num_groups_218847));\n         i_234364++) {\n        int32_t virt_group_id_234365 = phys_group_id_234363 + i_234364 *\n                sext_i64_i32(num_groups_218847);\n        int64_t slice_234366 = partition_sizze_203667;\n        int64_t gtid_218850 = squot64(sext_i32_i64(local_tid_234357),\n                                      segment_sizze_nonzzero_234354) +\n                sext_i32_i64(virt_group_id_234365) *\n                squot64(segred_group_sizze_218846,\n                        segment_sizze_nonzzero_234354);\n        int64_t remnant_234367 = squot64(sext_i32_i64(local_tid_234357),\n                                         segment_sizze_nonzzero_234354) +\n                sext_i32_i64(virt_group_id_234365) *\n                squot64(segred_group_sizze_218846,\n                        segment_sizze_nonzzero_234354) - gtid_218850;\n        int64_t gtid_218851 = srem64(sext_i32_i64(local_tid_234357),\n                                     n_p_203574);\n     ",
                   "   \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, n_p_203574) && (slt64(gtid_218850,\n                                                         partition_sizze_203667) &&\n                                                   slt64(sext_i32_i64(local_tid_234357),\n                                                         n_p_203574 *\n                                                         squot64(segred_group_sizze_218846,\n                                                                 segment_sizze_nonzzero_234354)))) {\n                double x_218857;\n                \n                x_218857 = ((__global double *) mem_230625)[gtid_218850 *\n                                                            lifted_single_ma_l_arg_204224 +\n                                                            gtid_218851];\n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_234361)[sext_i32_i64(local_tid_234357)] =\n                        x_218857;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_234361)[sext_i32_i64(local_tid_234357)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, n_p_203574)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_218853;\n                double x_218854;\n                double x_234368;\n                double x_234369;\n                bool ltid_in_bounds_234371 =\n                     slt64(sext_i32_i64(local_tid_234357), n_p_203574 *\n                           squot64(segred_group_sizze_218846,\n                                   segment_sizze_nonzzero_234354));\n                int32_t skip_threads_234372;\n                \n                // read input for in-block scan\n                {\n             ",
                   "       if (ltid_in_bounds_234371) {\n                        x_218854 = ((volatile __local\n                                     double *) red_arr_mem_234361)[sext_i32_i64(local_tid_234357)];\n                        if ((local_tid_234357 - squot32(local_tid_234357, 32) *\n                             32) == 0) {\n                            x_218853 = x_218854;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_234372 = 1;\n                    while (slt32(skip_threads_234372, 32)) {\n                        bool thread_active_234373 = sle32(skip_threads_234372,\n                                                          local_tid_234357 -\n                                                          squot32(local_tid_234357,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_234371;\n                        \n                        if (thread_active_234373) {\n                            // read operands\n                            {\n                                x_218853 = ((volatile __local\n                                             double *) red_arr_mem_234361)[sext_i32_i64(local_tid_234357) -\n                                                                           sext_i32_i64(skip_threads_234372)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234374 =\n                                 slt64(srem64(sext_i32_i64(local_tid_234357),\n                                              n_p_203574),\n                                       sext_i32_i64(local_tid_234357) -\n                                       sext_i32_i64(local_tid_234357 -\n                                       skip_threads_234372));\n                            \n                            if (t",
                   "hread_active_234373 && inactive_234374) {\n                                x_218853 = x_218854;\n                            }\n                            if (thread_active_234373) {\n                                if (!inactive_234374) {\n                                    double defunc_1_op_res_218855 = x_218853 +\n                                           x_218854;\n                                    \n                                    x_218853 = defunc_1_op_res_218855;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_234359, skip_threads_234372)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234373) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234361)[sext_i32_i64(local_tid_234357)] =\n                                    x_218853;\n                                x_218854 = x_218853;\n                            }\n                        }\n                        if (sle32(wave_sizze_234359, skip_threads_234372)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_234372 *= 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_234357 - squot32(local_tid_234357, 32) *\n                         32) == 31 && ltid_in_bounds_234371) {\n                        ((volatile __local\n                          double *) red_arr_mem_234361)[sext_i32_i64(squot32(local_tid_234357,\n                                                                             32))] =\n                            x_218853;\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_234375;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_234357, 32) == 0 &&\n                            ltid_in_bounds_234371) {\n                            x_234369 = ((volatile __local\n                                         double *) red_arr_mem_234361)[sext_i32_i64(local_tid_234357)];\n                            if ((local_tid_234357 - squot32(local_tid_234357,\n                                                            32) * 32) == 0) {\n                                x_234368 = x_234369;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_234375 = 1;\n                        while (slt32(skip_threads_234375, 32)) {\n                            bool thread_active_234376 =\n                                 sle32(skip_threads_234375, local_tid_234357 -\n                                       squot32(local_tid_234357, 32) * 32) &&\n                                 (squot32(local_tid_234357, 32) == 0 &&\n                                  ltid_in_bounds_234371);\n                            \n                            if (thread_active_234376) {\n                                // read operands\n                                {\n                                    x_234368 = ((volatile __local\n                                                 double *) red_arr_mem_234361)[sext_i32_i64(local_tid_234357) -\n                                                                               sext_i32_i64(skip_threads_234375)];\n                                }\n                            }\n                            // perform operation\n                ",
                   "            {\n                                bool inactive_234377 =\n                                     slt64(srem64(sext_i32_i64(local_tid_234357 *\n                                                  32 + 32 - 1), n_p_203574),\n                                           sext_i32_i64(local_tid_234357 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_234357 -\n                                                         skip_threads_234375) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_234376 && inactive_234377) {\n                                    x_234368 = x_234369;\n                                }\n                                if (thread_active_234376) {\n                                    if (!inactive_234377) {\n                                        double defunc_1_op_res_234370 =\n                                               x_234368 + x_234369;\n                                        \n                                        x_234368 = defunc_1_op_res_234370;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_234359, skip_threads_234375)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_234376) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_234361)[sext_i32_i64(local_tid_234357)] =\n                                        x_234368;\n                                    x_234369 = x_234368;\n                                }\n                            }\n                            if (sle32(wave_sizze_234359, skip_threads_234375)) {\n                        ",
                   "        barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_234375 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_234378 = squot32(local_tid_234357, 32) == 0 ||\n                     !ltid_in_bounds_234371;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_234378) {\n                            x_218854 = x_218853;\n                            x_218853 = ((__local\n                                         double *) red_arr_mem_234361)[sext_i32_i64(squot32(local_tid_234357,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234379 =\n                             slt64(srem64(sext_i32_i64(local_tid_234357),\n                                          n_p_203574),\n                                   sext_i32_i64(local_tid_234357) -\n                                   sext_i32_i64(squot32(local_tid_234357, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_234378) {\n                            if (inactive_234379) {\n                                x_218853 = x_218854;\n                            }\n                        }\n                        if (!no_carry_in_234378) {\n                            if (!inactive_234379) {\n                                double defunc_1_op_res_218855 = x_218853 +\n                                       x_218854;\n                                \n                                x_218853 = defunc_",
                   "1_op_res_218855;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_234378) {\n                            ((__local\n                              double *) red_arr_mem_234361)[sext_i32_i64(local_tid_234357)] =\n                                x_218853;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_234357, 32) == 0 &&\n                        ltid_in_bounds_234371) {\n                        ((__local\n                          double *) red_arr_mem_234361)[sext_i32_i64(local_tid_234357)] =\n                            x_218854;\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_234365) *\n                      squot64(segred_group_sizze_218846,\n                              segment_sizze_nonzzero_234354) +\n                      sext_i32_i64(local_tid_234357), partition_sizze_203667) &&\n                slt64(sext_i32_i64(local_tid_234357),\n                      squot64(segred_group_sizze_218846,\n                              segment_sizze_nonzzero_234354))) {\n                double tmp_234380;\n                \n                tmp_234380 = ((__local\n                               double *) red_arr_mem_234361)[(sext_i32_i64(local_tid_234357) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234354 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230636)[sext_i32_i64(virt_grou",
                   "p_id_234365) *\n                                        squot64(segred_group_sizze_218846,\n                                                segment_sizze_nonzzero_234354) +\n                                        sext_i32_i64(local_tid_234357)] =\n                    tmp_234380;\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_218846\n}\n__kernel void mainzisegred_small_218983(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234504_backing_aligned_0,\n                                        int64_t partition_sizze_203667,\n                                        int64_t dyn_lifted_single_ma_l_arg_204234,\n                                        int64_t num_groups_218978,\n                                        int64_t segment_sizze_nonzzero_234497,\n                                        __global unsigned char *mem_230642,\n                                        __global unsigned char *mem_230653)\n{\n    #define segred_group_sizze_218977 (mainzisegred_group_sizze_218960)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_234504_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234504_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234499;\n    int32_t local_tid_234500;\n    int64_t group_sizze_234503;\n    int32_t wave_sizze_234502;\n    int32_t group_tid_234501;\n    \n    global_tid_234499 = get_global_id(0);\n    local_tid_234500 = get_local_id(0);\n    group_sizze_234503 = get_local_size(0);\n    wave_sizze_234502 = LOCKSTEP_WIDTH;\n    group_tid_234501 = get_group_id(0);\n    \n    int32_t phys_tid_218983 = global_tid_2344",
                   "99;\n    __local unsigned char *red_arr_mem_234504;\n    \n    red_arr_mem_234504 = (__local unsigned char *) red_arr_mem_234504_backing_0;\n    \n    int32_t phys_group_id_234506;\n    \n    phys_group_id_234506 = get_group_id(0);\n    for (int32_t i_234507 = 0; i_234507 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667,\n                                          squot64(segred_group_sizze_218977,\n                                                  segment_sizze_nonzzero_234497))) -\n                   phys_group_id_234506, sext_i64_i32(num_groups_218978));\n         i_234507++) {\n        int32_t virt_group_id_234508 = phys_group_id_234506 + i_234507 *\n                sext_i64_i32(num_groups_218978);\n        int64_t slice_234509 = partition_sizze_203667;\n        int64_t gtid_218981 = squot64(sext_i32_i64(local_tid_234500),\n                                      segment_sizze_nonzzero_234497) +\n                sext_i32_i64(virt_group_id_234508) *\n                squot64(segred_group_sizze_218977,\n                        segment_sizze_nonzzero_234497);\n        int64_t remnant_234510 = squot64(sext_i32_i64(local_tid_234500),\n                                         segment_sizze_nonzzero_234497) +\n                sext_i32_i64(virt_group_id_234508) *\n                squot64(segred_group_sizze_218977,\n                        segment_sizze_nonzzero_234497) - gtid_218981;\n        int64_t gtid_218982 = srem64(sext_i32_i64(local_tid_234500),\n                                     (int64_t) 3);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, (int64_t) 3) && (slt64(gtid_218981,\n                                                          partition_sizze_203667) &&\n                                                    slt64(sext_i32_i64(local_tid_234500),\n                                                          (int64_t) 3 *\n                                                          squot64(segred_group_sizze_218977,\n               ",
                   "                                                   segment_sizze_nonzzero_234497)))) {\n                double x_218988;\n                \n                x_218988 = ((__global double *) mem_230642)[gtid_218981 *\n                                                            dyn_lifted_single_ma_l_arg_204234 +\n                                                            gtid_218982];\n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_234504)[sext_i32_i64(local_tid_234500)] =\n                        x_218988;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_234504)[sext_i32_i64(local_tid_234500)] =\n                    0.0;\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                double x_218984;\n                double x_218985;\n                double x_234511;\n                double x_234512;\n                bool ltid_in_bounds_234514 =\n                     slt64(sext_i32_i64(local_tid_234500), (int64_t) 3 *\n                           squot64(segred_group_sizze_218977,\n                                   segment_sizze_nonzzero_234497));\n                int32_t skip_threads_234515;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_234514) {\n                        x_218985 = ((volatile __local\n                                     double *) red_arr_mem_234504)[sext_i32_i64(local_tid_234500)];\n                        if ((local_tid_234500 - squot32(local_tid_234500, 32) *\n                             32) == 0) {\n                            x_218984 = x_218985;\n                        }\n                    }\n                }\n                // in-block scan (hopefully ",
                   "no barriers needed)\n                {\n                    skip_threads_234515 = 1;\n                    while (slt32(skip_threads_234515, 32)) {\n                        bool thread_active_234516 = sle32(skip_threads_234515,\n                                                          local_tid_234500 -\n                                                          squot32(local_tid_234500,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_234514;\n                        \n                        if (thread_active_234516) {\n                            // read operands\n                            {\n                                x_218984 = ((volatile __local\n                                             double *) red_arr_mem_234504)[sext_i32_i64(local_tid_234500) -\n                                                                           sext_i32_i64(skip_threads_234515)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234517 =\n                                 slt64(srem64(sext_i32_i64(local_tid_234500),\n                                              (int64_t) 3),\n                                       sext_i32_i64(local_tid_234500) -\n                                       sext_i32_i64(local_tid_234500 -\n                                       skip_threads_234515));\n                            \n                            if (thread_active_234516 && inactive_234517) {\n                                x_218984 = x_218985;\n                            }\n                            if (thread_active_234516) {\n                                if (!inactive_234517) {\n                                    double defunc_1_op_res_218986 = x_218984 +\n                                           x_218985;\n                                    \n                                    x_218984 = defunc_1_op_res_",
                   "218986;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_234502, skip_threads_234515)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234516) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234504)[sext_i32_i64(local_tid_234500)] =\n                                    x_218984;\n                                x_218985 = x_218984;\n                            }\n                        }\n                        if (sle32(wave_sizze_234502, skip_threads_234515)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_234515 *= 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_234500 - squot32(local_tid_234500, 32) *\n                         32) == 31 && ltid_in_bounds_234514) {\n                        ((volatile __local\n                          double *) red_arr_mem_234504)[sext_i32_i64(squot32(local_tid_234500,\n                                                                             32))] =\n                            x_218984;\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_234518;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_234500, 32) == 0 &&\n                            ltid_in_bounds_234514) {\n                            x_234512 = ((volatile __loc",
                   "al\n                                         double *) red_arr_mem_234504)[sext_i32_i64(local_tid_234500)];\n                            if ((local_tid_234500 - squot32(local_tid_234500,\n                                                            32) * 32) == 0) {\n                                x_234511 = x_234512;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_234518 = 1;\n                        while (slt32(skip_threads_234518, 32)) {\n                            bool thread_active_234519 =\n                                 sle32(skip_threads_234518, local_tid_234500 -\n                                       squot32(local_tid_234500, 32) * 32) &&\n                                 (squot32(local_tid_234500, 32) == 0 &&\n                                  ltid_in_bounds_234514);\n                            \n                            if (thread_active_234519) {\n                                // read operands\n                                {\n                                    x_234511 = ((volatile __local\n                                                 double *) red_arr_mem_234504)[sext_i32_i64(local_tid_234500) -\n                                                                               sext_i32_i64(skip_threads_234518)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_234520 =\n                                     slt64(srem64(sext_i32_i64(local_tid_234500 *\n                                                  32 + 32 - 1), (int64_t) 3),\n                                           sext_i32_i64(local_tid_234500 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_234500 -\n                               ",
                   "                          skip_threads_234518) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_234519 && inactive_234520) {\n                                    x_234511 = x_234512;\n                                }\n                                if (thread_active_234519) {\n                                    if (!inactive_234520) {\n                                        double defunc_1_op_res_234513 =\n                                               x_234511 + x_234512;\n                                        \n                                        x_234511 = defunc_1_op_res_234513;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_234502, skip_threads_234518)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_234519) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_234504)[sext_i32_i64(local_tid_234500)] =\n                                        x_234511;\n                                    x_234512 = x_234511;\n                                }\n                            }\n                            if (sle32(wave_sizze_234502, skip_threads_234518)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_234518 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_234521 = squot32(local_tid_234500, 32) == 0 ||\n                     !ltid_in_bounds_234514;\n                \n                // carry-in for every block except the first\n              ",
                   "  {\n                    // read operands\n                    {\n                        if (!no_carry_in_234521) {\n                            x_218985 = x_218984;\n                            x_218984 = ((__local\n                                         double *) red_arr_mem_234504)[sext_i32_i64(squot32(local_tid_234500,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234522 =\n                             slt64(srem64(sext_i32_i64(local_tid_234500),\n                                          (int64_t) 3),\n                                   sext_i32_i64(local_tid_234500) -\n                                   sext_i32_i64(squot32(local_tid_234500, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_234521) {\n                            if (inactive_234522) {\n                                x_218984 = x_218985;\n                            }\n                        }\n                        if (!no_carry_in_234521) {\n                            if (!inactive_234522) {\n                                double defunc_1_op_res_218986 = x_218984 +\n                                       x_218985;\n                                \n                                x_218984 = defunc_1_op_res_218986;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_234521) {\n                            ((__local\n                              double *) red_arr_mem_234504)[sext_i32_i64(local_tid_234500)] =\n                                x_218984;\n                        }\n                    }\n                }\n                b",
                   "arrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_234500, 32) == 0 &&\n                        ltid_in_bounds_234514) {\n                        ((__local\n                          double *) red_arr_mem_234504)[sext_i32_i64(local_tid_234500)] =\n                            x_218985;\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_234508) *\n                      squot64(segred_group_sizze_218977,\n                              segment_sizze_nonzzero_234497) +\n                      sext_i32_i64(local_tid_234500), partition_sizze_203667) &&\n                slt64(sext_i32_i64(local_tid_234500),\n                      squot64(segred_group_sizze_218977,\n                              segment_sizze_nonzzero_234497))) {\n                double tmp_234523;\n                \n                tmp_234523 = ((__local\n                               double *) red_arr_mem_234504)[(sext_i32_i64(local_tid_234500) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234497 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230653)[sext_i32_i64(virt_group_id_234508) *\n                                        squot64(segred_group_sizze_218977,\n                                                segment_sizze_nonzzero_234497) +\n                                        sext_i32_i64(local_tid_234500)] =\n                    tmp_234523;\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_218",
                   "977\n}\n__kernel void mainzisegred_small_219605(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234681_backing_aligned_0,\n                                        int64_t n_203572, int64_t q_l_203577,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t l_n_m_203733, int64_t i_203760,\n                                        int64_t num_groups_219599,\n                                        int64_t ctx_param_ext_229596,\n                                        int64_t ctx_param_ext_229597,\n                                        int64_t ctx_param_ext_229599,\n                                        int64_t segment_sizze_nonzzero_234674,\n                                        __global unsigned char *ext_mem_229519,\n                                        __global unsigned char *ext_mem_229520,\n                                        __global\n                                        unsigned char *mem_param_229601,\n                                        __global unsigned char *mem_230704)\n{\n    #define segred_group_sizze_219598 (mainzisegred_group_sizze_219350)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_234681_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234681_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234676;\n    int32_t local_tid_234677;\n    int64_t group_sizze_234680;\n    int32_t wave_sizze_234679;\n    int32_t group_tid_234678;\n    \n    global_tid_234676 = get_global_id(0);\n    local_tid_234677 = get_local_id(0);\n    group_sizze_234680 = get_local_size(0);\n    wave_sizze_234679 = LOCKSTEP_WIDTH;\n   ",
                   " group_tid_234678 = get_group_id(0);\n    \n    int32_t phys_tid_219605 = global_tid_234676;\n    __local unsigned char *red_arr_mem_234681;\n    \n    red_arr_mem_234681 = (__local unsigned char *) red_arr_mem_234681_backing_0;\n    \n    int32_t phys_group_id_234683;\n    \n    phys_group_id_234683 = get_group_id(0);\n    for (int32_t i_234684 = 0; i_234684 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * l_n_m_203733,\n                                          squot64(segred_group_sizze_219598,\n                                                  segment_sizze_nonzzero_234674))) -\n                   phys_group_id_234683, sext_i64_i32(num_groups_219599));\n         i_234684++) {\n        int32_t virt_group_id_234685 = phys_group_id_234683 + i_234684 *\n                sext_i64_i32(num_groups_219599);\n        int64_t slice_234686 = l_n_m_203733;\n        int64_t slice_234687 = partition_sizze_203667 * slice_234686;\n        int64_t gtid_219602 = squot64(squot64(sext_i32_i64(local_tid_234677),\n                                              segment_sizze_nonzzero_234674) +\n                                      sext_i32_i64(virt_group_id_234685) *\n                                      squot64(segred_group_sizze_219598,\n                                              segment_sizze_nonzzero_234674),\n                                      slice_234686);\n        int64_t remnant_234688 = squot64(sext_i32_i64(local_tid_234677),\n                                         segment_sizze_nonzzero_234674) +\n                sext_i32_i64(virt_group_id_234685) *\n                squot64(segred_group_sizze_219598,\n                        segment_sizze_nonzzero_234674) - gtid_219602 *\n                slice_234686;\n        int64_t gtid_219603 = remnant_234688;\n        int64_t remnant_234689 = remnant_234688 - gtid_219603;\n        int64_t gtid_219604 = srem64(sext_i32_i64(local_tid_234677),\n                                     q_l_203577);\n        \n        // apply map function if in bounds\n",
                   "        {\n            if (slt64((int64_t) 0, q_l_203577) && ((slt64(gtid_219602,\n                                                          partition_sizze_203667) &&\n                                                    slt64(gtid_219603,\n                                                          l_n_m_203733)) &&\n                                                   slt64(sext_i32_i64(local_tid_234677),\n                                                         q_l_203577 *\n                                                         squot64(segred_group_sizze_219598,\n                                                                 segment_sizze_nonzzero_234674)))) {\n                int64_t x_219613;\n                \n                x_219613 = ((__global int64_t *) ext_mem_229520)[gtid_219602 *\n                                                                 l_n_m_203733 +\n                                                                 gtid_219603];\n                \n                double x_219614;\n                \n                x_219614 = ((__global double *) ext_mem_229519)[gtid_219602 *\n                                                                l_n_m_203733 +\n                                                                gtid_219603];\n                \n                int64_t binop_y_228780 = mul64(jump_t_203582, gtid_219603);\n                int64_t binop_y_228781 = smin64(i_203760, binop_y_228780);\n                int64_t index_primexp_228782 = add64((int64_t) 1,\n                                                     binop_y_228781);\n                bool cond_219617 = sle64(n_203572, gtid_219604);\n                int64_t defunc_0_f_res_219618;\n                \n                if (cond_219617) {\n                    defunc_0_f_res_219618 = (int64_t) 0;\n                } else {\n                    int64_t i_219619 = add64(gtid_219604, x_219613);\n                    int64_t defunc_1_add_res_219620 = add64((int64_t) 1,\n                                                    ",
                   "        i_219619);\n                    \n                    defunc_0_f_res_219618 = defunc_1_add_res_219620;\n                }\n                \n                double defunc_0_f_res_219621;\n                \n                if (cond_219617) {\n                    defunc_0_f_res_219621 = 0.0;\n                } else {\n                    int64_t i_219622 = add64(gtid_219604, x_219613);\n                    double defunc_0_add_arg_219623;\n                    \n                    defunc_0_add_arg_219623 = ((__global\n                                                double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                            (gtid_219602 *\n                                                                             ctx_param_ext_229597 +\n                                                                             i_219622 *\n                                                                             ctx_param_ext_229599)];\n                    defunc_0_f_res_219621 = defunc_0_add_arg_219623;\n                }\n                \n                int64_t binop_p_219624 = sub64(defunc_0_f_res_219618,\n                                               index_primexp_228782);\n                double defunc_0_f_res_219625 = sitofp_i64_f64(binop_p_219624);\n                double abs_res_219626 = fabs(defunc_0_f_res_219625);\n                double tmp1_219627 = abs_res_219626 / x_219614;\n                double x_219628 = tmp1_219627 * tmp1_219627;\n                double y_219629 = tmp1_219627 * x_219628;\n                double tmp2_219630 = 1.0 - y_219629;\n                double x_219631 = tmp2_219630 * tmp2_219630;\n                double tmp3_219632 = tmp2_219630 * x_219631;\n                double w_j_219633 = defunc_0_f_res_219621 * tmp3_219632;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n            ",
                   "          double *) red_arr_mem_234681)[sext_i32_i64(local_tid_234677)] =\n                        w_j_219633;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_234681)[sext_i32_i64(local_tid_234677)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_l_203577)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_219606;\n                double x_219607;\n                double x_234690;\n                double x_234691;\n                bool ltid_in_bounds_234693 =\n                     slt64(sext_i32_i64(local_tid_234677), q_l_203577 *\n                           squot64(segred_group_sizze_219598,\n                                   segment_sizze_nonzzero_234674));\n                int32_t skip_threads_234694;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_234693) {\n                        x_219607 = ((volatile __local\n                                     double *) red_arr_mem_234681)[sext_i32_i64(local_tid_234677)];\n                        if ((local_tid_234677 - squot32(local_tid_234677, 32) *\n                             32) == 0) {\n                            x_219606 = x_219607;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_234694 = 1;\n                    while (slt32(skip_threads_234694, 32)) {\n                        bool thread_active_234695 = sle32(skip_threads_234694,\n                                                          local_tid_234677 -\n                                                          squot32(local_tid_234677,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_234693;\n                        \n       ",
                   "                 if (thread_active_234695) {\n                            // read operands\n                            {\n                                x_219606 = ((volatile __local\n                                             double *) red_arr_mem_234681)[sext_i32_i64(local_tid_234677) -\n                                                                           sext_i32_i64(skip_threads_234694)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234696 =\n                                 slt64(srem64(sext_i32_i64(local_tid_234677),\n                                              q_l_203577),\n                                       sext_i32_i64(local_tid_234677) -\n                                       sext_i32_i64(local_tid_234677 -\n                                       skip_threads_234694));\n                            \n                            if (thread_active_234695 && inactive_234696) {\n                                x_219606 = x_219607;\n                            }\n                            if (thread_active_234695) {\n                                if (!inactive_234696) {\n                                    double defunc_1_op_res_219608 = x_219606 +\n                                           x_219607;\n                                    \n                                    x_219606 = defunc_1_op_res_219608;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_234679, skip_threads_234694)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234695) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234681)[sext_i32_i64(local_tid_234677)] =\n              ",
                   "                      x_219606;\n                                x_219607 = x_219606;\n                            }\n                        }\n                        if (sle32(wave_sizze_234679, skip_threads_234694)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_234694 *= 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_234677 - squot32(local_tid_234677, 32) *\n                         32) == 31 && ltid_in_bounds_234693) {\n                        ((volatile __local\n                          double *) red_arr_mem_234681)[sext_i32_i64(squot32(local_tid_234677,\n                                                                             32))] =\n                            x_219606;\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_234697;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_234677, 32) == 0 &&\n                            ltid_in_bounds_234693) {\n                            x_234691 = ((volatile __local\n                                         double *) red_arr_mem_234681)[sext_i32_i64(local_tid_234677)];\n                            if ((local_tid_234677 - squot32(local_tid_234677,\n                                                            32) * 32) == 0) {\n                                x_234690 = x_234691;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_234697 = 1;\n               ",
                   "         while (slt32(skip_threads_234697, 32)) {\n                            bool thread_active_234698 =\n                                 sle32(skip_threads_234697, local_tid_234677 -\n                                       squot32(local_tid_234677, 32) * 32) &&\n                                 (squot32(local_tid_234677, 32) == 0 &&\n                                  ltid_in_bounds_234693);\n                            \n                            if (thread_active_234698) {\n                                // read operands\n                                {\n                                    x_234690 = ((volatile __local\n                                                 double *) red_arr_mem_234681)[sext_i32_i64(local_tid_234677) -\n                                                                               sext_i32_i64(skip_threads_234697)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_234699 =\n                                     slt64(srem64(sext_i32_i64(local_tid_234677 *\n                                                  32 + 32 - 1), q_l_203577),\n                                           sext_i32_i64(local_tid_234677 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_234677 -\n                                                         skip_threads_234697) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_234698 && inactive_234699) {\n                                    x_234690 = x_234691;\n                                }\n                                if (thread_active_234698) {\n                                    if (!inactive_234699) {\n                                        double defunc_1_op_res_234692 =\n                                               ",
                   "x_234690 + x_234691;\n                                        \n                                        x_234690 = defunc_1_op_res_234692;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_234679, skip_threads_234697)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_234698) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_234681)[sext_i32_i64(local_tid_234677)] =\n                                        x_234690;\n                                    x_234691 = x_234690;\n                                }\n                            }\n                            if (sle32(wave_sizze_234679, skip_threads_234697)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_234697 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_234700 = squot32(local_tid_234677, 32) == 0 ||\n                     !ltid_in_bounds_234693;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_234700) {\n                            x_219607 = x_219606;\n                            x_219606 = ((__local\n                                         double *) red_arr_mem_234681)[sext_i32_i64(squot32(local_tid_234677,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                 ",
                   "   }\n                    // perform operation\n                    {\n                        bool inactive_234701 =\n                             slt64(srem64(sext_i32_i64(local_tid_234677),\n                                          q_l_203577),\n                                   sext_i32_i64(local_tid_234677) -\n                                   sext_i32_i64(squot32(local_tid_234677, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_234700) {\n                            if (inactive_234701) {\n                                x_219606 = x_219607;\n                            }\n                        }\n                        if (!no_carry_in_234700) {\n                            if (!inactive_234701) {\n                                double defunc_1_op_res_219608 = x_219606 +\n                                       x_219607;\n                                \n                                x_219606 = defunc_1_op_res_219608;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_234700) {\n                            ((__local\n                              double *) red_arr_mem_234681)[sext_i32_i64(local_tid_234677)] =\n                                x_219606;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_234677, 32) == 0 &&\n                        ltid_in_bounds_234693) {\n                        ((__local\n                          double *) red_arr_mem_234681)[sext_i32_i64(local_tid_234677)] =\n                            x_219607;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final va",
                   "lues of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_234685) *\n                      squot64(segred_group_sizze_219598,\n                              segment_sizze_nonzzero_234674) +\n                      sext_i32_i64(local_tid_234677), partition_sizze_203667 *\n                      l_n_m_203733) && slt64(sext_i32_i64(local_tid_234677),\n                                             squot64(segred_group_sizze_219598,\n                                                     segment_sizze_nonzzero_234674))) {\n                double tmp_234702;\n                \n                tmp_234702 = ((__local\n                               double *) red_arr_mem_234681)[(sext_i32_i64(local_tid_234677) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234674 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230704)[squot64(sext_i32_i64(virt_group_id_234685) *\n                                                squot64(segred_group_sizze_219598,\n                                                        segment_sizze_nonzzero_234674) +\n                                                sext_i32_i64(local_tid_234677),\n                                                l_n_m_203733) * l_n_m_203733 +\n                                        (sext_i32_i64(virt_group_id_234685) *\n                                         squot64(segred_group_sizze_219598,\n                                                 segment_sizze_nonzzero_234674) +\n                                         sext_i32_i64(local_tid_234677) -\n                                         squot64(sext_i32_i64(virt_group_id_234685) *\n                                                 squot64(segred_group_sizze_219598,\n                                                         segment_sizze_nonzzero_234674) +\n                          ",
                   "                       sext_i32_i64(local_tid_234677),\n                                                 l_n_m_203733) *\n                                         l_n_m_203733)] = tmp_234702;\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_219598\n}\n__kernel void mainzisegred_small_219654(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234763_backing_aligned_0,\n                                        int64_t n_203572, int64_t q_l_203577,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t l_n_m_203733, int64_t i_203760,\n                                        int64_t num_groups_219648,\n                                        int64_t ctx_param_ext_229596,\n                                        int64_t ctx_param_ext_229597,\n                                        int64_t ctx_param_ext_229599,\n                                        int64_t segment_sizze_nonzzero_234756,\n                                        __global unsigned char *ext_mem_229519,\n                                        __global unsigned char *ext_mem_229520,\n                                        __global\n                                        unsigned char *mem_param_229601,\n                                        __global unsigned char *mem_230659,\n                                        __global unsigned char *mem_230709,\n                                        __global unsigned char *mem_230714)\n{\n    #define segred_group_sizze_219647 (mainzisegred_group_sizze_219283)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_234763_backing_",
                   "0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234763_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234758;\n    int32_t local_tid_234759;\n    int64_t group_sizze_234762;\n    int32_t wave_sizze_234761;\n    int32_t group_tid_234760;\n    \n    global_tid_234758 = get_global_id(0);\n    local_tid_234759 = get_local_id(0);\n    group_sizze_234762 = get_local_size(0);\n    wave_sizze_234761 = LOCKSTEP_WIDTH;\n    group_tid_234760 = get_group_id(0);\n    \n    int32_t phys_tid_219654 = global_tid_234758;\n    __local unsigned char *red_arr_mem_234763;\n    \n    red_arr_mem_234763 = (__local unsigned char *) red_arr_mem_234763_backing_0;\n    \n    int32_t phys_group_id_234765;\n    \n    phys_group_id_234765 = get_group_id(0);\n    for (int32_t i_234766 = 0; i_234766 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * l_n_m_203733,\n                                          squot64(segred_group_sizze_219647,\n                                                  segment_sizze_nonzzero_234756))) -\n                   phys_group_id_234765, sext_i64_i32(num_groups_219648));\n         i_234766++) {\n        int32_t virt_group_id_234767 = phys_group_id_234765 + i_234766 *\n                sext_i64_i32(num_groups_219648);\n        int64_t slice_234768 = l_n_m_203733;\n        int64_t slice_234769 = partition_sizze_203667 * slice_234768;\n        int64_t gtid_219651 = squot64(squot64(sext_i32_i64(local_tid_234759),\n                                              segment_sizze_nonzzero_234756) +\n                                      sext_i32_i64(virt_group_id_234767) *\n                                      squot64(segred_group_sizze_219647,\n                                              segment_sizze_nonzzero_234756),\n                                      slice_234768);\n        int64_t remnant_234770 = squot64(sext_i32_i64(local_tid_234759),\n                           ",
                   "              segment_sizze_nonzzero_234756) +\n                sext_i32_i64(virt_group_id_234767) *\n                squot64(segred_group_sizze_219647,\n                        segment_sizze_nonzzero_234756) - gtid_219651 *\n                slice_234768;\n        int64_t gtid_219652 = remnant_234770;\n        int64_t remnant_234771 = remnant_234770 - gtid_219652;\n        int64_t gtid_219653 = srem64(sext_i32_i64(local_tid_234759),\n                                     q_l_203577);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_l_203577) && ((slt64(gtid_219651,\n                                                          partition_sizze_203667) &&\n                                                    slt64(gtid_219652,\n                                                          l_n_m_203733)) &&\n                                                   slt64(sext_i32_i64(local_tid_234759),\n                                                         q_l_203577 *\n                                                         squot64(segred_group_sizze_219647,\n                                                                 segment_sizze_nonzzero_234756)))) {\n                int64_t x_219664;\n                \n                x_219664 = ((__global int64_t *) ext_mem_229520)[gtid_219651 *\n                                                                 l_n_m_203733 +\n                                                                 gtid_219652];\n                \n                double x_219665;\n                \n                x_219665 = ((__global double *) ext_mem_229519)[gtid_219651 *\n                                                                l_n_m_203733 +\n                                                                gtid_219652];\n                \n                int64_t binop_y_228775 = mul64(jump_t_203582, gtid_219652);\n                int64_t binop_y_228776 = smin64(i_203760, binop_y_228775);\n                int64_t index_primexp_228777",
                   " = add64((int64_t) 1,\n                                                     binop_y_228776);\n                double a0_219667;\n                \n                a0_219667 = ((__global double *) mem_230709)[gtid_219651 *\n                                                             l_n_m_203733 +\n                                                             gtid_219652];\n                \n                bool cond_219669 = sle64(n_203572, gtid_219653);\n                int64_t defunc_0_f_res_219670;\n                \n                if (cond_219669) {\n                    defunc_0_f_res_219670 = (int64_t) 0;\n                } else {\n                    int64_t i_219671 = add64(gtid_219653, x_219664);\n                    int64_t defunc_1_add_res_219672 = add64((int64_t) 1,\n                                                            i_219671);\n                    \n                    defunc_0_f_res_219670 = defunc_1_add_res_219672;\n                }\n                \n                double defunc_0_f_res_219673;\n                \n                if (cond_219669) {\n                    defunc_0_f_res_219673 = 0.0;\n                } else {\n                    int64_t i_219674 = add64(gtid_219653, x_219664);\n                    double defunc_0_add_arg_219675;\n                    \n                    defunc_0_add_arg_219675 = ((__global\n                                                double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                            (gtid_219651 *\n                                                                             ctx_param_ext_229597 +\n                                                                             i_219674 *\n                                                                             ctx_param_ext_229599)];\n                    defunc_0_f_res_219673 = defunc_0_add_arg_219675;\n                }\n                \n                int64_t binop_p_219676 = sub64(defunc_0_f_res_219670,\n      ",
                   "                                         index_primexp_228777);\n                double defunc_0_f_res_219677 = sitofp_i64_f64(binop_p_219676);\n                double abs_res_219678 = fabs(defunc_0_f_res_219677);\n                double tmp1_219679 = abs_res_219678 / x_219665;\n                double x_219680 = tmp1_219679 * tmp1_219679;\n                double y_219681 = tmp1_219679 * x_219680;\n                double tmp2_219682 = 1.0 - y_219681;\n                double x_219683 = tmp2_219682 * tmp2_219682;\n                double tmp3_219684 = tmp2_219682 * x_219683;\n                double tmp4_219685 = defunc_0_f_res_219673 * tmp3_219684;\n                double defunc_0_f_res_219686;\n                \n                if (cond_219669) {\n                    defunc_0_f_res_219686 = 0.0;\n                } else {\n                    int64_t i_219687 = add64(gtid_219653, x_219664);\n                    double defunc_0_add_arg_219688;\n                    \n                    defunc_0_add_arg_219688 = ((__global\n                                                double *) mem_230659)[gtid_219651 *\n                                                                      n_203572 +\n                                                                      i_219687];\n                    defunc_0_f_res_219686 = defunc_0_add_arg_219688;\n                }\n                \n                double x_219689 = a0_219667 * tmp4_219685;\n                double defunc_9_fit_fun_res_219690 = defunc_0_f_res_219686 *\n                       x_219689;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_234763)[sext_i32_i64(local_tid_234759)] =\n                        defunc_9_fit_fun_res_219690;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_234763)[sext_i32_i64(local_tid_234759)] =\n         ",
                   "           0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_l_203577)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_219655;\n                double x_219656;\n                double x_234772;\n                double x_234773;\n                bool ltid_in_bounds_234775 =\n                     slt64(sext_i32_i64(local_tid_234759), q_l_203577 *\n                           squot64(segred_group_sizze_219647,\n                                   segment_sizze_nonzzero_234756));\n                int32_t skip_threads_234776;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_234775) {\n                        x_219656 = ((volatile __local\n                                     double *) red_arr_mem_234763)[sext_i32_i64(local_tid_234759)];\n                        if ((local_tid_234759 - squot32(local_tid_234759, 32) *\n                             32) == 0) {\n                            x_219655 = x_219656;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_234776 = 1;\n                    while (slt32(skip_threads_234776, 32)) {\n                        bool thread_active_234777 = sle32(skip_threads_234776,\n                                                          local_tid_234759 -\n                                                          squot32(local_tid_234759,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_234775;\n                        \n                        if (thread_active_234777) {\n                            // read operands\n                            {\n                                x_219655 = ((volatile __local\n                                             double *) red_arr_mem_234763)[sext_i32_",
                   "i64(local_tid_234759) -\n                                                                           sext_i32_i64(skip_threads_234776)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234778 =\n                                 slt64(srem64(sext_i32_i64(local_tid_234759),\n                                              q_l_203577),\n                                       sext_i32_i64(local_tid_234759) -\n                                       sext_i32_i64(local_tid_234759 -\n                                       skip_threads_234776));\n                            \n                            if (thread_active_234777 && inactive_234778) {\n                                x_219655 = x_219656;\n                            }\n                            if (thread_active_234777) {\n                                if (!inactive_234778) {\n                                    double defunc_1_op_res_219657 = x_219655 +\n                                           x_219656;\n                                    \n                                    x_219655 = defunc_1_op_res_219657;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_234761, skip_threads_234776)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234777) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234763)[sext_i32_i64(local_tid_234759)] =\n                                    x_219655;\n                                x_219656 = x_219655;\n                            }\n                        }\n                        if (sle32(wave_sizze_234761, skip_threads_234776)) {\n                            barrier(CLK_LOCAL_ME",
                   "M_FENCE);\n                        }\n                        skip_threads_234776 *= 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_234759 - squot32(local_tid_234759, 32) *\n                         32) == 31 && ltid_in_bounds_234775) {\n                        ((volatile __local\n                          double *) red_arr_mem_234763)[sext_i32_i64(squot32(local_tid_234759,\n                                                                             32))] =\n                            x_219655;\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_234779;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_234759, 32) == 0 &&\n                            ltid_in_bounds_234775) {\n                            x_234773 = ((volatile __local\n                                         double *) red_arr_mem_234763)[sext_i32_i64(local_tid_234759)];\n                            if ((local_tid_234759 - squot32(local_tid_234759,\n                                                            32) * 32) == 0) {\n                                x_234772 = x_234773;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_234779 = 1;\n                        while (slt32(skip_threads_234779, 32)) {\n                            bool thread_active_234780 =\n                                 sle32(skip_threads_234779, local_tid_234759 -\n                                       squot32(local_tid_234759, 32) * 32) &&\n   ",
                   "                              (squot32(local_tid_234759, 32) == 0 &&\n                                  ltid_in_bounds_234775);\n                            \n                            if (thread_active_234780) {\n                                // read operands\n                                {\n                                    x_234772 = ((volatile __local\n                                                 double *) red_arr_mem_234763)[sext_i32_i64(local_tid_234759) -\n                                                                               sext_i32_i64(skip_threads_234779)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_234781 =\n                                     slt64(srem64(sext_i32_i64(local_tid_234759 *\n                                                  32 + 32 - 1), q_l_203577),\n                                           sext_i32_i64(local_tid_234759 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_234759 -\n                                                         skip_threads_234779) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_234780 && inactive_234781) {\n                                    x_234772 = x_234773;\n                                }\n                                if (thread_active_234780) {\n                                    if (!inactive_234781) {\n                                        double defunc_1_op_res_234774 =\n                                               x_234772 + x_234773;\n                                        \n                                        x_234772 = defunc_1_op_res_234774;\n                                    }\n                                }\n                            }\n                           ",
                   " if (sle32(wave_sizze_234761, skip_threads_234779)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_234780) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_234763)[sext_i32_i64(local_tid_234759)] =\n                                        x_234772;\n                                    x_234773 = x_234772;\n                                }\n                            }\n                            if (sle32(wave_sizze_234761, skip_threads_234779)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_234779 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_234782 = squot32(local_tid_234759, 32) == 0 ||\n                     !ltid_in_bounds_234775;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_234782) {\n                            x_219656 = x_219655;\n                            x_219655 = ((__local\n                                         double *) red_arr_mem_234763)[sext_i32_i64(squot32(local_tid_234759,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234783 =\n                             slt64(srem64(sext_i32_i64(local_tid_234759),\n                                          q_l_203577),\n                      ",
                   "             sext_i32_i64(local_tid_234759) -\n                                   sext_i32_i64(squot32(local_tid_234759, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_234782) {\n                            if (inactive_234783) {\n                                x_219655 = x_219656;\n                            }\n                        }\n                        if (!no_carry_in_234782) {\n                            if (!inactive_234783) {\n                                double defunc_1_op_res_219657 = x_219655 +\n                                       x_219656;\n                                \n                                x_219655 = defunc_1_op_res_219657;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_234782) {\n                            ((__local\n                              double *) red_arr_mem_234763)[sext_i32_i64(local_tid_234759)] =\n                                x_219655;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_234759, 32) == 0 &&\n                        ltid_in_bounds_234775) {\n                        ((__local\n                          double *) red_arr_mem_234763)[sext_i32_i64(local_tid_234759)] =\n                            x_219656;\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_234767) *\n                      squot64(segred_group_sizze_219647,\n                              segment_sizze_nonzzero_234756) +\n                      sext_i32_i64(local_tid_234759), partit",
                   "ion_sizze_203667 *\n                      l_n_m_203733) && slt64(sext_i32_i64(local_tid_234759),\n                                             squot64(segred_group_sizze_219647,\n                                                     segment_sizze_nonzzero_234756))) {\n                double tmp_234784;\n                \n                tmp_234784 = ((__local\n                               double *) red_arr_mem_234763)[(sext_i32_i64(local_tid_234759) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234756 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230714)[squot64(sext_i32_i64(virt_group_id_234767) *\n                                                squot64(segred_group_sizze_219647,\n                                                        segment_sizze_nonzzero_234756) +\n                                                sext_i32_i64(local_tid_234759),\n                                                l_n_m_203733) * l_n_m_203733 +\n                                        (sext_i32_i64(virt_group_id_234767) *\n                                         squot64(segred_group_sizze_219647,\n                                                 segment_sizze_nonzzero_234756) +\n                                         sext_i32_i64(local_tid_234759) -\n                                         squot64(sext_i32_i64(virt_group_id_234767) *\n                                                 squot64(segred_group_sizze_219647,\n                                                         segment_sizze_nonzzero_234756) +\n                                                 sext_i32_i64(local_tid_234759),\n                                                 l_n_m_203733) *\n                                         l_n_m_203733)] = tmp_234784;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrie",
                   "r(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_219647\n}\n__kernel void mainzisegred_small_220434(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234893_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234891_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234889_backing_aligned_2,\n                                        int64_t n_203572, int64_t q_l_203577,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t l_n_m_203733, int64_t i_203760,\n                                        int64_t num_groups_220426,\n                                        int64_t ctx_param_ext_229596,\n                                        int64_t ctx_param_ext_229597,\n                                        int64_t ctx_param_ext_229599,\n                                        int64_t segment_sizze_nonzzero_234882,\n                                        __global unsigned char *ext_mem_229519,\n                                        __global unsigned char *ext_mem_229520,\n                                        __global\n                                        unsigned char *mem_param_229601,\n                                        __global unsigned char *mem_230784,\n                                        __global unsigned char *mem_230788,\n                                        __global unsigned char *mem_230792)\n{\n    #define segred_group_sizze_220425 (mainzisegred_group_sizze_220102)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_a",
                   "rr_mem_234893_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234893_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_234891_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234891_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_234889_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234889_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234884;\n    int32_t local_tid_234885;\n    int64_t group_sizze_234888;\n    int32_t wave_sizze_234887;\n    int32_t group_tid_234886;\n    \n    global_tid_234884 = get_global_id(0);\n    local_tid_234885 = get_local_id(0);\n    group_sizze_234888 = get_local_size(0);\n    wave_sizze_234887 = LOCKSTEP_WIDTH;\n    group_tid_234886 = get_group_id(0);\n    \n    int32_t phys_tid_220434 = global_tid_234884;\n    __local unsigned char *red_arr_mem_234889;\n    \n    red_arr_mem_234889 = (__local unsigned char *) red_arr_mem_234889_backing_0;\n    \n    __local unsigned char *red_arr_mem_234891;\n    \n    red_arr_mem_234891 = (__local unsigned char *) red_arr_mem_234891_backing_1;\n    \n    __local unsigned char *red_arr_mem_234893;\n    \n    red_arr_mem_234893 = (__local unsigned char *) red_arr_mem_234893_backing_2;\n    \n    int32_t phys_group_id_234895;\n    \n    phys_group_id_234895 = get_group_id(0);\n    for (int32_t i_234896 = 0; i_234896 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * l_n_m_203733,\n                                          squot64(segred_group_sizze_220425,\n                                                  segment_sizze_nonzzero_234882))) -\n                   phys_group_id_234895, sext_i64_i32(num_groups_220426));\n         i_234896++) {\n        int32_t virt_group_id_23489",
                   "7 = phys_group_id_234895 + i_234896 *\n                sext_i64_i32(num_groups_220426);\n        int64_t slice_234898 = l_n_m_203733;\n        int64_t slice_234899 = partition_sizze_203667 * slice_234898;\n        int64_t gtid_220431 = squot64(squot64(sext_i32_i64(local_tid_234885),\n                                              segment_sizze_nonzzero_234882) +\n                                      sext_i32_i64(virt_group_id_234897) *\n                                      squot64(segred_group_sizze_220425,\n                                              segment_sizze_nonzzero_234882),\n                                      slice_234898);\n        int64_t remnant_234900 = squot64(sext_i32_i64(local_tid_234885),\n                                         segment_sizze_nonzzero_234882) +\n                sext_i32_i64(virt_group_id_234897) *\n                squot64(segred_group_sizze_220425,\n                        segment_sizze_nonzzero_234882) - gtid_220431 *\n                slice_234898;\n        int64_t gtid_220432 = remnant_234900;\n        int64_t remnant_234901 = remnant_234900 - gtid_220432;\n        int64_t gtid_220433 = srem64(sext_i32_i64(local_tid_234885),\n                                     q_l_203577);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_l_203577) && ((slt64(gtid_220431,\n                                                          partition_sizze_203667) &&\n                                                    slt64(gtid_220432,\n                                                          l_n_m_203733)) &&\n                                                   slt64(sext_i32_i64(local_tid_234885),\n                                                         q_l_203577 *\n                                                         squot64(segred_group_sizze_220425,\n                                                                 segment_sizze_nonzzero_234882)))) {\n                int64_t x_220448;\n                \n              ",
                   "  x_220448 = ((__global int64_t *) ext_mem_229520)[gtid_220431 *\n                                                                 l_n_m_203733 +\n                                                                 gtid_220432];\n                \n                double x_220449;\n                \n                x_220449 = ((__global double *) ext_mem_229519)[gtid_220431 *\n                                                                l_n_m_203733 +\n                                                                gtid_220432];\n                \n                int64_t binop_y_228790 = mul64(jump_t_203582, gtid_220432);\n                int64_t binop_y_228791 = smin64(i_203760, binop_y_228790);\n                int64_t index_primexp_228792 = add64((int64_t) 1,\n                                                     binop_y_228791);\n                bool cond_220452 = sle64(n_203572, gtid_220433);\n                int64_t defunc_0_f_res_220453;\n                \n                if (cond_220452) {\n                    defunc_0_f_res_220453 = (int64_t) 0;\n                } else {\n                    int64_t i_220454 = add64(gtid_220433, x_220448);\n                    int64_t defunc_1_add_res_220455 = add64((int64_t) 1,\n                                                            i_220454);\n                    \n                    defunc_0_f_res_220453 = defunc_1_add_res_220455;\n                }\n                \n                double defunc_0_f_res_220456;\n                \n                if (cond_220452) {\n                    defunc_0_f_res_220456 = 0.0;\n                } else {\n                    int64_t i_220457 = add64(gtid_220433, x_220448);\n                    double defunc_0_add_arg_220458;\n                    \n                    defunc_0_add_arg_220458 = ((__global\n                                                double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                            (gtid_220431 *\n                         ",
                   "                                                    ctx_param_ext_229597 +\n                                                                             i_220457 *\n                                                                             ctx_param_ext_229599)];\n                    defunc_0_f_res_220456 = defunc_0_add_arg_220458;\n                }\n                \n                int64_t binop_p_220459 = sub64(defunc_0_f_res_220453,\n                                               index_primexp_228792);\n                double defunc_0_f_res_220460 = sitofp_i64_f64(binop_p_220459);\n                double abs_res_220461 = fabs(defunc_0_f_res_220460);\n                double tmp1_220462 = abs_res_220461 / x_220449;\n                double x_220463 = tmp1_220462 * tmp1_220462;\n                double y_220464 = tmp1_220462 * x_220463;\n                double tmp2_220465 = 1.0 - y_220464;\n                double x_220466 = tmp2_220465 * tmp2_220465;\n                double tmp3_220467 = tmp2_220465 * x_220466;\n                double w_j_220468 = defunc_0_f_res_220456 * tmp3_220467;\n                double xw_j_220469 = defunc_0_f_res_220460 * w_j_220468;\n                double x2w_j_220470 = defunc_0_f_res_220460 * xw_j_220469;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_234889)[sext_i32_i64(local_tid_234885)] =\n                        w_j_220468;\n                    ((__local\n                      double *) red_arr_mem_234891)[sext_i32_i64(local_tid_234885)] =\n                        xw_j_220469;\n                    ((__local\n                      double *) red_arr_mem_234893)[sext_i32_i64(local_tid_234885)] =\n                        x2w_j_220470;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_234889)[sext_i32_i64(local_tid_234885)] =\n                  ",
                   "  0.0;\n                ((__local\n                  double *) red_arr_mem_234891)[sext_i32_i64(local_tid_234885)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_234893)[sext_i32_i64(local_tid_234885)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_l_203577)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_220435;\n                double x_220436;\n                double x_220437;\n                double x_220438;\n                double x_220439;\n                double x_220440;\n                double x_234902;\n                double x_234903;\n                double x_234904;\n                double x_234905;\n                double x_234906;\n                double x_234907;\n                bool ltid_in_bounds_234911 =\n                     slt64(sext_i32_i64(local_tid_234885), q_l_203577 *\n                           squot64(segred_group_sizze_220425,\n                                   segment_sizze_nonzzero_234882));\n                int32_t skip_threads_234912;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_234911) {\n                        x_220438 = ((volatile __local\n                                     double *) red_arr_mem_234889)[sext_i32_i64(local_tid_234885)];\n                        x_220439 = ((volatile __local\n                                     double *) red_arr_mem_234891)[sext_i32_i64(local_tid_234885)];\n                        x_220440 = ((volatile __local\n                                     double *) red_arr_mem_234893)[sext_i32_i64(local_tid_234885)];\n                        if ((local_tid_234885 - squot32(local_tid_234885, 32) *\n                             32) == 0) {\n                            x_220435 = x_220438;\n                            x_220436 = x_220439;\n                            x_220437 = x_2204",
                   "40;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_234912 = 1;\n                    while (slt32(skip_threads_234912, 32)) {\n                        bool thread_active_234913 = sle32(skip_threads_234912,\n                                                          local_tid_234885 -\n                                                          squot32(local_tid_234885,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_234911;\n                        \n                        if (thread_active_234913) {\n                            // read operands\n                            {\n                                x_220435 = ((volatile __local\n                                             double *) red_arr_mem_234889)[sext_i32_i64(local_tid_234885) -\n                                                                           sext_i32_i64(skip_threads_234912)];\n                                x_220436 = ((volatile __local\n                                             double *) red_arr_mem_234891)[sext_i32_i64(local_tid_234885) -\n                                                                           sext_i32_i64(skip_threads_234912)];\n                                x_220437 = ((volatile __local\n                                             double *) red_arr_mem_234893)[sext_i32_i64(local_tid_234885) -\n                                                                           sext_i32_i64(skip_threads_234912)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234914 =\n                                 slt64(srem64(sext_i32_i64(local_tid_234885),\n                                              q_l_203577),\n                                       sext_i32_i64(local_tid",
                   "_234885) -\n                                       sext_i32_i64(local_tid_234885 -\n                                       skip_threads_234912));\n                            \n                            if (thread_active_234913 && inactive_234914) {\n                                x_220435 = x_220438;\n                                x_220436 = x_220439;\n                                x_220437 = x_220440;\n                            }\n                            if (thread_active_234913) {\n                                if (!inactive_234914) {\n                                    double defunc_1_op_res_220441 = x_220435 +\n                                           x_220438;\n                                    double defunc_1_op_res_220442 = x_220436 +\n                                           x_220439;\n                                    double defunc_1_op_res_220443 = x_220437 +\n                                           x_220440;\n                                    \n                                    x_220435 = defunc_1_op_res_220441;\n                                    x_220436 = defunc_1_op_res_220442;\n                                    x_220437 = defunc_1_op_res_220443;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_234887, skip_threads_234912)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234913) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234889)[sext_i32_i64(local_tid_234885)] =\n                                    x_220435;\n                                x_220438 = x_220435;\n                                ((volatile __local\n                                  double *) red_arr_mem_234891)[sext_i32_i64(local_tid_234885)] =\n                               ",
                   "     x_220436;\n                                x_220439 = x_220436;\n                                ((volatile __local\n                                  double *) red_arr_mem_234893)[sext_i32_i64(local_tid_234885)] =\n                                    x_220437;\n                                x_220440 = x_220437;\n                            }\n                        }\n                        if (sle32(wave_sizze_234887, skip_threads_234912)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_234912 *= 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_234885 - squot32(local_tid_234885, 32) *\n                         32) == 31 && ltid_in_bounds_234911) {\n                        ((volatile __local\n                          double *) red_arr_mem_234889)[sext_i32_i64(squot32(local_tid_234885,\n                                                                             32))] =\n                            x_220435;\n                        ((volatile __local\n                          double *) red_arr_mem_234891)[sext_i32_i64(squot32(local_tid_234885,\n                                                                             32))] =\n                            x_220436;\n                        ((volatile __local\n                          double *) red_arr_mem_234893)[sext_i32_i64(squot32(local_tid_234885,\n                                                                             32))] =\n                            x_220437;\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_234915;\n                    \n                    // read input for in-bl",
                   "ock scan\n                    {\n                        if (squot32(local_tid_234885, 32) == 0 &&\n                            ltid_in_bounds_234911) {\n                            x_234905 = ((volatile __local\n                                         double *) red_arr_mem_234889)[sext_i32_i64(local_tid_234885)];\n                            x_234906 = ((volatile __local\n                                         double *) red_arr_mem_234891)[sext_i32_i64(local_tid_234885)];\n                            x_234907 = ((volatile __local\n                                         double *) red_arr_mem_234893)[sext_i32_i64(local_tid_234885)];\n                            if ((local_tid_234885 - squot32(local_tid_234885,\n                                                            32) * 32) == 0) {\n                                x_234902 = x_234905;\n                                x_234903 = x_234906;\n                                x_234904 = x_234907;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_234915 = 1;\n                        while (slt32(skip_threads_234915, 32)) {\n                            bool thread_active_234916 =\n                                 sle32(skip_threads_234915, local_tid_234885 -\n                                       squot32(local_tid_234885, 32) * 32) &&\n                                 (squot32(local_tid_234885, 32) == 0 &&\n                                  ltid_in_bounds_234911);\n                            \n                            if (thread_active_234916) {\n                                // read operands\n                                {\n                                    x_234902 = ((volatile __local\n                                                 double *) red_arr_mem_234889)[sext_i32_i64(local_tid_234885) -\n                                                                              ",
                   " sext_i32_i64(skip_threads_234915)];\n                                    x_234903 = ((volatile __local\n                                                 double *) red_arr_mem_234891)[sext_i32_i64(local_tid_234885) -\n                                                                               sext_i32_i64(skip_threads_234915)];\n                                    x_234904 = ((volatile __local\n                                                 double *) red_arr_mem_234893)[sext_i32_i64(local_tid_234885) -\n                                                                               sext_i32_i64(skip_threads_234915)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_234917 =\n                                     slt64(srem64(sext_i32_i64(local_tid_234885 *\n                                                  32 + 32 - 1), q_l_203577),\n                                           sext_i32_i64(local_tid_234885 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_234885 -\n                                                         skip_threads_234915) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_234916 && inactive_234917) {\n                                    x_234902 = x_234905;\n                                    x_234903 = x_234906;\n                                    x_234904 = x_234907;\n                                }\n                                if (thread_active_234916) {\n                                    if (!inactive_234917) {\n                                        double defunc_1_op_res_234908 =\n                                               x_234902 + x_234905;\n                                        double defunc_1_op_res_234909 =\n                        ",
                   "                       x_234903 + x_234906;\n                                        double defunc_1_op_res_234910 =\n                                               x_234904 + x_234907;\n                                        \n                                        x_234902 = defunc_1_op_res_234908;\n                                        x_234903 = defunc_1_op_res_234909;\n                                        x_234904 = defunc_1_op_res_234910;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_234887, skip_threads_234915)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_234916) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_234889)[sext_i32_i64(local_tid_234885)] =\n                                        x_234902;\n                                    x_234905 = x_234902;\n                                    ((volatile __local\n                                      double *) red_arr_mem_234891)[sext_i32_i64(local_tid_234885)] =\n                                        x_234903;\n                                    x_234906 = x_234903;\n                                    ((volatile __local\n                                      double *) red_arr_mem_234893)[sext_i32_i64(local_tid_234885)] =\n                                        x_234904;\n                                    x_234907 = x_234904;\n                                }\n                            }\n                            if (sle32(wave_sizze_234887, skip_threads_234915)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_234915 *= 2;\n                        }\n                    }\n      ",
                   "          }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_234918 = squot32(local_tid_234885, 32) == 0 ||\n                     !ltid_in_bounds_234911;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_234918) {\n                            x_220438 = x_220435;\n                            x_220439 = x_220436;\n                            x_220440 = x_220437;\n                            x_220435 = ((__local\n                                         double *) red_arr_mem_234889)[sext_i32_i64(squot32(local_tid_234885,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_220436 = ((__local\n                                         double *) red_arr_mem_234891)[sext_i32_i64(squot32(local_tid_234885,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_220437 = ((__local\n                                         double *) red_arr_mem_234893)[sext_i32_i64(squot32(local_tid_234885,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234919 =\n                             slt64(srem64(sext_i32_i64(local_tid_234885),\n                                          q_l_203577),\n                                   sext_i32_i64(local_tid_234885) -\n                                   sext_i32_i64(squot32(local_t",
                   "id_234885, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_234918) {\n                            if (inactive_234919) {\n                                x_220435 = x_220438;\n                                x_220436 = x_220439;\n                                x_220437 = x_220440;\n                            }\n                        }\n                        if (!no_carry_in_234918) {\n                            if (!inactive_234919) {\n                                double defunc_1_op_res_220441 = x_220435 +\n                                       x_220438;\n                                double defunc_1_op_res_220442 = x_220436 +\n                                       x_220439;\n                                double defunc_1_op_res_220443 = x_220437 +\n                                       x_220440;\n                                \n                                x_220435 = defunc_1_op_res_220441;\n                                x_220436 = defunc_1_op_res_220442;\n                                x_220437 = defunc_1_op_res_220443;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_234918) {\n                            ((__local\n                              double *) red_arr_mem_234889)[sext_i32_i64(local_tid_234885)] =\n                                x_220435;\n                            ((__local\n                              double *) red_arr_mem_234891)[sext_i32_i64(local_tid_234885)] =\n                                x_220436;\n                            ((__local\n                              double *) red_arr_mem_234893)[sext_i32_i64(local_tid_234885)] =\n                                x_220437;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n  ",
                   "              {\n                    if (squot32(local_tid_234885, 32) == 0 &&\n                        ltid_in_bounds_234911) {\n                        ((__local\n                          double *) red_arr_mem_234889)[sext_i32_i64(local_tid_234885)] =\n                            x_220438;\n                        ((__local\n                          double *) red_arr_mem_234891)[sext_i32_i64(local_tid_234885)] =\n                            x_220439;\n                        ((__local\n                          double *) red_arr_mem_234893)[sext_i32_i64(local_tid_234885)] =\n                            x_220440;\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_234897) *\n                      squot64(segred_group_sizze_220425,\n                              segment_sizze_nonzzero_234882) +\n                      sext_i32_i64(local_tid_234885), partition_sizze_203667 *\n                      l_n_m_203733) && slt64(sext_i32_i64(local_tid_234885),\n                                             squot64(segred_group_sizze_220425,\n                                                     segment_sizze_nonzzero_234882))) {\n                double tmp_234920;\n                \n                tmp_234920 = ((__local\n                               double *) red_arr_mem_234889)[(sext_i32_i64(local_tid_234885) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234882 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230784)[squot64(sext_i32_i64(virt_group_id_234897) *\n                                                squot64(segred_group_sizze_220425,\n                                                        seg",
                   "ment_sizze_nonzzero_234882) +\n                                                sext_i32_i64(local_tid_234885),\n                                                l_n_m_203733) * l_n_m_203733 +\n                                        (sext_i32_i64(virt_group_id_234897) *\n                                         squot64(segred_group_sizze_220425,\n                                                 segment_sizze_nonzzero_234882) +\n                                         sext_i32_i64(local_tid_234885) -\n                                         squot64(sext_i32_i64(virt_group_id_234897) *\n                                                 squot64(segred_group_sizze_220425,\n                                                         segment_sizze_nonzzero_234882) +\n                                                 sext_i32_i64(local_tid_234885),\n                                                 l_n_m_203733) *\n                                         l_n_m_203733)] = tmp_234920;\n                \n                double tmp_234921;\n                \n                tmp_234921 = ((__local\n                               double *) red_arr_mem_234891)[(sext_i32_i64(local_tid_234885) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234882 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230788)[squot64(sext_i32_i64(virt_group_id_234897) *\n                                                squot64(segred_group_sizze_220425,\n                                                        segment_sizze_nonzzero_234882) +\n                                                sext_i32_i64(local_tid_234885),\n                                                l_n_m_203733) * l_n_m_203733 +\n                                        (sext_i32_i64(virt_group_id_234897) *\n                                         squot64(segred_",
                   "group_sizze_220425,\n                                                 segment_sizze_nonzzero_234882) +\n                                         sext_i32_i64(local_tid_234885) -\n                                         squot64(sext_i32_i64(virt_group_id_234897) *\n                                                 squot64(segred_group_sizze_220425,\n                                                         segment_sizze_nonzzero_234882) +\n                                                 sext_i32_i64(local_tid_234885),\n                                                 l_n_m_203733) *\n                                         l_n_m_203733)] = tmp_234921;\n                \n                double tmp_234922;\n                \n                tmp_234922 = ((__local\n                               double *) red_arr_mem_234893)[(sext_i32_i64(local_tid_234885) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234882 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230792)[squot64(sext_i32_i64(virt_group_id_234897) *\n                                                squot64(segred_group_sizze_220425,\n                                                        segment_sizze_nonzzero_234882) +\n                                                sext_i32_i64(local_tid_234885),\n                                                l_n_m_203733) * l_n_m_203733 +\n                                        (sext_i32_i64(virt_group_id_234897) *\n                                         squot64(segred_group_sizze_220425,\n                                                 segment_sizze_nonzzero_234882) +\n                                         sext_i32_i64(local_tid_234885) -\n                                         squot64(sext_i32_i64(virt_group_id_234897) *\n                                                 squot64(segr",
                   "ed_group_sizze_220425,\n                                                         segment_sizze_nonzzero_234882) +\n                                                 sext_i32_i64(local_tid_234885),\n                                                 l_n_m_203733) *\n                                         l_n_m_203733)] = tmp_234922;\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_220425\n}\n__kernel void mainzisegred_small_220503(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235001_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234999_backing_aligned_1,\n                                        int64_t n_203572, int64_t q_l_203577,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t l_n_m_203733, int64_t i_203760,\n                                        int64_t num_groups_220496,\n                                        int64_t ctx_param_ext_229596,\n                                        int64_t ctx_param_ext_229597,\n                                        int64_t ctx_param_ext_229599,\n                                        int64_t segment_sizze_nonzzero_234992,\n                                        __global unsigned char *ext_mem_229519,\n                                        __global unsigned char *ext_mem_229520,\n                                        __global\n                                        unsigned char *mem_param_229601,\n                                        __global unsigned char *mem_230659,\n                                        __global unsigned char *mem_230797,\n                                  ",
                   "      __global unsigned char *mem_230801,\n                                        __global unsigned char *mem_230805,\n                                        __global unsigned char *mem_230810,\n                                        __global unsigned char *mem_230814)\n{\n    #define segred_group_sizze_220495 (mainzisegred_group_sizze_220008)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_235001_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235001_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_234999_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234999_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234994;\n    int32_t local_tid_234995;\n    int64_t group_sizze_234998;\n    int32_t wave_sizze_234997;\n    int32_t group_tid_234996;\n    \n    global_tid_234994 = get_global_id(0);\n    local_tid_234995 = get_local_id(0);\n    group_sizze_234998 = get_local_size(0);\n    wave_sizze_234997 = LOCKSTEP_WIDTH;\n    group_tid_234996 = get_group_id(0);\n    \n    int32_t phys_tid_220503 = global_tid_234994;\n    __local unsigned char *red_arr_mem_234999;\n    \n    red_arr_mem_234999 = (__local unsigned char *) red_arr_mem_234999_backing_0;\n    \n    __local unsigned char *red_arr_mem_235001;\n    \n    red_arr_mem_235001 = (__local unsigned char *) red_arr_mem_235001_backing_1;\n    \n    int32_t phys_group_id_235003;\n    \n    phys_group_id_235003 = get_group_id(0);\n    for (int32_t i_235004 = 0; i_235004 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * l_n_m_203733,\n                                          squot64(segred_group_sizze_220495,\n                                                  segment_sizze_nonzzero_234992))) -\n  ",
                   "                 phys_group_id_235003, sext_i64_i32(num_groups_220496));\n         i_235004++) {\n        int32_t virt_group_id_235005 = phys_group_id_235003 + i_235004 *\n                sext_i64_i32(num_groups_220496);\n        int64_t slice_235006 = l_n_m_203733;\n        int64_t slice_235007 = partition_sizze_203667 * slice_235006;\n        int64_t gtid_220500 = squot64(squot64(sext_i32_i64(local_tid_234995),\n                                              segment_sizze_nonzzero_234992) +\n                                      sext_i32_i64(virt_group_id_235005) *\n                                      squot64(segred_group_sizze_220495,\n                                              segment_sizze_nonzzero_234992),\n                                      slice_235006);\n        int64_t remnant_235008 = squot64(sext_i32_i64(local_tid_234995),\n                                         segment_sizze_nonzzero_234992) +\n                sext_i32_i64(virt_group_id_235005) *\n                squot64(segred_group_sizze_220495,\n                        segment_sizze_nonzzero_234992) - gtid_220500 *\n                slice_235006;\n        int64_t gtid_220501 = remnant_235008;\n        int64_t remnant_235009 = remnant_235008 - gtid_220501;\n        int64_t gtid_220502 = srem64(sext_i32_i64(local_tid_234995),\n                                     q_l_203577);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_l_203577) && ((slt64(gtid_220500,\n                                                          partition_sizze_203667) &&\n                                                    slt64(gtid_220501,\n                                                          l_n_m_203733)) &&\n                                                   slt64(sext_i32_i64(local_tid_234995),\n                                                         q_l_203577 *\n                                                         squot64(segred_group_sizze_220495,\n                                   ",
                   "                              segment_sizze_nonzzero_234992)))) {\n                int64_t x_220518;\n                \n                x_220518 = ((__global int64_t *) ext_mem_229520)[gtid_220500 *\n                                                                 l_n_m_203733 +\n                                                                 gtid_220501];\n                \n                double x_220519;\n                \n                x_220519 = ((__global double *) ext_mem_229519)[gtid_220500 *\n                                                                l_n_m_203733 +\n                                                                gtid_220501];\n                \n                int64_t binop_y_228785 = mul64(jump_t_203582, gtid_220501);\n                int64_t binop_y_228786 = smin64(i_203760, binop_y_228785);\n                int64_t index_primexp_228787 = add64((int64_t) 1,\n                                                     binop_y_228786);\n                double a11_220521;\n                \n                a11_220521 = ((__global double *) mem_230797)[gtid_220500 *\n                                                              l_n_m_203733 +\n                                                              gtid_220501];\n                \n                double b11_220522;\n                \n                b11_220522 = ((__global double *) mem_230801)[gtid_220500 *\n                                                              l_n_m_203733 +\n                                                              gtid_220501];\n                \n                double c11_220523;\n                \n                c11_220523 = ((__global double *) mem_230805)[gtid_220500 *\n                                                              l_n_m_203733 +\n                                                              gtid_220501];\n                \n                bool cond_220525 = sle64(n_203572, gtid_220502);\n                int64_t defunc_0_f_res_220526;\n                \n                ",
                   "if (cond_220525) {\n                    defunc_0_f_res_220526 = (int64_t) 0;\n                } else {\n                    int64_t i_220527 = add64(gtid_220502, x_220518);\n                    int64_t defunc_1_add_res_220528 = add64((int64_t) 1,\n                                                            i_220527);\n                    \n                    defunc_0_f_res_220526 = defunc_1_add_res_220528;\n                }\n                \n                double defunc_0_f_res_220529;\n                \n                if (cond_220525) {\n                    defunc_0_f_res_220529 = 0.0;\n                } else {\n                    int64_t i_220530 = add64(gtid_220502, x_220518);\n                    double defunc_0_add_arg_220531;\n                    \n                    defunc_0_add_arg_220531 = ((__global\n                                                double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                            (gtid_220500 *\n                                                                             ctx_param_ext_229597 +\n                                                                             i_220530 *\n                                                                             ctx_param_ext_229599)];\n                    defunc_0_f_res_220529 = defunc_0_add_arg_220531;\n                }\n                \n                int64_t binop_p_220532 = sub64(defunc_0_f_res_220526,\n                                               index_primexp_228787);\n                double defunc_0_f_res_220533 = sitofp_i64_f64(binop_p_220532);\n                double abs_res_220534 = fabs(defunc_0_f_res_220533);\n                double tmp1_220535 = abs_res_220534 / x_220519;\n                double x_220536 = tmp1_220535 * tmp1_220535;\n                double y_220537 = tmp1_220535 * x_220536;\n                double tmp2_220538 = 1.0 - y_220537;\n                double x_220539 = tmp2_220538 * tmp2_220538;\n                double",
                   " tmp3_220540 = tmp2_220538 * x_220539;\n                double tmp4_220541 = defunc_0_f_res_220529 * tmp3_220540;\n                double defunc_1_f_res_220542 = defunc_0_f_res_220533 *\n                       tmp4_220541;\n                double defunc_0_f_res_220543;\n                \n                if (cond_220525) {\n                    defunc_0_f_res_220543 = 0.0;\n                } else {\n                    int64_t i_220544 = add64(gtid_220502, x_220518);\n                    double defunc_0_add_arg_220545;\n                    \n                    defunc_0_add_arg_220545 = ((__global\n                                                double *) mem_230659)[gtid_220500 *\n                                                                      n_203572 +\n                                                                      i_220544];\n                    defunc_0_f_res_220543 = defunc_0_add_arg_220545;\n                }\n                \n                double x_220546 = a11_220521 * tmp4_220541;\n                double y_220547 = b11_220522 * defunc_1_f_res_220542;\n                double x_220548 = x_220546 + y_220547;\n                double defunc_9_fit_fun_res_220549 = defunc_0_f_res_220543 *\n                       x_220548;\n                double x_220550 = b11_220522 * tmp4_220541;\n                double y_220551 = c11_220523 * defunc_1_f_res_220542;\n                double x_220552 = x_220550 + y_220551;\n                double defunc_9_slope_fun_res_220553 = defunc_0_f_res_220543 *\n                       x_220552;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_234999)[sext_i32_i64(local_tid_234995)] =\n                        defunc_9_fit_fun_res_220549;\n                    ((__local\n                      double *) red_arr_mem_235001)[sext_i32_i64(local_tid_234995)] =\n                        defunc_9_slope_fu",
                   "n_res_220553;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_234999)[sext_i32_i64(local_tid_234995)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235001)[sext_i32_i64(local_tid_234995)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_l_203577)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_220504;\n                double x_220505;\n                double x_220506;\n                double x_220507;\n                double x_235010;\n                double x_235011;\n                double x_235012;\n                double x_235013;\n                bool ltid_in_bounds_235016 =\n                     slt64(sext_i32_i64(local_tid_234995), q_l_203577 *\n                           squot64(segred_group_sizze_220495,\n                                   segment_sizze_nonzzero_234992));\n                int32_t skip_threads_235017;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_235016) {\n                        x_220506 = ((volatile __local\n                                     double *) red_arr_mem_234999)[sext_i32_i64(local_tid_234995)];\n                        x_220507 = ((volatile __local\n                                     double *) red_arr_mem_235001)[sext_i32_i64(local_tid_234995)];\n                        if ((local_tid_234995 - squot32(local_tid_234995, 32) *\n                             32) == 0) {\n                            x_220504 = x_220506;\n                            x_220505 = x_220507;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_235017 = 1;\n                    while (slt32(skip_threads_235017, 32)) {\n                        bool th",
                   "read_active_235018 = sle32(skip_threads_235017,\n                                                          local_tid_234995 -\n                                                          squot32(local_tid_234995,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_235016;\n                        \n                        if (thread_active_235018) {\n                            // read operands\n                            {\n                                x_220504 = ((volatile __local\n                                             double *) red_arr_mem_234999)[sext_i32_i64(local_tid_234995) -\n                                                                           sext_i32_i64(skip_threads_235017)];\n                                x_220505 = ((volatile __local\n                                             double *) red_arr_mem_235001)[sext_i32_i64(local_tid_234995) -\n                                                                           sext_i32_i64(skip_threads_235017)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_235019 =\n                                 slt64(srem64(sext_i32_i64(local_tid_234995),\n                                              q_l_203577),\n                                       sext_i32_i64(local_tid_234995) -\n                                       sext_i32_i64(local_tid_234995 -\n                                       skip_threads_235017));\n                            \n                            if (thread_active_235018 && inactive_235019) {\n                                x_220504 = x_220506;\n                                x_220505 = x_220507;\n                            }\n                            if (thread_active_235018) {\n                                if (!inactive_235019) {\n                                    double defunc_1_op_res_220508 = x_2205",
                   "04 +\n                                           x_220506;\n                                    double defunc_1_op_res_220509 = x_220505 +\n                                           x_220507;\n                                    \n                                    x_220504 = defunc_1_op_res_220508;\n                                    x_220505 = defunc_1_op_res_220509;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_234997, skip_threads_235017)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_235018) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234999)[sext_i32_i64(local_tid_234995)] =\n                                    x_220504;\n                                x_220506 = x_220504;\n                                ((volatile __local\n                                  double *) red_arr_mem_235001)[sext_i32_i64(local_tid_234995)] =\n                                    x_220505;\n                                x_220507 = x_220505;\n                            }\n                        }\n                        if (sle32(wave_sizze_234997, skip_threads_235017)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_235017 *= 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_234995 - squot32(local_tid_234995, 32) *\n                         32) == 31 && ltid_in_bounds_235016) {\n                        ((volatile __local\n                          double *) red_arr_mem_234999)[sext_i32_i64(squot32(local_tid_234995,\n                                  ",
                   "                                           32))] =\n                            x_220504;\n                        ((volatile __local\n                          double *) red_arr_mem_235001)[sext_i32_i64(squot32(local_tid_234995,\n                                                                             32))] =\n                            x_220505;\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_235020;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_234995, 32) == 0 &&\n                            ltid_in_bounds_235016) {\n                            x_235012 = ((volatile __local\n                                         double *) red_arr_mem_234999)[sext_i32_i64(local_tid_234995)];\n                            x_235013 = ((volatile __local\n                                         double *) red_arr_mem_235001)[sext_i32_i64(local_tid_234995)];\n                            if ((local_tid_234995 - squot32(local_tid_234995,\n                                                            32) * 32) == 0) {\n                                x_235010 = x_235012;\n                                x_235011 = x_235013;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_235020 = 1;\n                        while (slt32(skip_threads_235020, 32)) {\n                            bool thread_active_235021 =\n                                 sle32(skip_threads_235020, local_tid_234995 -\n                                       squot32(local_tid_234995, 32) * 32) &&\n                                 (squot32(local_tid_234995, 32) == 0 &&\n                                ",
                   "  ltid_in_bounds_235016);\n                            \n                            if (thread_active_235021) {\n                                // read operands\n                                {\n                                    x_235010 = ((volatile __local\n                                                 double *) red_arr_mem_234999)[sext_i32_i64(local_tid_234995) -\n                                                                               sext_i32_i64(skip_threads_235020)];\n                                    x_235011 = ((volatile __local\n                                                 double *) red_arr_mem_235001)[sext_i32_i64(local_tid_234995) -\n                                                                               sext_i32_i64(skip_threads_235020)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_235022 =\n                                     slt64(srem64(sext_i32_i64(local_tid_234995 *\n                                                  32 + 32 - 1), q_l_203577),\n                                           sext_i32_i64(local_tid_234995 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_234995 -\n                                                         skip_threads_235020) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_235021 && inactive_235022) {\n                                    x_235010 = x_235012;\n                                    x_235011 = x_235013;\n                                }\n                                if (thread_active_235021) {\n                                    if (!inactive_235022) {\n                                        double defunc_1_op_res_235014 =\n                                               x_235010 + x_2350",
                   "12;\n                                        double defunc_1_op_res_235015 =\n                                               x_235011 + x_235013;\n                                        \n                                        x_235010 = defunc_1_op_res_235014;\n                                        x_235011 = defunc_1_op_res_235015;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_234997, skip_threads_235020)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_235021) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_234999)[sext_i32_i64(local_tid_234995)] =\n                                        x_235010;\n                                    x_235012 = x_235010;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235001)[sext_i32_i64(local_tid_234995)] =\n                                        x_235011;\n                                    x_235013 = x_235011;\n                                }\n                            }\n                            if (sle32(wave_sizze_234997, skip_threads_235020)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_235020 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_235023 = squot32(local_tid_234995, 32) == 0 ||\n                     !ltid_in_bounds_235016;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        ",
                   "if (!no_carry_in_235023) {\n                            x_220506 = x_220504;\n                            x_220507 = x_220505;\n                            x_220504 = ((__local\n                                         double *) red_arr_mem_234999)[sext_i32_i64(squot32(local_tid_234995,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_220505 = ((__local\n                                         double *) red_arr_mem_235001)[sext_i32_i64(squot32(local_tid_234995,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_235024 =\n                             slt64(srem64(sext_i32_i64(local_tid_234995),\n                                          q_l_203577),\n                                   sext_i32_i64(local_tid_234995) -\n                                   sext_i32_i64(squot32(local_tid_234995, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_235023) {\n                            if (inactive_235024) {\n                                x_220504 = x_220506;\n                                x_220505 = x_220507;\n                            }\n                        }\n                        if (!no_carry_in_235023) {\n                            if (!inactive_235024) {\n                                double defunc_1_op_res_220508 = x_220504 +\n                                       x_220506;\n                                double defunc_1_op_res_220509 = x_220505 +\n                                       x_220507;\n                                \n                                x_22",
                   "0504 = defunc_1_op_res_220508;\n                                x_220505 = defunc_1_op_res_220509;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_235023) {\n                            ((__local\n                              double *) red_arr_mem_234999)[sext_i32_i64(local_tid_234995)] =\n                                x_220504;\n                            ((__local\n                              double *) red_arr_mem_235001)[sext_i32_i64(local_tid_234995)] =\n                                x_220505;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_234995, 32) == 0 &&\n                        ltid_in_bounds_235016) {\n                        ((__local\n                          double *) red_arr_mem_234999)[sext_i32_i64(local_tid_234995)] =\n                            x_220506;\n                        ((__local\n                          double *) red_arr_mem_235001)[sext_i32_i64(local_tid_234995)] =\n                            x_220507;\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_235005) *\n                      squot64(segred_group_sizze_220495,\n                              segment_sizze_nonzzero_234992) +\n                      sext_i32_i64(local_tid_234995), partition_sizze_203667 *\n                      l_n_m_203733) && slt64(sext_i32_i64(local_tid_234995),\n                                             squot64(segred_group_sizze_220495,\n                                                     segment_sizze_nonzzero_234992))) {\n                double tmp_235025;\n ",
                   "               \n                tmp_235025 = ((__local\n                               double *) red_arr_mem_234999)[(sext_i32_i64(local_tid_234995) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234992 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230810)[squot64(sext_i32_i64(virt_group_id_235005) *\n                                                squot64(segred_group_sizze_220495,\n                                                        segment_sizze_nonzzero_234992) +\n                                                sext_i32_i64(local_tid_234995),\n                                                l_n_m_203733) * l_n_m_203733 +\n                                        (sext_i32_i64(virt_group_id_235005) *\n                                         squot64(segred_group_sizze_220495,\n                                                 segment_sizze_nonzzero_234992) +\n                                         sext_i32_i64(local_tid_234995) -\n                                         squot64(sext_i32_i64(virt_group_id_235005) *\n                                                 squot64(segred_group_sizze_220495,\n                                                         segment_sizze_nonzzero_234992) +\n                                                 sext_i32_i64(local_tid_234995),\n                                                 l_n_m_203733) *\n                                         l_n_m_203733)] = tmp_235025;\n                \n                double tmp_235026;\n                \n                tmp_235026 = ((__local\n                               double *) red_arr_mem_235001)[(sext_i32_i64(local_tid_234995) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234992 -\n   ",
                   "                                                          (int64_t) 1];\n                ((__global\n                  double *) mem_230814)[squot64(sext_i32_i64(virt_group_id_235005) *\n                                                squot64(segred_group_sizze_220495,\n                                                        segment_sizze_nonzzero_234992) +\n                                                sext_i32_i64(local_tid_234995),\n                                                l_n_m_203733) * l_n_m_203733 +\n                                        (sext_i32_i64(virt_group_id_235005) *\n                                         squot64(segred_group_sizze_220495,\n                                                 segment_sizze_nonzzero_234992) +\n                                         sext_i32_i64(local_tid_234995) -\n                                         squot64(sext_i32_i64(virt_group_id_235005) *\n                                                 squot64(segred_group_sizze_220495,\n                                                         segment_sizze_nonzzero_234992) +\n                                                 sext_i32_i64(local_tid_234995),\n                                                 l_n_m_203733) *\n                                         l_n_m_203733)] = tmp_235026;\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_220495\n}\n__kernel void mainzisegred_small_221513(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235151_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235149_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235147_backing_aligned_2,\n ",
                   "                                       __local volatile\n                                        int64_t *red_arr_mem_235145_backing_aligned_3,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235143_backing_aligned_4,\n                                        int64_t n_203572, int64_t q_l_203577,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t l_n_m_203733, int64_t i_203760,\n                                        int64_t num_groups_221503,\n                                        int64_t ctx_param_ext_229596,\n                                        int64_t ctx_param_ext_229597,\n                                        int64_t ctx_param_ext_229599,\n                                        int64_t segment_sizze_nonzzero_235136,\n                                        __global unsigned char *ext_mem_229519,\n                                        __global unsigned char *ext_mem_229520,\n                                        __global\n                                        unsigned char *mem_param_229601,\n                                        __global unsigned char *mem_230891,\n                                        __global unsigned char *mem_230895,\n                                        __global unsigned char *mem_230899,\n                                        __global unsigned char *mem_230903,\n                                        __global unsigned char *mem_230907)\n{\n    #define segred_group_sizze_221502 (mainzisegred_group_sizze_221099)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_235151_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235151_backing_aligned_0;\n    __local v",
                   "olatile unsigned char *restrict red_arr_mem_235149_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235149_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_235147_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235147_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_235145_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235145_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_235143_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235143_backing_aligned_4;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235138;\n    int32_t local_tid_235139;\n    int64_t group_sizze_235142;\n    int32_t wave_sizze_235141;\n    int32_t group_tid_235140;\n    \n    global_tid_235138 = get_global_id(0);\n    local_tid_235139 = get_local_id(0);\n    group_sizze_235142 = get_local_size(0);\n    wave_sizze_235141 = LOCKSTEP_WIDTH;\n    group_tid_235140 = get_group_id(0);\n    \n    int32_t phys_tid_221513 = global_tid_235138;\n    __local unsigned char *red_arr_mem_235143;\n    \n    red_arr_mem_235143 = (__local unsigned char *) red_arr_mem_235143_backing_0;\n    \n    __local unsigned char *red_arr_mem_235145;\n    \n    red_arr_mem_235145 = (__local unsigned char *) red_arr_mem_235145_backing_1;\n    \n    __local unsigned char *red_arr_mem_235147;\n    \n    red_arr_mem_235147 = (__local unsigned char *) red_arr_mem_235147_backing_2;\n    \n    __local unsigned char *red_arr_mem_235149;\n    \n    red_arr_mem_235149 = (__local unsigned char *) red_arr_mem_235149_backing_3;\n    \n    __local unsigned char *red_arr_mem_235151;\n    \n    red_arr_mem_235151 = (__local unsigned char *) red",
                   "_arr_mem_235151_backing_4;\n    \n    int32_t phys_group_id_235153;\n    \n    phys_group_id_235153 = get_group_id(0);\n    for (int32_t i_235154 = 0; i_235154 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * l_n_m_203733,\n                                          squot64(segred_group_sizze_221502,\n                                                  segment_sizze_nonzzero_235136))) -\n                   phys_group_id_235153, sext_i64_i32(num_groups_221503));\n         i_235154++) {\n        int32_t virt_group_id_235155 = phys_group_id_235153 + i_235154 *\n                sext_i64_i32(num_groups_221503);\n        int64_t slice_235156 = l_n_m_203733;\n        int64_t slice_235157 = partition_sizze_203667 * slice_235156;\n        int64_t gtid_221510 = squot64(squot64(sext_i32_i64(local_tid_235139),\n                                              segment_sizze_nonzzero_235136) +\n                                      sext_i32_i64(virt_group_id_235155) *\n                                      squot64(segred_group_sizze_221502,\n                                              segment_sizze_nonzzero_235136),\n                                      slice_235156);\n        int64_t remnant_235158 = squot64(sext_i32_i64(local_tid_235139),\n                                         segment_sizze_nonzzero_235136) +\n                sext_i32_i64(virt_group_id_235155) *\n                squot64(segred_group_sizze_221502,\n                        segment_sizze_nonzzero_235136) - gtid_221510 *\n                slice_235156;\n        int64_t gtid_221511 = remnant_235158;\n        int64_t remnant_235159 = remnant_235158 - gtid_221511;\n        int64_t gtid_221512 = srem64(sext_i32_i64(local_tid_235139),\n                                     q_l_203577);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_l_203577) && ((slt64(gtid_221510,\n                                                          partition_sizze_203667) &&\n                               ",
                   "                     slt64(gtid_221511,\n                                                          l_n_m_203733)) &&\n                                                   slt64(sext_i32_i64(local_tid_235139),\n                                                         q_l_203577 *\n                                                         squot64(segred_group_sizze_221502,\n                                                                 segment_sizze_nonzzero_235136)))) {\n                int64_t x_221533;\n                \n                x_221533 = ((__global int64_t *) ext_mem_229520)[gtid_221510 *\n                                                                 l_n_m_203733 +\n                                                                 gtid_221511];\n                \n                double x_221534;\n                \n                x_221534 = ((__global double *) ext_mem_229519)[gtid_221510 *\n                                                                l_n_m_203733 +\n                                                                gtid_221511];\n                \n                int64_t binop_y_228800 = mul64(jump_t_203582, gtid_221511);\n                int64_t binop_y_228801 = smin64(i_203760, binop_y_228800);\n                int64_t index_primexp_228802 = add64((int64_t) 1,\n                                                     binop_y_228801);\n                bool cond_221537 = sle64(n_203572, gtid_221512);\n                int64_t defunc_0_f_res_221538;\n                \n                if (cond_221537) {\n                    defunc_0_f_res_221538 = (int64_t) 0;\n                } else {\n                    int64_t i_221539 = add64(gtid_221512, x_221533);\n                    int64_t defunc_1_add_res_221540 = add64((int64_t) 1,\n                                                            i_221539);\n                    \n                    defunc_0_f_res_221538 = defunc_1_add_res_221540;\n                }\n                \n                double defunc_0_f_res_221541;\n       ",
                   "         \n                if (cond_221537) {\n                    defunc_0_f_res_221541 = 0.0;\n                } else {\n                    int64_t i_221542 = add64(gtid_221512, x_221533);\n                    double defunc_0_add_arg_221543;\n                    \n                    defunc_0_add_arg_221543 = ((__global\n                                                double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                            (gtid_221510 *\n                                                                             ctx_param_ext_229597 +\n                                                                             i_221542 *\n                                                                             ctx_param_ext_229599)];\n                    defunc_0_f_res_221541 = defunc_0_add_arg_221543;\n                }\n                \n                int64_t binop_p_221544 = sub64(defunc_0_f_res_221538,\n                                               index_primexp_228802);\n                double defunc_0_f_res_221545 = sitofp_i64_f64(binop_p_221544);\n                double abs_res_221546 = fabs(defunc_0_f_res_221545);\n                double tmp1_221547 = abs_res_221546 / x_221534;\n                double x_221548 = tmp1_221547 * tmp1_221547;\n                double y_221549 = tmp1_221547 * x_221548;\n                double tmp2_221550 = 1.0 - y_221549;\n                double x_221551 = tmp2_221550 * tmp2_221550;\n                double tmp3_221552 = tmp2_221550 * x_221551;\n                double w_j_221553 = defunc_0_f_res_221541 * tmp3_221552;\n                double xw_j_221554 = defunc_0_f_res_221545 * w_j_221553;\n                double x2w_j_221555 = defunc_0_f_res_221545 * xw_j_221554;\n                double x3w_j_221556 = defunc_0_f_res_221545 * x2w_j_221555;\n                double x4w_j_221557 = defunc_0_f_res_221545 * x3w_j_221556;\n                \n                // save map-out results\n                { }\n   ",
                   "             // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_235143)[sext_i32_i64(local_tid_235139)] =\n                        w_j_221553;\n                    ((__local\n                      double *) red_arr_mem_235145)[sext_i32_i64(local_tid_235139)] =\n                        xw_j_221554;\n                    ((__local\n                      double *) red_arr_mem_235147)[sext_i32_i64(local_tid_235139)] =\n                        x2w_j_221555;\n                    ((__local\n                      double *) red_arr_mem_235149)[sext_i32_i64(local_tid_235139)] =\n                        x3w_j_221556;\n                    ((__local\n                      double *) red_arr_mem_235151)[sext_i32_i64(local_tid_235139)] =\n                        x4w_j_221557;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_235143)[sext_i32_i64(local_tid_235139)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235145)[sext_i32_i64(local_tid_235139)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235147)[sext_i32_i64(local_tid_235139)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235149)[sext_i32_i64(local_tid_235139)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235151)[sext_i32_i64(local_tid_235139)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_l_203577)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_221514;\n                double x_221515;\n                double x_221516;\n                double x_221517;\n                double x_221518;\n                double x_221519;\n                double x_221520;\n                double x_221521;\n                double ",
                   "x_221522;\n                double x_221523;\n                double x_235160;\n                double x_235161;\n                double x_235162;\n                double x_235163;\n                double x_235164;\n                double x_235165;\n                double x_235166;\n                double x_235167;\n                double x_235168;\n                double x_235169;\n                bool ltid_in_bounds_235175 =\n                     slt64(sext_i32_i64(local_tid_235139), q_l_203577 *\n                           squot64(segred_group_sizze_221502,\n                                   segment_sizze_nonzzero_235136));\n                int32_t skip_threads_235176;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_235175) {\n                        x_221519 = ((volatile __local\n                                     double *) red_arr_mem_235143)[sext_i32_i64(local_tid_235139)];\n                        x_221520 = ((volatile __local\n                                     double *) red_arr_mem_235145)[sext_i32_i64(local_tid_235139)];\n                        x_221521 = ((volatile __local\n                                     double *) red_arr_mem_235147)[sext_i32_i64(local_tid_235139)];\n                        x_221522 = ((volatile __local\n                                     double *) red_arr_mem_235149)[sext_i32_i64(local_tid_235139)];\n                        x_221523 = ((volatile __local\n                                     double *) red_arr_mem_235151)[sext_i32_i64(local_tid_235139)];\n                        if ((local_tid_235139 - squot32(local_tid_235139, 32) *\n                             32) == 0) {\n                            x_221514 = x_221519;\n                            x_221515 = x_221520;\n                            x_221516 = x_221521;\n                            x_221517 = x_221522;\n                            x_221518 = x_221523;\n                        }\n                    }\n                }\n ",
                   "               // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_235176 = 1;\n                    while (slt32(skip_threads_235176, 32)) {\n                        bool thread_active_235177 = sle32(skip_threads_235176,\n                                                          local_tid_235139 -\n                                                          squot32(local_tid_235139,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_235175;\n                        \n                        if (thread_active_235177) {\n                            // read operands\n                            {\n                                x_221514 = ((volatile __local\n                                             double *) red_arr_mem_235143)[sext_i32_i64(local_tid_235139) -\n                                                                           sext_i32_i64(skip_threads_235176)];\n                                x_221515 = ((volatile __local\n                                             double *) red_arr_mem_235145)[sext_i32_i64(local_tid_235139) -\n                                                                           sext_i32_i64(skip_threads_235176)];\n                                x_221516 = ((volatile __local\n                                             double *) red_arr_mem_235147)[sext_i32_i64(local_tid_235139) -\n                                                                           sext_i32_i64(skip_threads_235176)];\n                                x_221517 = ((volatile __local\n                                             double *) red_arr_mem_235149)[sext_i32_i64(local_tid_235139) -\n                                                                           sext_i32_i64(skip_threads_235176)];\n                                x_221518 = ((volatile __local\n                                             double *) red_arr_mem_235151)[sext_i32_i64(local_tid_235139",
                   ") -\n                                                                           sext_i32_i64(skip_threads_235176)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_235178 =\n                                 slt64(srem64(sext_i32_i64(local_tid_235139),\n                                              q_l_203577),\n                                       sext_i32_i64(local_tid_235139) -\n                                       sext_i32_i64(local_tid_235139 -\n                                       skip_threads_235176));\n                            \n                            if (thread_active_235177 && inactive_235178) {\n                                x_221514 = x_221519;\n                                x_221515 = x_221520;\n                                x_221516 = x_221521;\n                                x_221517 = x_221522;\n                                x_221518 = x_221523;\n                            }\n                            if (thread_active_235177) {\n                                if (!inactive_235178) {\n                                    double defunc_1_op_res_221524 = x_221514 +\n                                           x_221519;\n                                    double defunc_1_op_res_221525 = x_221515 +\n                                           x_221520;\n                                    double defunc_1_op_res_221526 = x_221516 +\n                                           x_221521;\n                                    double defunc_1_op_res_221527 = x_221517 +\n                                           x_221522;\n                                    double defunc_1_op_res_221528 = x_221518 +\n                                           x_221523;\n                                    \n                                    x_221514 = defunc_1_op_res_221524;\n                                    x_221515 = defunc_1_op_res_221525;\n               ",
                   "                     x_221516 = defunc_1_op_res_221526;\n                                    x_221517 = defunc_1_op_res_221527;\n                                    x_221518 = defunc_1_op_res_221528;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_235141, skip_threads_235176)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_235177) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235143)[sext_i32_i64(local_tid_235139)] =\n                                    x_221514;\n                                x_221519 = x_221514;\n                                ((volatile __local\n                                  double *) red_arr_mem_235145)[sext_i32_i64(local_tid_235139)] =\n                                    x_221515;\n                                x_221520 = x_221515;\n                                ((volatile __local\n                                  double *) red_arr_mem_235147)[sext_i32_i64(local_tid_235139)] =\n                                    x_221516;\n                                x_221521 = x_221516;\n                                ((volatile __local\n                                  double *) red_arr_mem_235149)[sext_i32_i64(local_tid_235139)] =\n                                    x_221517;\n                                x_221522 = x_221517;\n                                ((volatile __local\n                                  double *) red_arr_mem_235151)[sext_i32_i64(local_tid_235139)] =\n                                    x_221518;\n                                x_221523 = x_221518;\n                            }\n                        }\n                        if (sle32(wave_sizze_235141, skip_threads_235176)) {\n                            barrier(CLK_LOCAL_MEM_FE",
                   "NCE);\n                        }\n                        skip_threads_235176 *= 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_235139 - squot32(local_tid_235139, 32) *\n                         32) == 31 && ltid_in_bounds_235175) {\n                        ((volatile __local\n                          double *) red_arr_mem_235143)[sext_i32_i64(squot32(local_tid_235139,\n                                                                             32))] =\n                            x_221514;\n                        ((volatile __local\n                          double *) red_arr_mem_235145)[sext_i32_i64(squot32(local_tid_235139,\n                                                                             32))] =\n                            x_221515;\n                        ((volatile __local\n                          double *) red_arr_mem_235147)[sext_i32_i64(squot32(local_tid_235139,\n                                                                             32))] =\n                            x_221516;\n                        ((volatile __local\n                          double *) red_arr_mem_235149)[sext_i32_i64(squot32(local_tid_235139,\n                                                                             32))] =\n                            x_221517;\n                        ((volatile __local\n                          double *) red_arr_mem_235151)[sext_i32_i64(squot32(local_tid_235139,\n                                                                             32))] =\n                            x_221518;\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_235179;\n                    \n                    //",
                   " read input for in-block scan\n                    {\n                        if (squot32(local_tid_235139, 32) == 0 &&\n                            ltid_in_bounds_235175) {\n                            x_235165 = ((volatile __local\n                                         double *) red_arr_mem_235143)[sext_i32_i64(local_tid_235139)];\n                            x_235166 = ((volatile __local\n                                         double *) red_arr_mem_235145)[sext_i32_i64(local_tid_235139)];\n                            x_235167 = ((volatile __local\n                                         double *) red_arr_mem_235147)[sext_i32_i64(local_tid_235139)];\n                            x_235168 = ((volatile __local\n                                         double *) red_arr_mem_235149)[sext_i32_i64(local_tid_235139)];\n                            x_235169 = ((volatile __local\n                                         double *) red_arr_mem_235151)[sext_i32_i64(local_tid_235139)];\n                            if ((local_tid_235139 - squot32(local_tid_235139,\n                                                            32) * 32) == 0) {\n                                x_235160 = x_235165;\n                                x_235161 = x_235166;\n                                x_235162 = x_235167;\n                                x_235163 = x_235168;\n                                x_235164 = x_235169;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_235179 = 1;\n                        while (slt32(skip_threads_235179, 32)) {\n                            bool thread_active_235180 =\n                                 sle32(skip_threads_235179, local_tid_235139 -\n                                       squot32(local_tid_235139, 32) * 32) &&\n                                 (squot32(local_tid_235139, 32) == 0 &&\n                               ",
                   "   ltid_in_bounds_235175);\n                            \n                            if (thread_active_235180) {\n                                // read operands\n                                {\n                                    x_235160 = ((volatile __local\n                                                 double *) red_arr_mem_235143)[sext_i32_i64(local_tid_235139) -\n                                                                               sext_i32_i64(skip_threads_235179)];\n                                    x_235161 = ((volatile __local\n                                                 double *) red_arr_mem_235145)[sext_i32_i64(local_tid_235139) -\n                                                                               sext_i32_i64(skip_threads_235179)];\n                                    x_235162 = ((volatile __local\n                                                 double *) red_arr_mem_235147)[sext_i32_i64(local_tid_235139) -\n                                                                               sext_i32_i64(skip_threads_235179)];\n                                    x_235163 = ((volatile __local\n                                                 double *) red_arr_mem_235149)[sext_i32_i64(local_tid_235139) -\n                                                                               sext_i32_i64(skip_threads_235179)];\n                                    x_235164 = ((volatile __local\n                                                 double *) red_arr_mem_235151)[sext_i32_i64(local_tid_235139) -\n                                                                               sext_i32_i64(skip_threads_235179)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_235181 =\n                                     slt64(srem64(sext_i32_i64(local_tid_235139 *\n                                                  32 + 32 - ",
                   "1), q_l_203577),\n                                           sext_i32_i64(local_tid_235139 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_235139 -\n                                                         skip_threads_235179) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_235180 && inactive_235181) {\n                                    x_235160 = x_235165;\n                                    x_235161 = x_235166;\n                                    x_235162 = x_235167;\n                                    x_235163 = x_235168;\n                                    x_235164 = x_235169;\n                                }\n                                if (thread_active_235180) {\n                                    if (!inactive_235181) {\n                                        double defunc_1_op_res_235170 =\n                                               x_235160 + x_235165;\n                                        double defunc_1_op_res_235171 =\n                                               x_235161 + x_235166;\n                                        double defunc_1_op_res_235172 =\n                                               x_235162 + x_235167;\n                                        double defunc_1_op_res_235173 =\n                                               x_235163 + x_235168;\n                                        double defunc_1_op_res_235174 =\n                                               x_235164 + x_235169;\n                                        \n                                        x_235160 = defunc_1_op_res_235170;\n                                        x_235161 = defunc_1_op_res_235171;\n                                        x_235162 = defunc_1_op_res_235172;\n                                        x_235163 = defunc_1_op_res_235173;\n                                        x_23",
                   "5164 = defunc_1_op_res_235174;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_235141, skip_threads_235179)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_235180) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_235143)[sext_i32_i64(local_tid_235139)] =\n                                        x_235160;\n                                    x_235165 = x_235160;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235145)[sext_i32_i64(local_tid_235139)] =\n                                        x_235161;\n                                    x_235166 = x_235161;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235147)[sext_i32_i64(local_tid_235139)] =\n                                        x_235162;\n                                    x_235167 = x_235162;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235149)[sext_i32_i64(local_tid_235139)] =\n                                        x_235163;\n                                    x_235168 = x_235163;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235151)[sext_i32_i64(local_tid_235139)] =\n                                        x_235164;\n                                    x_235169 = x_235164;\n                                }\n                            }\n                            if (sle32(wave_sizze_235141, skip_threads_235179)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }",
                   "\n                            skip_threads_235179 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_235182 = squot32(local_tid_235139, 32) == 0 ||\n                     !ltid_in_bounds_235175;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_235182) {\n                            x_221519 = x_221514;\n                            x_221520 = x_221515;\n                            x_221521 = x_221516;\n                            x_221522 = x_221517;\n                            x_221523 = x_221518;\n                            x_221514 = ((__local\n                                         double *) red_arr_mem_235143)[sext_i32_i64(squot32(local_tid_235139,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_221515 = ((__local\n                                         double *) red_arr_mem_235145)[sext_i32_i64(squot32(local_tid_235139,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_221516 = ((__local\n                                         double *) red_arr_mem_235147)[sext_i32_i64(squot32(local_tid_235139,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_221517 = ((__local\n                                         double *) red_arr_mem_235149)[sext_i32_i64(squot32(local_tid_235139,\n                                                    ",
                   "                                        32)) -\n                                                                       (int64_t) 1];\n                            x_221518 = ((__local\n                                         double *) red_arr_mem_235151)[sext_i32_i64(squot32(local_tid_235139,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_235183 =\n                             slt64(srem64(sext_i32_i64(local_tid_235139),\n                                          q_l_203577),\n                                   sext_i32_i64(local_tid_235139) -\n                                   sext_i32_i64(squot32(local_tid_235139, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_235182) {\n                            if (inactive_235183) {\n                                x_221514 = x_221519;\n                                x_221515 = x_221520;\n                                x_221516 = x_221521;\n                                x_221517 = x_221522;\n                                x_221518 = x_221523;\n                            }\n                        }\n                        if (!no_carry_in_235182) {\n                            if (!inactive_235183) {\n                                double defunc_1_op_res_221524 = x_221514 +\n                                       x_221519;\n                                double defunc_1_op_res_221525 = x_221515 +\n                                       x_221520;\n                                double defunc_1_op_res_221526 = x_221516 +\n                                       x_221521;\n                                double defunc_1_op_res_221527 = x_221517 +\n                                       x_221522",
                   ";\n                                double defunc_1_op_res_221528 = x_221518 +\n                                       x_221523;\n                                \n                                x_221514 = defunc_1_op_res_221524;\n                                x_221515 = defunc_1_op_res_221525;\n                                x_221516 = defunc_1_op_res_221526;\n                                x_221517 = defunc_1_op_res_221527;\n                                x_221518 = defunc_1_op_res_221528;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_235182) {\n                            ((__local\n                              double *) red_arr_mem_235143)[sext_i32_i64(local_tid_235139)] =\n                                x_221514;\n                            ((__local\n                              double *) red_arr_mem_235145)[sext_i32_i64(local_tid_235139)] =\n                                x_221515;\n                            ((__local\n                              double *) red_arr_mem_235147)[sext_i32_i64(local_tid_235139)] =\n                                x_221516;\n                            ((__local\n                              double *) red_arr_mem_235149)[sext_i32_i64(local_tid_235139)] =\n                                x_221517;\n                            ((__local\n                              double *) red_arr_mem_235151)[sext_i32_i64(local_tid_235139)] =\n                                x_221518;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_235139, 32) == 0 &&\n                        ltid_in_bounds_235175) {\n                        ((__local\n                          double *) red_arr_mem_235143)[sext_i32_i64(local_tid_235139)] =\n                    ",
                   "        x_221519;\n                        ((__local\n                          double *) red_arr_mem_235145)[sext_i32_i64(local_tid_235139)] =\n                            x_221520;\n                        ((__local\n                          double *) red_arr_mem_235147)[sext_i32_i64(local_tid_235139)] =\n                            x_221521;\n                        ((__local\n                          double *) red_arr_mem_235149)[sext_i32_i64(local_tid_235139)] =\n                            x_221522;\n                        ((__local\n                          double *) red_arr_mem_235151)[sext_i32_i64(local_tid_235139)] =\n                            x_221523;\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_235155) *\n                      squot64(segred_group_sizze_221502,\n                              segment_sizze_nonzzero_235136) +\n                      sext_i32_i64(local_tid_235139), partition_sizze_203667 *\n                      l_n_m_203733) && slt64(sext_i32_i64(local_tid_235139),\n                                             squot64(segred_group_sizze_221502,\n                                                     segment_sizze_nonzzero_235136))) {\n                double tmp_235184;\n                \n                tmp_235184 = ((__local\n                               double *) red_arr_mem_235143)[(sext_i32_i64(local_tid_235139) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235136 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230891)[squot64(sext_i32_i64(virt_group_id_235155) *\n                                                squot64(segred_group_sizze_221502,\n      ",
                   "                                                  segment_sizze_nonzzero_235136) +\n                                                sext_i32_i64(local_tid_235139),\n                                                l_n_m_203733) * l_n_m_203733 +\n                                        (sext_i32_i64(virt_group_id_235155) *\n                                         squot64(segred_group_sizze_221502,\n                                                 segment_sizze_nonzzero_235136) +\n                                         sext_i32_i64(local_tid_235139) -\n                                         squot64(sext_i32_i64(virt_group_id_235155) *\n                                                 squot64(segred_group_sizze_221502,\n                                                         segment_sizze_nonzzero_235136) +\n                                                 sext_i32_i64(local_tid_235139),\n                                                 l_n_m_203733) *\n                                         l_n_m_203733)] = tmp_235184;\n                \n                double tmp_235185;\n                \n                tmp_235185 = ((__local\n                               double *) red_arr_mem_235145)[(sext_i32_i64(local_tid_235139) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235136 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230895)[squot64(sext_i32_i64(virt_group_id_235155) *\n                                                squot64(segred_group_sizze_221502,\n                                                        segment_sizze_nonzzero_235136) +\n                                                sext_i32_i64(local_tid_235139),\n                                                l_n_m_203733) * l_n_m_203733 +\n                                        (sext_i32_i64(virt_group_id_235155) *\n   ",
                   "                                      squot64(segred_group_sizze_221502,\n                                                 segment_sizze_nonzzero_235136) +\n                                         sext_i32_i64(local_tid_235139) -\n                                         squot64(sext_i32_i64(virt_group_id_235155) *\n                                                 squot64(segred_group_sizze_221502,\n                                                         segment_sizze_nonzzero_235136) +\n                                                 sext_i32_i64(local_tid_235139),\n                                                 l_n_m_203733) *\n                                         l_n_m_203733)] = tmp_235185;\n                \n                double tmp_235186;\n                \n                tmp_235186 = ((__local\n                               double *) red_arr_mem_235147)[(sext_i32_i64(local_tid_235139) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235136 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230899)[squot64(sext_i32_i64(virt_group_id_235155) *\n                                                squot64(segred_group_sizze_221502,\n                                                        segment_sizze_nonzzero_235136) +\n                                                sext_i32_i64(local_tid_235139),\n                                                l_n_m_203733) * l_n_m_203733 +\n                                        (sext_i32_i64(virt_group_id_235155) *\n                                         squot64(segred_group_sizze_221502,\n                                                 segment_sizze_nonzzero_235136) +\n                                         sext_i32_i64(local_tid_235139) -\n                                         squot64(sext_i32_i64(virt_group_id_235155) *\n        ",
                   "                                         squot64(segred_group_sizze_221502,\n                                                         segment_sizze_nonzzero_235136) +\n                                                 sext_i32_i64(local_tid_235139),\n                                                 l_n_m_203733) *\n                                         l_n_m_203733)] = tmp_235186;\n                \n                double tmp_235187;\n                \n                tmp_235187 = ((__local\n                               double *) red_arr_mem_235149)[(sext_i32_i64(local_tid_235139) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235136 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230903)[squot64(sext_i32_i64(virt_group_id_235155) *\n                                                squot64(segred_group_sizze_221502,\n                                                        segment_sizze_nonzzero_235136) +\n                                                sext_i32_i64(local_tid_235139),\n                                                l_n_m_203733) * l_n_m_203733 +\n                                        (sext_i32_i64(virt_group_id_235155) *\n                                         squot64(segred_group_sizze_221502,\n                                                 segment_sizze_nonzzero_235136) +\n                                         sext_i32_i64(local_tid_235139) -\n                                         squot64(sext_i32_i64(virt_group_id_235155) *\n                                                 squot64(segred_group_sizze_221502,\n                                                         segment_sizze_nonzzero_235136) +\n                                                 sext_i32_i64(local_tid_235139),\n                                                 l_n_m_203733) *\n           ",
                   "                              l_n_m_203733)] = tmp_235187;\n                \n                double tmp_235188;\n                \n                tmp_235188 = ((__local\n                               double *) red_arr_mem_235151)[(sext_i32_i64(local_tid_235139) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235136 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230907)[squot64(sext_i32_i64(virt_group_id_235155) *\n                                                squot64(segred_group_sizze_221502,\n                                                        segment_sizze_nonzzero_235136) +\n                                                sext_i32_i64(local_tid_235139),\n                                                l_n_m_203733) * l_n_m_203733 +\n                                        (sext_i32_i64(virt_group_id_235155) *\n                                         squot64(segred_group_sizze_221502,\n                                                 segment_sizze_nonzzero_235136) +\n                                         sext_i32_i64(local_tid_235139) -\n                                         squot64(sext_i32_i64(virt_group_id_235155) *\n                                                 squot64(segred_group_sizze_221502,\n                                                         segment_sizze_nonzzero_235136) +\n                                                 sext_i32_i64(local_tid_235139),\n                                                 l_n_m_203733) *\n                                         l_n_m_203733)] = tmp_235188;\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_221502\n}\n__kernel void mainzisegred_small_221611(__global int *global_failure",
                   ",\n                                        __local volatile\n                                        int64_t *red_arr_mem_235283_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235281_backing_aligned_1,\n                                        int64_t n_203572, int64_t q_l_203577,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t l_n_m_203733, int64_t i_203760,\n                                        int64_t num_groups_221604,\n                                        int64_t ctx_param_ext_229596,\n                                        int64_t ctx_param_ext_229597,\n                                        int64_t ctx_param_ext_229599,\n                                        int64_t segment_sizze_nonzzero_235274,\n                                        __global unsigned char *ext_mem_229519,\n                                        __global unsigned char *ext_mem_229520,\n                                        __global\n                                        unsigned char *mem_param_229601,\n                                        __global unsigned char *mem_230659,\n                                        __global unsigned char *mem_230912,\n                                        __global unsigned char *mem_230916,\n                                        __global unsigned char *mem_230920,\n                                        __global unsigned char *mem_230924,\n                                        __global unsigned char *mem_230928,\n                                        __global unsigned char *mem_230933,\n                                        __global unsigned char *mem_230937)\n{\n    #define segred_group_sizze_221603 (mainzisegred_group_sizze_220973)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n  ",
                   "  __local volatile unsigned char *restrict red_arr_mem_235283_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235283_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_235281_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235281_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235276;\n    int32_t local_tid_235277;\n    int64_t group_sizze_235280;\n    int32_t wave_sizze_235279;\n    int32_t group_tid_235278;\n    \n    global_tid_235276 = get_global_id(0);\n    local_tid_235277 = get_local_id(0);\n    group_sizze_235280 = get_local_size(0);\n    wave_sizze_235279 = LOCKSTEP_WIDTH;\n    group_tid_235278 = get_group_id(0);\n    \n    int32_t phys_tid_221611 = global_tid_235276;\n    __local unsigned char *red_arr_mem_235281;\n    \n    red_arr_mem_235281 = (__local unsigned char *) red_arr_mem_235281_backing_0;\n    \n    __local unsigned char *red_arr_mem_235283;\n    \n    red_arr_mem_235283 = (__local unsigned char *) red_arr_mem_235283_backing_1;\n    \n    int32_t phys_group_id_235285;\n    \n    phys_group_id_235285 = get_group_id(0);\n    for (int32_t i_235286 = 0; i_235286 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * l_n_m_203733,\n                                          squot64(segred_group_sizze_221603,\n                                                  segment_sizze_nonzzero_235274))) -\n                   phys_group_id_235285, sext_i64_i32(num_groups_221604));\n         i_235286++) {\n        int32_t virt_group_id_235287 = phys_group_id_235285 + i_235286 *\n                sext_i64_i32(num_groups_221604);\n        int64_t slice_235288 = l_n_m_203733;\n        int64_t slice_235289 = partition_sizze_203667 * slice_235288;\n        int64_t gtid_221608 = squot64(squot64(sext_i32_i64(local_tid_235277),\n                              ",
                   "                segment_sizze_nonzzero_235274) +\n                                      sext_i32_i64(virt_group_id_235287) *\n                                      squot64(segred_group_sizze_221603,\n                                              segment_sizze_nonzzero_235274),\n                                      slice_235288);\n        int64_t remnant_235290 = squot64(sext_i32_i64(local_tid_235277),\n                                         segment_sizze_nonzzero_235274) +\n                sext_i32_i64(virt_group_id_235287) *\n                squot64(segred_group_sizze_221603,\n                        segment_sizze_nonzzero_235274) - gtid_221608 *\n                slice_235288;\n        int64_t gtid_221609 = remnant_235290;\n        int64_t remnant_235291 = remnant_235290 - gtid_221609;\n        int64_t gtid_221610 = srem64(sext_i32_i64(local_tid_235277),\n                                     q_l_203577);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_l_203577) && ((slt64(gtid_221608,\n                                                          partition_sizze_203667) &&\n                                                    slt64(gtid_221609,\n                                                          l_n_m_203733)) &&\n                                                   slt64(sext_i32_i64(local_tid_235277),\n                                                         q_l_203577 *\n                                                         squot64(segred_group_sizze_221603,\n                                                                 segment_sizze_nonzzero_235274)))) {\n                int64_t x_221628;\n                \n                x_221628 = ((__global int64_t *) ext_mem_229520)[gtid_221608 *\n                                                                 l_n_m_203733 +\n                                                                 gtid_221609];\n                \n                double x_221629;\n                \n                x_2",
                   "21629 = ((__global double *) ext_mem_229519)[gtid_221608 *\n                                                                l_n_m_203733 +\n                                                                gtid_221609];\n                \n                int64_t binop_y_228795 = mul64(jump_t_203582, gtid_221609);\n                int64_t binop_y_228796 = smin64(i_203760, binop_y_228795);\n                int64_t index_primexp_228797 = add64((int64_t) 1,\n                                                     binop_y_228796);\n                double a12_221631;\n                \n                a12_221631 = ((__global double *) mem_230912)[gtid_221608 *\n                                                              l_n_m_203733 +\n                                                              gtid_221609];\n                \n                double b12_221632;\n                \n                b12_221632 = ((__global double *) mem_230916)[gtid_221608 *\n                                                              l_n_m_203733 +\n                                                              gtid_221609];\n                \n                double c12_221633;\n                \n                c12_221633 = ((__global double *) mem_230920)[gtid_221608 *\n                                                              l_n_m_203733 +\n                                                              gtid_221609];\n                \n                double b2_221634;\n                \n                b2_221634 = ((__global double *) mem_230924)[gtid_221608 *\n                                                             l_n_m_203733 +\n                                                             gtid_221609];\n                \n                double c2_221635;\n                \n                c2_221635 = ((__global double *) mem_230928)[gtid_221608 *\n                                                             l_n_m_203733 +\n                                                             gtid_221609];\n               ",
                   " \n                bool cond_221637 = sle64(n_203572, gtid_221610);\n                int64_t defunc_0_f_res_221638;\n                \n                if (cond_221637) {\n                    defunc_0_f_res_221638 = (int64_t) 0;\n                } else {\n                    int64_t i_221639 = add64(gtid_221610, x_221628);\n                    int64_t defunc_1_add_res_221640 = add64((int64_t) 1,\n                                                            i_221639);\n                    \n                    defunc_0_f_res_221638 = defunc_1_add_res_221640;\n                }\n                \n                double defunc_0_f_res_221641;\n                \n                if (cond_221637) {\n                    defunc_0_f_res_221641 = 0.0;\n                } else {\n                    int64_t i_221642 = add64(gtid_221610, x_221628);\n                    double defunc_0_add_arg_221643;\n                    \n                    defunc_0_add_arg_221643 = ((__global\n                                                double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                            (gtid_221608 *\n                                                                             ctx_param_ext_229597 +\n                                                                             i_221642 *\n                                                                             ctx_param_ext_229599)];\n                    defunc_0_f_res_221641 = defunc_0_add_arg_221643;\n                }\n                \n                int64_t binop_p_221644 = sub64(defunc_0_f_res_221638,\n                                               index_primexp_228797);\n                double defunc_0_f_res_221645 = sitofp_i64_f64(binop_p_221644);\n                double abs_res_221646 = fabs(defunc_0_f_res_221645);\n                double tmp1_221647 = abs_res_221646 / x_221629;\n                double x_221648 = tmp1_221647 * tmp1_221647;\n                double y_221649 = tmp1_221647 *",
                   " x_221648;\n                double tmp2_221650 = 1.0 - y_221649;\n                double x_221651 = tmp2_221650 * tmp2_221650;\n                double tmp3_221652 = tmp2_221650 * x_221651;\n                double tmp4_221653 = defunc_0_f_res_221641 * tmp3_221652;\n                double defunc_1_f_res_221654 = defunc_0_f_res_221645 *\n                       tmp4_221653;\n                double defunc_1_f_res_221655 = defunc_0_f_res_221645 *\n                       defunc_1_f_res_221654;\n                double defunc_0_f_res_221656;\n                \n                if (cond_221637) {\n                    defunc_0_f_res_221656 = 0.0;\n                } else {\n                    int64_t i_221657 = add64(gtid_221610, x_221628);\n                    double defunc_0_add_arg_221658;\n                    \n                    defunc_0_add_arg_221658 = ((__global\n                                                double *) mem_230659)[gtid_221608 *\n                                                                      n_203572 +\n                                                                      i_221657];\n                    defunc_0_f_res_221656 = defunc_0_add_arg_221658;\n                }\n                \n                double x_221659 = a12_221631 * tmp4_221653;\n                double y_221660 = b12_221632 * defunc_1_f_res_221654;\n                double x_221661 = x_221659 + y_221660;\n                double y_221662 = c12_221633 * defunc_1_f_res_221655;\n                double x_221663 = x_221661 + y_221662;\n                double defunc_9_fit_fun_res_221664 = defunc_0_f_res_221656 *\n                       x_221663;\n                double x_221665 = b12_221632 * tmp4_221653;\n                double y_221666 = b2_221634 * defunc_1_f_res_221654;\n                double x_221667 = x_221665 + y_221666;\n                double y_221668 = c2_221635 * defunc_1_f_res_221655;\n                double x_221669 = x_221667 + y_221668;\n                double defunc_9_slope_fun_res_221670 = defunc_0_f_r",
                   "es_221656 *\n                       x_221669;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_235281)[sext_i32_i64(local_tid_235277)] =\n                        defunc_9_fit_fun_res_221664;\n                    ((__local\n                      double *) red_arr_mem_235283)[sext_i32_i64(local_tid_235277)] =\n                        defunc_9_slope_fun_res_221670;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_235281)[sext_i32_i64(local_tid_235277)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235283)[sext_i32_i64(local_tid_235277)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_l_203577)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_221612;\n                double x_221613;\n                double x_221614;\n                double x_221615;\n                double x_235292;\n                double x_235293;\n                double x_235294;\n                double x_235295;\n                bool ltid_in_bounds_235298 =\n                     slt64(sext_i32_i64(local_tid_235277), q_l_203577 *\n                           squot64(segred_group_sizze_221603,\n                                   segment_sizze_nonzzero_235274));\n                int32_t skip_threads_235299;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_235298) {\n                        x_221614 = ((volatile __local\n                                     double *) red_arr_mem_235281)[sext_i32_i64(local_tid_235277)];\n                        x_221615 = ((volatile __local\n                                     double *) red_arr_mem_235283)[sext_i32_i64(local_tid_23",
                   "5277)];\n                        if ((local_tid_235277 - squot32(local_tid_235277, 32) *\n                             32) == 0) {\n                            x_221612 = x_221614;\n                            x_221613 = x_221615;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_235299 = 1;\n                    while (slt32(skip_threads_235299, 32)) {\n                        bool thread_active_235300 = sle32(skip_threads_235299,\n                                                          local_tid_235277 -\n                                                          squot32(local_tid_235277,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_235298;\n                        \n                        if (thread_active_235300) {\n                            // read operands\n                            {\n                                x_221612 = ((volatile __local\n                                             double *) red_arr_mem_235281)[sext_i32_i64(local_tid_235277) -\n                                                                           sext_i32_i64(skip_threads_235299)];\n                                x_221613 = ((volatile __local\n                                             double *) red_arr_mem_235283)[sext_i32_i64(local_tid_235277) -\n                                                                           sext_i32_i64(skip_threads_235299)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_235301 =\n                                 slt64(srem64(sext_i32_i64(local_tid_235277),\n                                              q_l_203577),\n                                       sext_i32_i64(local_tid_235277) -\n                                       sext_i32",
                   "_i64(local_tid_235277 -\n                                       skip_threads_235299));\n                            \n                            if (thread_active_235300 && inactive_235301) {\n                                x_221612 = x_221614;\n                                x_221613 = x_221615;\n                            }\n                            if (thread_active_235300) {\n                                if (!inactive_235301) {\n                                    double defunc_1_op_res_221616 = x_221612 +\n                                           x_221614;\n                                    double defunc_1_op_res_221617 = x_221613 +\n                                           x_221615;\n                                    \n                                    x_221612 = defunc_1_op_res_221616;\n                                    x_221613 = defunc_1_op_res_221617;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_235279, skip_threads_235299)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_235300) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235281)[sext_i32_i64(local_tid_235277)] =\n                                    x_221612;\n                                x_221614 = x_221612;\n                                ((volatile __local\n                                  double *) red_arr_mem_235283)[sext_i32_i64(local_tid_235277)] =\n                                    x_221613;\n                                x_221615 = x_221613;\n                            }\n                        }\n                        if (sle32(wave_sizze_235279, skip_threads_235299)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_",
                   "threads_235299 *= 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_235277 - squot32(local_tid_235277, 32) *\n                         32) == 31 && ltid_in_bounds_235298) {\n                        ((volatile __local\n                          double *) red_arr_mem_235281)[sext_i32_i64(squot32(local_tid_235277,\n                                                                             32))] =\n                            x_221612;\n                        ((volatile __local\n                          double *) red_arr_mem_235283)[sext_i32_i64(squot32(local_tid_235277,\n                                                                             32))] =\n                            x_221613;\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_235302;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_235277, 32) == 0 &&\n                            ltid_in_bounds_235298) {\n                            x_235294 = ((volatile __local\n                                         double *) red_arr_mem_235281)[sext_i32_i64(local_tid_235277)];\n                            x_235295 = ((volatile __local\n                                         double *) red_arr_mem_235283)[sext_i32_i64(local_tid_235277)];\n                            if ((local_tid_235277 - squot32(local_tid_235277,\n                                                            32) * 32) == 0) {\n                                x_235292 = x_235294;\n                                x_235293 = x_235295;\n                            }\n                        }\n                    }\n         ",
                   "           // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_235302 = 1;\n                        while (slt32(skip_threads_235302, 32)) {\n                            bool thread_active_235303 =\n                                 sle32(skip_threads_235302, local_tid_235277 -\n                                       squot32(local_tid_235277, 32) * 32) &&\n                                 (squot32(local_tid_235277, 32) == 0 &&\n                                  ltid_in_bounds_235298);\n                            \n                            if (thread_active_235303) {\n                                // read operands\n                                {\n                                    x_235292 = ((volatile __local\n                                                 double *) red_arr_mem_235281)[sext_i32_i64(local_tid_235277) -\n                                                                               sext_i32_i64(skip_threads_235302)];\n                                    x_235293 = ((volatile __local\n                                                 double *) red_arr_mem_235283)[sext_i32_i64(local_tid_235277) -\n                                                                               sext_i32_i64(skip_threads_235302)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_235304 =\n                                     slt64(srem64(sext_i32_i64(local_tid_235277 *\n                                                  32 + 32 - 1), q_l_203577),\n                                           sext_i32_i64(local_tid_235277 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_235277 -\n                                                         skip_threads_235302) *\n                                           32 + 32 - 1));\n    ",
                   "                            \n                                if (thread_active_235303 && inactive_235304) {\n                                    x_235292 = x_235294;\n                                    x_235293 = x_235295;\n                                }\n                                if (thread_active_235303) {\n                                    if (!inactive_235304) {\n                                        double defunc_1_op_res_235296 =\n                                               x_235292 + x_235294;\n                                        double defunc_1_op_res_235297 =\n                                               x_235293 + x_235295;\n                                        \n                                        x_235292 = defunc_1_op_res_235296;\n                                        x_235293 = defunc_1_op_res_235297;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_235279, skip_threads_235302)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_235303) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_235281)[sext_i32_i64(local_tid_235277)] =\n                                        x_235292;\n                                    x_235294 = x_235292;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235283)[sext_i32_i64(local_tid_235277)] =\n                                        x_235293;\n                                    x_235295 = x_235293;\n                                }\n                            }\n                            if (sle32(wave_sizze_235279, skip_threads_235302)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n     ",
                   "                       }\n                            skip_threads_235302 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_235305 = squot32(local_tid_235277, 32) == 0 ||\n                     !ltid_in_bounds_235298;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_235305) {\n                            x_221614 = x_221612;\n                            x_221615 = x_221613;\n                            x_221612 = ((__local\n                                         double *) red_arr_mem_235281)[sext_i32_i64(squot32(local_tid_235277,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_221613 = ((__local\n                                         double *) red_arr_mem_235283)[sext_i32_i64(squot32(local_tid_235277,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_235306 =\n                             slt64(srem64(sext_i32_i64(local_tid_235277),\n                                          q_l_203577),\n                                   sext_i32_i64(local_tid_235277) -\n                                   sext_i32_i64(squot32(local_tid_235277, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_235305) {\n                            if (inactive_235306) {\n                                x_221612 = x_221614;\n                 ",
                   "               x_221613 = x_221615;\n                            }\n                        }\n                        if (!no_carry_in_235305) {\n                            if (!inactive_235306) {\n                                double defunc_1_op_res_221616 = x_221612 +\n                                       x_221614;\n                                double defunc_1_op_res_221617 = x_221613 +\n                                       x_221615;\n                                \n                                x_221612 = defunc_1_op_res_221616;\n                                x_221613 = defunc_1_op_res_221617;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_235305) {\n                            ((__local\n                              double *) red_arr_mem_235281)[sext_i32_i64(local_tid_235277)] =\n                                x_221612;\n                            ((__local\n                              double *) red_arr_mem_235283)[sext_i32_i64(local_tid_235277)] =\n                                x_221613;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_235277, 32) == 0 &&\n                        ltid_in_bounds_235298) {\n                        ((__local\n                          double *) red_arr_mem_235281)[sext_i32_i64(local_tid_235277)] =\n                            x_221614;\n                        ((__local\n                          double *) red_arr_mem_235283)[sext_i32_i64(local_tid_235277)] =\n                            x_221615;\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_235287) *\n                      squot64(segred_group_sizze_221603,\n                              segment_sizze_nonzzero_235274) +\n                      sext_i32_i64(local_tid_235277), partition_sizze_203667 *\n                      l_n_m_203733) && slt64(sext_i32_i64(local_tid_235277),\n                                             squot64(segred_group_sizze_221603,\n                                                     segment_sizze_nonzzero_235274))) {\n                double tmp_235307;\n                \n                tmp_235307 = ((__local\n                               double *) red_arr_mem_235281)[(sext_i32_i64(local_tid_235277) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235274 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230933)[squot64(sext_i32_i64(virt_group_id_235287) *\n                                                squot64(segred_group_sizze_221603,\n                                                        segment_sizze_nonzzero_235274) +\n                                                sext_i32_i64(local_tid_235277),\n                                                l_n_m_203733) * l_n_m_203733 +\n                                        (sext_i32_i64(virt_group_id_235287) *\n                                         squot64(segred_group_sizze_221603,\n                                                 segment_sizze_nonzzero_235274) +\n                                         sext_i32_i64(local_tid_235277) -\n                                         squot64(sext_i32_i64(virt_group_id_235287) *\n                                                 squot64(segred_group_sizze_221603,\n                                                         segment_sizze_nonzzero_235274) +\n                                                 sext_i32_i64(local_tid_235277),",
                   "\n                                                 l_n_m_203733) *\n                                         l_n_m_203733)] = tmp_235307;\n                \n                double tmp_235308;\n                \n                tmp_235308 = ((__local\n                               double *) red_arr_mem_235283)[(sext_i32_i64(local_tid_235277) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235274 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230937)[squot64(sext_i32_i64(virt_group_id_235287) *\n                                                squot64(segred_group_sizze_221603,\n                                                        segment_sizze_nonzzero_235274) +\n                                                sext_i32_i64(local_tid_235277),\n                                                l_n_m_203733) * l_n_m_203733 +\n                                        (sext_i32_i64(virt_group_id_235287) *\n                                         squot64(segred_group_sizze_221603,\n                                                 segment_sizze_nonzzero_235274) +\n                                         sext_i32_i64(local_tid_235277) -\n                                         squot64(sext_i32_i64(virt_group_id_235287) *\n                                                 squot64(segred_group_sizze_221603,\n                                                         segment_sizze_nonzzero_235274) +\n                                                 sext_i32_i64(local_tid_235277),\n                                                 l_n_m_203733) *\n                                         l_n_m_203733)] = tmp_235308;\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_",
                   "221603\n}\n__kernel void mainzisegred_small_223287(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235531_backing_aligned_0,\n                                        int64_t n_203572, int64_t q_t_203576,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t t_n_m_203740, int64_t i_203760,\n                                        int64_t num_groups_223281,\n                                        int64_t segment_sizze_nonzzero_235524,\n                                        __global unsigned char *ext_mem_229304,\n                                        __global unsigned char *ext_mem_229305,\n                                        __global unsigned char *ext_mem_229568,\n                                        __global unsigned char *ext_mem_229569,\n                                        __global unsigned char *mem_231121,\n                                        __global unsigned char *mem_231135)\n{\n    #define segred_group_sizze_223280 (mainzisegred_group_sizze_222884)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_235531_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235531_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235526;\n    int32_t local_tid_235527;\n    int64_t group_sizze_235530;\n    int32_t wave_sizze_235529;\n    int32_t group_tid_235528;\n    \n    global_tid_235526 = get_global_id(0);\n    local_tid_235527 = get_local_id(0);\n    group_sizze_235530 = get_local_size(0);\n    wave_sizze_235529 = LOCKSTEP_WIDTH;\n    group_tid_235528 = get_group_id(0);\n    \n    int32_t phys_tid_223287 = global_tid_235526;\n  ",
                   "  __local unsigned char *red_arr_mem_235531;\n    \n    red_arr_mem_235531 = (__local unsigned char *) red_arr_mem_235531_backing_0;\n    \n    int32_t phys_group_id_235533;\n    \n    phys_group_id_235533 = get_group_id(0);\n    for (int32_t i_235534 = 0; i_235534 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * t_n_m_203740,\n                                          squot64(segred_group_sizze_223280,\n                                                  segment_sizze_nonzzero_235524))) -\n                   phys_group_id_235533, sext_i64_i32(num_groups_223281));\n         i_235534++) {\n        int32_t virt_group_id_235535 = phys_group_id_235533 + i_235534 *\n                sext_i64_i32(num_groups_223281);\n        int64_t slice_235536 = t_n_m_203740;\n        int64_t slice_235537 = partition_sizze_203667 * slice_235536;\n        int64_t gtid_223284 = squot64(squot64(sext_i32_i64(local_tid_235527),\n                                              segment_sizze_nonzzero_235524) +\n                                      sext_i32_i64(virt_group_id_235535) *\n                                      squot64(segred_group_sizze_223280,\n                                              segment_sizze_nonzzero_235524),\n                                      slice_235536);\n        int64_t remnant_235538 = squot64(sext_i32_i64(local_tid_235527),\n                                         segment_sizze_nonzzero_235524) +\n                sext_i32_i64(virt_group_id_235535) *\n                squot64(segred_group_sizze_223280,\n                        segment_sizze_nonzzero_235524) - gtid_223284 *\n                slice_235536;\n        int64_t gtid_223285 = remnant_235538;\n        int64_t remnant_235539 = remnant_235538 - gtid_223285;\n        int64_t gtid_223286 = srem64(sext_i32_i64(local_tid_235527),\n                                     q_t_203576);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_t_203576) && ((slt64(gtid_223284,\n            ",
                   "                                              partition_sizze_203667) &&\n                                                    slt64(gtid_223285,\n                                                          t_n_m_203740)) &&\n                                                   slt64(sext_i32_i64(local_tid_235527),\n                                                         q_t_203576 *\n                                                         squot64(segred_group_sizze_223280,\n                                                                 segment_sizze_nonzzero_235524)))) {\n                int64_t x_223292;\n                \n                x_223292 = ((__global int64_t *) ext_mem_229304)[gtid_223284];\n                \n                int64_t x_223297;\n                \n                x_223297 = ((__global int64_t *) ext_mem_229569)[gtid_223284 *\n                                                                 t_n_m_203740 +\n                                                                 gtid_223285];\n                \n                double x_223298;\n                \n                x_223298 = ((__global double *) ext_mem_229568)[gtid_223284 *\n                                                                t_n_m_203740 +\n                                                                gtid_223285];\n                \n                int64_t binop_y_228750 = mul64(jump_t_203582, gtid_223285);\n                int64_t binop_y_228751 = smin64(i_203760, binop_y_228750);\n                int64_t index_primexp_228752 = add64((int64_t) 1,\n                                                     binop_y_228751);\n                bool cond_223301 = sle64(x_223292, gtid_223286);\n                int64_t defunc_0_f_res_223302;\n                \n                if (cond_223301) {\n                    defunc_0_f_res_223302 = (int64_t) 0;\n                } else {\n                    int64_t i_223303 = add64(gtid_223286, x_223297);\n                    int64_t defunc_0_add_arg_223304;\n                  ",
                   "  \n                    defunc_0_add_arg_223304 = ((__global\n                                                int64_t *) ext_mem_229305)[gtid_223284 *\n                                                                           n_203572 +\n                                                                           i_223303];\n                    \n                    int64_t defunc_1_add_res_223305 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_223304);\n                    \n                    defunc_0_f_res_223302 = defunc_1_add_res_223305;\n                }\n                \n                double defunc_0_f_res_223306;\n                \n                if (cond_223301) {\n                    defunc_0_f_res_223306 = 0.0;\n                } else {\n                    int64_t i_223307 = add64(gtid_223286, x_223297);\n                    double defunc_0_add_arg_223308;\n                    \n                    defunc_0_add_arg_223308 = ((__global\n                                                double *) mem_231121)[gtid_223284 *\n                                                                      n_203572 +\n                                                                      i_223307];\n                    defunc_0_f_res_223306 = defunc_0_add_arg_223308;\n                }\n                \n                int64_t binop_p_223309 = sub64(defunc_0_f_res_223302,\n                                               index_primexp_228752);\n                double defunc_0_f_res_223310 = sitofp_i64_f64(binop_p_223309);\n                double abs_res_223311 = fabs(defunc_0_f_res_223310);\n                double tmp1_223312 = abs_res_223311 / x_223298;\n                double x_223313 = tmp1_223312 * tmp1_223312;\n                double y_223314 = tmp1_223312 * x_223313;\n                double tmp2_223315 = 1.0 - y_223314;\n                double x_223316 = tmp2_223315 * tmp2_223315;\n                double tmp3_223317 = tmp2_223315 * x_223316;\n       ",
                   "         double w_j_223318 = defunc_0_f_res_223306 * tmp3_223317;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_235531)[sext_i32_i64(local_tid_235527)] =\n                        w_j_223318;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_235531)[sext_i32_i64(local_tid_235527)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_t_203576)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_223288;\n                double x_223289;\n                double x_235540;\n                double x_235541;\n                bool ltid_in_bounds_235543 =\n                     slt64(sext_i32_i64(local_tid_235527), q_t_203576 *\n                           squot64(segred_group_sizze_223280,\n                                   segment_sizze_nonzzero_235524));\n                int32_t skip_threads_235544;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_235543) {\n                        x_223289 = ((volatile __local\n                                     double *) red_arr_mem_235531)[sext_i32_i64(local_tid_235527)];\n                        if ((local_tid_235527 - squot32(local_tid_235527, 32) *\n                             32) == 0) {\n                            x_223288 = x_223289;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_235544 = 1;\n                    while (slt32(skip_threads_235544, 32)) {\n                        bool thread_active_235545 = sle32(skip_threads_235544,\n                                                          local_tid_235527 ",
                   "-\n                                                          squot32(local_tid_235527,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_235543;\n                        \n                        if (thread_active_235545) {\n                            // read operands\n                            {\n                                x_223288 = ((volatile __local\n                                             double *) red_arr_mem_235531)[sext_i32_i64(local_tid_235527) -\n                                                                           sext_i32_i64(skip_threads_235544)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_235546 =\n                                 slt64(srem64(sext_i32_i64(local_tid_235527),\n                                              q_t_203576),\n                                       sext_i32_i64(local_tid_235527) -\n                                       sext_i32_i64(local_tid_235527 -\n                                       skip_threads_235544));\n                            \n                            if (thread_active_235545 && inactive_235546) {\n                                x_223288 = x_223289;\n                            }\n                            if (thread_active_235545) {\n                                if (!inactive_235546) {\n                                    double defunc_1_op_res_223290 = x_223288 +\n                                           x_223289;\n                                    \n                                    x_223288 = defunc_1_op_res_223290;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_235529, skip_threads_235544)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_activ",
                   "e_235545) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235531)[sext_i32_i64(local_tid_235527)] =\n                                    x_223288;\n                                x_223289 = x_223288;\n                            }\n                        }\n                        if (sle32(wave_sizze_235529, skip_threads_235544)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_235544 *= 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_235527 - squot32(local_tid_235527, 32) *\n                         32) == 31 && ltid_in_bounds_235543) {\n                        ((volatile __local\n                          double *) red_arr_mem_235531)[sext_i32_i64(squot32(local_tid_235527,\n                                                                             32))] =\n                            x_223288;\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_235547;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_235527, 32) == 0 &&\n                            ltid_in_bounds_235543) {\n                            x_235541 = ((volatile __local\n                                         double *) red_arr_mem_235531)[sext_i32_i64(local_tid_235527)];\n                            if ((local_tid_235527 - squot32(local_tid_235527,\n                                                            32) * 32) == 0) {\n                                x_23",
                   "5540 = x_235541;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_235547 = 1;\n                        while (slt32(skip_threads_235547, 32)) {\n                            bool thread_active_235548 =\n                                 sle32(skip_threads_235547, local_tid_235527 -\n                                       squot32(local_tid_235527, 32) * 32) &&\n                                 (squot32(local_tid_235527, 32) == 0 &&\n                                  ltid_in_bounds_235543);\n                            \n                            if (thread_active_235548) {\n                                // read operands\n                                {\n                                    x_235540 = ((volatile __local\n                                                 double *) red_arr_mem_235531)[sext_i32_i64(local_tid_235527) -\n                                                                               sext_i32_i64(skip_threads_235547)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_235549 =\n                                     slt64(srem64(sext_i32_i64(local_tid_235527 *\n                                                  32 + 32 - 1), q_t_203576),\n                                           sext_i32_i64(local_tid_235527 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_235527 -\n                                                         skip_threads_235547) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_235548 && inactive_235549) {\n                                    x_235540 = x_235541;\n                        ",
                   "        }\n                                if (thread_active_235548) {\n                                    if (!inactive_235549) {\n                                        double defunc_1_op_res_235542 =\n                                               x_235540 + x_235541;\n                                        \n                                        x_235540 = defunc_1_op_res_235542;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_235529, skip_threads_235547)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_235548) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_235531)[sext_i32_i64(local_tid_235527)] =\n                                        x_235540;\n                                    x_235541 = x_235540;\n                                }\n                            }\n                            if (sle32(wave_sizze_235529, skip_threads_235547)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_235547 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_235550 = squot32(local_tid_235527, 32) == 0 ||\n                     !ltid_in_bounds_235543;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_235550) {\n                            x_223289 = x_223288;\n                            x_223288 = ((__local\n                                         double *) red_arr_mem_235531)[sext_i32_i64(squo",
                   "t32(local_tid_235527,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_235551 =\n                             slt64(srem64(sext_i32_i64(local_tid_235527),\n                                          q_t_203576),\n                                   sext_i32_i64(local_tid_235527) -\n                                   sext_i32_i64(squot32(local_tid_235527, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_235550) {\n                            if (inactive_235551) {\n                                x_223288 = x_223289;\n                            }\n                        }\n                        if (!no_carry_in_235550) {\n                            if (!inactive_235551) {\n                                double defunc_1_op_res_223290 = x_223288 +\n                                       x_223289;\n                                \n                                x_223288 = defunc_1_op_res_223290;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_235550) {\n                            ((__local\n                              double *) red_arr_mem_235531)[sext_i32_i64(local_tid_235527)] =\n                                x_223288;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_235527, 32) == 0 &&\n                        ltid_in_bounds_235543) {\n                        ((__local\n                          double *) red_arr_mem_235",
                   "531)[sext_i32_i64(local_tid_235527)] =\n                            x_223289;\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_235535) *\n                      squot64(segred_group_sizze_223280,\n                              segment_sizze_nonzzero_235524) +\n                      sext_i32_i64(local_tid_235527), partition_sizze_203667 *\n                      t_n_m_203740) && slt64(sext_i32_i64(local_tid_235527),\n                                             squot64(segred_group_sizze_223280,\n                                                     segment_sizze_nonzzero_235524))) {\n                double tmp_235552;\n                \n                tmp_235552 = ((__local\n                               double *) red_arr_mem_235531)[(sext_i32_i64(local_tid_235527) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235524 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231135)[squot64(sext_i32_i64(virt_group_id_235535) *\n                                                squot64(segred_group_sizze_223280,\n                                                        segment_sizze_nonzzero_235524) +\n                                                sext_i32_i64(local_tid_235527),\n                                                t_n_m_203740) * t_n_m_203740 +\n                                        (sext_i32_i64(virt_group_id_235535) *\n                                         squot64(segred_group_sizze_223280,\n                                                 segment_sizze_nonzzero_235524) +\n                                         sext_i32_i64(local_tid_235527) -\n                                     ",
                   "    squot64(sext_i32_i64(virt_group_id_235535) *\n                                                 squot64(segred_group_sizze_223280,\n                                                         segment_sizze_nonzzero_235524) +\n                                                 sext_i32_i64(local_tid_235527),\n                                                 t_n_m_203740) *\n                                         t_n_m_203740)] = tmp_235552;\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_223280\n}\n__kernel void mainzisegred_small_223339(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235613_backing_aligned_0,\n                                        int64_t n_203572, int64_t q_t_203576,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t t_n_m_203740, int64_t i_203760,\n                                        int64_t num_groups_223333,\n                                        int64_t segment_sizze_nonzzero_235606,\n                                        __global unsigned char *ext_mem_229304,\n                                        __global unsigned char *ext_mem_229305,\n                                        __global unsigned char *ext_mem_229568,\n                                        __global unsigned char *ext_mem_229569,\n                                        __global unsigned char *mem_231121,\n                                        __global unsigned char *mem_231125,\n                                        __global unsigned char *mem_231140,\n                                        __global unsigned char *mem_231145)\n{\n    #define segred_group_sizze_223332 (mainzisegred_group_sizze_222814)\n    \n    const",
                   " int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_235613_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235613_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235608;\n    int32_t local_tid_235609;\n    int64_t group_sizze_235612;\n    int32_t wave_sizze_235611;\n    int32_t group_tid_235610;\n    \n    global_tid_235608 = get_global_id(0);\n    local_tid_235609 = get_local_id(0);\n    group_sizze_235612 = get_local_size(0);\n    wave_sizze_235611 = LOCKSTEP_WIDTH;\n    group_tid_235610 = get_group_id(0);\n    \n    int32_t phys_tid_223339 = global_tid_235608;\n    __local unsigned char *red_arr_mem_235613;\n    \n    red_arr_mem_235613 = (__local unsigned char *) red_arr_mem_235613_backing_0;\n    \n    int32_t phys_group_id_235615;\n    \n    phys_group_id_235615 = get_group_id(0);\n    for (int32_t i_235616 = 0; i_235616 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * t_n_m_203740,\n                                          squot64(segred_group_sizze_223332,\n                                                  segment_sizze_nonzzero_235606))) -\n                   phys_group_id_235615, sext_i64_i32(num_groups_223333));\n         i_235616++) {\n        int32_t virt_group_id_235617 = phys_group_id_235615 + i_235616 *\n                sext_i64_i32(num_groups_223333);\n        int64_t slice_235618 = t_n_m_203740;\n        int64_t slice_235619 = partition_sizze_203667 * slice_235618;\n        int64_t gtid_223336 = squot64(squot64(sext_i32_i64(local_tid_235609),\n                                              segment_sizze_nonzzero_235606) +\n                                      sext_i32_i64(virt_group_id_235617) *\n                                      squot64(segred_group_sizze_223332,\n                                              segment_sizze_nonzzero_235606),\n",
                   "                                      slice_235618);\n        int64_t remnant_235620 = squot64(sext_i32_i64(local_tid_235609),\n                                         segment_sizze_nonzzero_235606) +\n                sext_i32_i64(virt_group_id_235617) *\n                squot64(segred_group_sizze_223332,\n                        segment_sizze_nonzzero_235606) - gtid_223336 *\n                slice_235618;\n        int64_t gtid_223337 = remnant_235620;\n        int64_t remnant_235621 = remnant_235620 - gtid_223337;\n        int64_t gtid_223338 = srem64(sext_i32_i64(local_tid_235609),\n                                     q_t_203576);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_t_203576) && ((slt64(gtid_223336,\n                                                          partition_sizze_203667) &&\n                                                    slt64(gtid_223337,\n                                                          t_n_m_203740)) &&\n                                                   slt64(sext_i32_i64(local_tid_235609),\n                                                         q_t_203576 *\n                                                         squot64(segred_group_sizze_223332,\n                                                                 segment_sizze_nonzzero_235606)))) {\n                int64_t x_223344;\n                \n                x_223344 = ((__global int64_t *) ext_mem_229304)[gtid_223336];\n                \n                int64_t x_223351;\n                \n                x_223351 = ((__global int64_t *) ext_mem_229569)[gtid_223336 *\n                                                                 t_n_m_203740 +\n                                                                 gtid_223337];\n                \n                double x_223352;\n                \n                x_223352 = ((__global double *) ext_mem_229568)[gtid_223336 *\n                                                                t_n_m",
                   "_203740 +\n                                                                gtid_223337];\n                \n                int64_t binop_y_228745 = mul64(jump_t_203582, gtid_223337);\n                int64_t binop_y_228746 = smin64(i_203760, binop_y_228745);\n                int64_t index_primexp_228747 = add64((int64_t) 1,\n                                                     binop_y_228746);\n                double a0_223354;\n                \n                a0_223354 = ((__global double *) mem_231140)[gtid_223336 *\n                                                             t_n_m_203740 +\n                                                             gtid_223337];\n                \n                bool cond_223356 = sle64(x_223344, gtid_223338);\n                int64_t defunc_0_f_res_223357;\n                \n                if (cond_223356) {\n                    defunc_0_f_res_223357 = (int64_t) 0;\n                } else {\n                    int64_t i_223358 = add64(gtid_223338, x_223351);\n                    int64_t defunc_0_add_arg_223359;\n                    \n                    defunc_0_add_arg_223359 = ((__global\n                                                int64_t *) ext_mem_229305)[gtid_223336 *\n                                                                           n_203572 +\n                                                                           i_223358];\n                    \n                    int64_t defunc_1_add_res_223360 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_223359);\n                    \n                    defunc_0_f_res_223357 = defunc_1_add_res_223360;\n                }\n                \n                double defunc_0_f_res_223361;\n                \n                if (cond_223356) {\n                    defunc_0_f_res_223361 = 0.0;\n                } else {\n                    int64_t i_223362 = add64(gtid_223338, x_223351);\n                    double defunc_0_add_arg_223363;\n         ",
                   "           \n                    defunc_0_add_arg_223363 = ((__global\n                                                double *) mem_231121)[gtid_223336 *\n                                                                      n_203572 +\n                                                                      i_223362];\n                    defunc_0_f_res_223361 = defunc_0_add_arg_223363;\n                }\n                \n                int64_t binop_p_223364 = sub64(defunc_0_f_res_223357,\n                                               index_primexp_228747);\n                double defunc_0_f_res_223365 = sitofp_i64_f64(binop_p_223364);\n                double abs_res_223366 = fabs(defunc_0_f_res_223365);\n                double tmp1_223367 = abs_res_223366 / x_223352;\n                double x_223368 = tmp1_223367 * tmp1_223367;\n                double y_223369 = tmp1_223367 * x_223368;\n                double tmp2_223370 = 1.0 - y_223369;\n                double x_223371 = tmp2_223370 * tmp2_223370;\n                double tmp3_223372 = tmp2_223370 * x_223371;\n                double tmp4_223373 = defunc_0_f_res_223361 * tmp3_223372;\n                double defunc_0_f_res_223374;\n                \n                if (cond_223356) {\n                    defunc_0_f_res_223374 = 0.0;\n                } else {\n                    int64_t i_223375 = add64(gtid_223338, x_223351);\n                    double defunc_0_add_arg_223376;\n                    \n                    defunc_0_add_arg_223376 = ((__global\n                                                double *) mem_231125)[gtid_223336 *\n                                                                      n_203572 +\n                                                                      i_223375];\n                    defunc_0_f_res_223374 = defunc_0_add_arg_223376;\n                }\n                \n                double x_223377 = a0_223354 * tmp4_223373;\n                double defunc_9_fit_fun_res_223378 = defunc_0_f_res_223374 *\n    ",
                   "                   x_223377;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_235613)[sext_i32_i64(local_tid_235609)] =\n                        defunc_9_fit_fun_res_223378;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_235613)[sext_i32_i64(local_tid_235609)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_t_203576)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_223340;\n                double x_223341;\n                double x_235622;\n                double x_235623;\n                bool ltid_in_bounds_235625 =\n                     slt64(sext_i32_i64(local_tid_235609), q_t_203576 *\n                           squot64(segred_group_sizze_223332,\n                                   segment_sizze_nonzzero_235606));\n                int32_t skip_threads_235626;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_235625) {\n                        x_223341 = ((volatile __local\n                                     double *) red_arr_mem_235613)[sext_i32_i64(local_tid_235609)];\n                        if ((local_tid_235609 - squot32(local_tid_235609, 32) *\n                             32) == 0) {\n                            x_223340 = x_223341;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_235626 = 1;\n                    while (slt32(skip_threads_235626, 32)) {\n                        bool thread_active_235627 = sle32(skip_threads_235626,\n                                                          local_tid_235609 -\n                  ",
                   "                                        squot32(local_tid_235609,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_235625;\n                        \n                        if (thread_active_235627) {\n                            // read operands\n                            {\n                                x_223340 = ((volatile __local\n                                             double *) red_arr_mem_235613)[sext_i32_i64(local_tid_235609) -\n                                                                           sext_i32_i64(skip_threads_235626)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_235628 =\n                                 slt64(srem64(sext_i32_i64(local_tid_235609),\n                                              q_t_203576),\n                                       sext_i32_i64(local_tid_235609) -\n                                       sext_i32_i64(local_tid_235609 -\n                                       skip_threads_235626));\n                            \n                            if (thread_active_235627 && inactive_235628) {\n                                x_223340 = x_223341;\n                            }\n                            if (thread_active_235627) {\n                                if (!inactive_235628) {\n                                    double defunc_1_op_res_223342 = x_223340 +\n                                           x_223341;\n                                    \n                                    x_223340 = defunc_1_op_res_223342;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_235611, skip_threads_235626)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_235627) {\n        ",
                   "                    // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235613)[sext_i32_i64(local_tid_235609)] =\n                                    x_223340;\n                                x_223341 = x_223340;\n                            }\n                        }\n                        if (sle32(wave_sizze_235611, skip_threads_235626)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_235626 *= 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_235609 - squot32(local_tid_235609, 32) *\n                         32) == 31 && ltid_in_bounds_235625) {\n                        ((volatile __local\n                          double *) red_arr_mem_235613)[sext_i32_i64(squot32(local_tid_235609,\n                                                                             32))] =\n                            x_223340;\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_235629;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_235609, 32) == 0 &&\n                            ltid_in_bounds_235625) {\n                            x_235623 = ((volatile __local\n                                         double *) red_arr_mem_235613)[sext_i32_i64(local_tid_235609)];\n                            if ((local_tid_235609 - squot32(local_tid_235609,\n                                                            32) * 32) == 0) {\n                                x_235622 = x_235623;\n   ",
                   "                         }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_235629 = 1;\n                        while (slt32(skip_threads_235629, 32)) {\n                            bool thread_active_235630 =\n                                 sle32(skip_threads_235629, local_tid_235609 -\n                                       squot32(local_tid_235609, 32) * 32) &&\n                                 (squot32(local_tid_235609, 32) == 0 &&\n                                  ltid_in_bounds_235625);\n                            \n                            if (thread_active_235630) {\n                                // read operands\n                                {\n                                    x_235622 = ((volatile __local\n                                                 double *) red_arr_mem_235613)[sext_i32_i64(local_tid_235609) -\n                                                                               sext_i32_i64(skip_threads_235629)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_235631 =\n                                     slt64(srem64(sext_i32_i64(local_tid_235609 *\n                                                  32 + 32 - 1), q_t_203576),\n                                           sext_i32_i64(local_tid_235609 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_235609 -\n                                                         skip_threads_235629) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_235630 && inactive_235631) {\n                                    x_235622 = x_235623;\n                                }\n          ",
                   "                      if (thread_active_235630) {\n                                    if (!inactive_235631) {\n                                        double defunc_1_op_res_235624 =\n                                               x_235622 + x_235623;\n                                        \n                                        x_235622 = defunc_1_op_res_235624;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_235611, skip_threads_235629)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_235630) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_235613)[sext_i32_i64(local_tid_235609)] =\n                                        x_235622;\n                                    x_235623 = x_235622;\n                                }\n                            }\n                            if (sle32(wave_sizze_235611, skip_threads_235629)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_235629 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_235632 = squot32(local_tid_235609, 32) == 0 ||\n                     !ltid_in_bounds_235625;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_235632) {\n                            x_223341 = x_223340;\n                            x_223340 = ((__local\n                                         double *) red_arr_mem_235613)[sext_i32_i64(squot32(local_tid_235609",
                   ",\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_235633 =\n                             slt64(srem64(sext_i32_i64(local_tid_235609),\n                                          q_t_203576),\n                                   sext_i32_i64(local_tid_235609) -\n                                   sext_i32_i64(squot32(local_tid_235609, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_235632) {\n                            if (inactive_235633) {\n                                x_223340 = x_223341;\n                            }\n                        }\n                        if (!no_carry_in_235632) {\n                            if (!inactive_235633) {\n                                double defunc_1_op_res_223342 = x_223340 +\n                                       x_223341;\n                                \n                                x_223340 = defunc_1_op_res_223342;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_235632) {\n                            ((__local\n                              double *) red_arr_mem_235613)[sext_i32_i64(local_tid_235609)] =\n                                x_223340;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_235609, 32) == 0 &&\n                        ltid_in_bounds_235625) {\n                        ((__local\n                          double *) red_arr_mem_235613)[sext_i32_i64(lo",
                   "cal_tid_235609)] =\n                            x_223341;\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_235617) *\n                      squot64(segred_group_sizze_223332,\n                              segment_sizze_nonzzero_235606) +\n                      sext_i32_i64(local_tid_235609), partition_sizze_203667 *\n                      t_n_m_203740) && slt64(sext_i32_i64(local_tid_235609),\n                                             squot64(segred_group_sizze_223332,\n                                                     segment_sizze_nonzzero_235606))) {\n                double tmp_235634;\n                \n                tmp_235634 = ((__local\n                               double *) red_arr_mem_235613)[(sext_i32_i64(local_tid_235609) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235606 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231145)[squot64(sext_i32_i64(virt_group_id_235617) *\n                                                squot64(segred_group_sizze_223332,\n                                                        segment_sizze_nonzzero_235606) +\n                                                sext_i32_i64(local_tid_235609),\n                                                t_n_m_203740) * t_n_m_203740 +\n                                        (sext_i32_i64(virt_group_id_235617) *\n                                         squot64(segred_group_sizze_223332,\n                                                 segment_sizze_nonzzero_235606) +\n                                         sext_i32_i64(local_tid_235609) -\n                                         squot64(sext_i32",
                   "_i64(virt_group_id_235617) *\n                                                 squot64(segred_group_sizze_223332,\n                                                         segment_sizze_nonzzero_235606) +\n                                                 sext_i32_i64(local_tid_235609),\n                                                 t_n_m_203740) *\n                                         t_n_m_203740)] = tmp_235634;\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_223332\n}\n__kernel void mainzisegred_small_224325(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235766_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235764_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235762_backing_aligned_2,\n                                        int64_t n_203572, int64_t q_t_203576,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t t_n_m_203740, int64_t i_203760,\n                                        int64_t num_groups_224317,\n                                        int64_t segment_sizze_nonzzero_235755,\n                                        __global unsigned char *ext_mem_229304,\n                                        __global unsigned char *ext_mem_229305,\n                                        __global unsigned char *ext_mem_229568,\n                                        __global unsigned char *ext_mem_229569,\n                                        __global unsigned char *mem_231259,\n                                        __global",
                   " unsigned char *mem_231277,\n                                        __global unsigned char *mem_231281,\n                                        __global unsigned char *mem_231285)\n{\n    #define segred_group_sizze_224316 (mainzisegred_group_sizze_223845)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_235766_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235766_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_235764_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235764_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_235762_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235762_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235757;\n    int32_t local_tid_235758;\n    int64_t group_sizze_235761;\n    int32_t wave_sizze_235760;\n    int32_t group_tid_235759;\n    \n    global_tid_235757 = get_global_id(0);\n    local_tid_235758 = get_local_id(0);\n    group_sizze_235761 = get_local_size(0);\n    wave_sizze_235760 = LOCKSTEP_WIDTH;\n    group_tid_235759 = get_group_id(0);\n    \n    int32_t phys_tid_224325 = global_tid_235757;\n    __local unsigned char *red_arr_mem_235762;\n    \n    red_arr_mem_235762 = (__local unsigned char *) red_arr_mem_235762_backing_0;\n    \n    __local unsigned char *red_arr_mem_235764;\n    \n    red_arr_mem_235764 = (__local unsigned char *) red_arr_mem_235764_backing_1;\n    \n    __local unsigned char *red_arr_mem_235766;\n    \n    red_arr_mem_235766 = (__local unsigned char *) red_arr_mem_235766_backing_2;\n    \n    int32_t phys_group_id_235768;\n    \n    phys_group_id_235768 = get_group_id(0);\n    for (int32_t i_",
                   "235769 = 0; i_235769 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * t_n_m_203740,\n                                          squot64(segred_group_sizze_224316,\n                                                  segment_sizze_nonzzero_235755))) -\n                   phys_group_id_235768, sext_i64_i32(num_groups_224317));\n         i_235769++) {\n        int32_t virt_group_id_235770 = phys_group_id_235768 + i_235769 *\n                sext_i64_i32(num_groups_224317);\n        int64_t slice_235771 = t_n_m_203740;\n        int64_t slice_235772 = partition_sizze_203667 * slice_235771;\n        int64_t gtid_224322 = squot64(squot64(sext_i32_i64(local_tid_235758),\n                                              segment_sizze_nonzzero_235755) +\n                                      sext_i32_i64(virt_group_id_235770) *\n                                      squot64(segred_group_sizze_224316,\n                                              segment_sizze_nonzzero_235755),\n                                      slice_235771);\n        int64_t remnant_235773 = squot64(sext_i32_i64(local_tid_235758),\n                                         segment_sizze_nonzzero_235755) +\n                sext_i32_i64(virt_group_id_235770) *\n                squot64(segred_group_sizze_224316,\n                        segment_sizze_nonzzero_235755) - gtid_224322 *\n                slice_235771;\n        int64_t gtid_224323 = remnant_235773;\n        int64_t remnant_235774 = remnant_235773 - gtid_224323;\n        int64_t gtid_224324 = srem64(sext_i32_i64(local_tid_235758),\n                                     q_t_203576);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_t_203576) && ((slt64(gtid_224322,\n                                                          partition_sizze_203667) &&\n                                                    slt64(gtid_224323,\n                                                          t_n_m_203740)) &&\n                  ",
                   "                                 slt64(sext_i32_i64(local_tid_235758),\n                                                         q_t_203576 *\n                                                         squot64(segred_group_sizze_224316,\n                                                                 segment_sizze_nonzzero_235755)))) {\n                int64_t x_224336;\n                \n                x_224336 = ((__global int64_t *) ext_mem_229304)[gtid_224322];\n                \n                int64_t x_224341;\n                \n                x_224341 = ((__global int64_t *) ext_mem_229569)[gtid_224322 *\n                                                                 t_n_m_203740 +\n                                                                 gtid_224323];\n                \n                double x_224342;\n                \n                x_224342 = ((__global double *) ext_mem_229568)[gtid_224322 *\n                                                                t_n_m_203740 +\n                                                                gtid_224323];\n                \n                int64_t binop_y_228760 = mul64(jump_t_203582, gtid_224323);\n                int64_t binop_y_228761 = smin64(i_203760, binop_y_228760);\n                int64_t index_primexp_228762 = add64((int64_t) 1,\n                                                     binop_y_228761);\n                bool cond_224345 = sle64(x_224336, gtid_224324);\n                int64_t defunc_0_f_res_224346;\n                \n                if (cond_224345) {\n                    defunc_0_f_res_224346 = (int64_t) 0;\n                } else {\n                    int64_t i_224347 = add64(gtid_224324, x_224341);\n                    int64_t defunc_0_add_arg_224348;\n                    \n                    defunc_0_add_arg_224348 = ((__global\n                                                int64_t *) ext_mem_229305)[gtid_224322 *\n                                                                           n_203572 +\n   ",
                   "                                                                        i_224347];\n                    \n                    int64_t defunc_1_add_res_224349 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_224348);\n                    \n                    defunc_0_f_res_224346 = defunc_1_add_res_224349;\n                }\n                \n                double defunc_0_f_res_224350;\n                \n                if (cond_224345) {\n                    defunc_0_f_res_224350 = 0.0;\n                } else {\n                    int64_t i_224351 = add64(gtid_224324, x_224341);\n                    double defunc_0_add_arg_224352;\n                    \n                    defunc_0_add_arg_224352 = ((__global\n                                                double *) mem_231259)[gtid_224322 *\n                                                                      n_203572 +\n                                                                      i_224351];\n                    defunc_0_f_res_224350 = defunc_0_add_arg_224352;\n                }\n                \n                int64_t binop_p_224353 = sub64(defunc_0_f_res_224346,\n                                               index_primexp_228762);\n                double defunc_0_f_res_224354 = sitofp_i64_f64(binop_p_224353);\n                double abs_res_224355 = fabs(defunc_0_f_res_224354);\n                double tmp1_224356 = abs_res_224355 / x_224342;\n                double x_224357 = tmp1_224356 * tmp1_224356;\n                double y_224358 = tmp1_224356 * x_224357;\n                double tmp2_224359 = 1.0 - y_224358;\n                double x_224360 = tmp2_224359 * tmp2_224359;\n                double tmp3_224361 = tmp2_224359 * x_224360;\n                double w_j_224362 = defunc_0_f_res_224350 * tmp3_224361;\n                double xw_j_224363 = defunc_0_f_res_224354 * w_j_224362;\n                double x2w_j_224364 = defunc_0_f_res_224354 * xw_j_224363;\n                \n       ",
                   "         // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_235762)[sext_i32_i64(local_tid_235758)] =\n                        w_j_224362;\n                    ((__local\n                      double *) red_arr_mem_235764)[sext_i32_i64(local_tid_235758)] =\n                        xw_j_224363;\n                    ((__local\n                      double *) red_arr_mem_235766)[sext_i32_i64(local_tid_235758)] =\n                        x2w_j_224364;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_235762)[sext_i32_i64(local_tid_235758)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235764)[sext_i32_i64(local_tid_235758)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235766)[sext_i32_i64(local_tid_235758)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_t_203576)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_224326;\n                double x_224327;\n                double x_224328;\n                double x_224329;\n                double x_224330;\n                double x_224331;\n                double x_235775;\n                double x_235776;\n                double x_235777;\n                double x_235778;\n                double x_235779;\n                double x_235780;\n                bool ltid_in_bounds_235784 =\n                     slt64(sext_i32_i64(local_tid_235758), q_t_203576 *\n                           squot64(segred_group_sizze_224316,\n                                   segment_sizze_nonzzero_235755));\n                int32_t skip_threads_235785;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bo",
                   "unds_235784) {\n                        x_224329 = ((volatile __local\n                                     double *) red_arr_mem_235762)[sext_i32_i64(local_tid_235758)];\n                        x_224330 = ((volatile __local\n                                     double *) red_arr_mem_235764)[sext_i32_i64(local_tid_235758)];\n                        x_224331 = ((volatile __local\n                                     double *) red_arr_mem_235766)[sext_i32_i64(local_tid_235758)];\n                        if ((local_tid_235758 - squot32(local_tid_235758, 32) *\n                             32) == 0) {\n                            x_224326 = x_224329;\n                            x_224327 = x_224330;\n                            x_224328 = x_224331;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_235785 = 1;\n                    while (slt32(skip_threads_235785, 32)) {\n                        bool thread_active_235786 = sle32(skip_threads_235785,\n                                                          local_tid_235758 -\n                                                          squot32(local_tid_235758,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_235784;\n                        \n                        if (thread_active_235786) {\n                            // read operands\n                            {\n                                x_224326 = ((volatile __local\n                                             double *) red_arr_mem_235762)[sext_i32_i64(local_tid_235758) -\n                                                                           sext_i32_i64(skip_threads_235785)];\n                                x_224327 = ((volatile __local\n                                             double *) red_arr_mem_235764)[sext_i32_i64(local_tid_235758) -\n                           ",
                   "                                                sext_i32_i64(skip_threads_235785)];\n                                x_224328 = ((volatile __local\n                                             double *) red_arr_mem_235766)[sext_i32_i64(local_tid_235758) -\n                                                                           sext_i32_i64(skip_threads_235785)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_235787 =\n                                 slt64(srem64(sext_i32_i64(local_tid_235758),\n                                              q_t_203576),\n                                       sext_i32_i64(local_tid_235758) -\n                                       sext_i32_i64(local_tid_235758 -\n                                       skip_threads_235785));\n                            \n                            if (thread_active_235786 && inactive_235787) {\n                                x_224326 = x_224329;\n                                x_224327 = x_224330;\n                                x_224328 = x_224331;\n                            }\n                            if (thread_active_235786) {\n                                if (!inactive_235787) {\n                                    double defunc_1_op_res_224332 = x_224326 +\n                                           x_224329;\n                                    double defunc_1_op_res_224333 = x_224327 +\n                                           x_224330;\n                                    double defunc_1_op_res_224334 = x_224328 +\n                                           x_224331;\n                                    \n                                    x_224326 = defunc_1_op_res_224332;\n                                    x_224327 = defunc_1_op_res_224333;\n                                    x_224328 = defunc_1_op_res_224334;\n                                }\n                            }\n",
                   "                        }\n                        if (sle32(wave_sizze_235760, skip_threads_235785)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_235786) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235762)[sext_i32_i64(local_tid_235758)] =\n                                    x_224326;\n                                x_224329 = x_224326;\n                                ((volatile __local\n                                  double *) red_arr_mem_235764)[sext_i32_i64(local_tid_235758)] =\n                                    x_224327;\n                                x_224330 = x_224327;\n                                ((volatile __local\n                                  double *) red_arr_mem_235766)[sext_i32_i64(local_tid_235758)] =\n                                    x_224328;\n                                x_224331 = x_224328;\n                            }\n                        }\n                        if (sle32(wave_sizze_235760, skip_threads_235785)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_235785 *= 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_235758 - squot32(local_tid_235758, 32) *\n                         32) == 31 && ltid_in_bounds_235784) {\n                        ((volatile __local\n                          double *) red_arr_mem_235762)[sext_i32_i64(squot32(local_tid_235758,\n                                                                             32))] =\n                            x_224326;\n                        ((volatile __local\n                          double *) red_arr_mem_23576",
                   "4)[sext_i32_i64(squot32(local_tid_235758,\n                                                                             32))] =\n                            x_224327;\n                        ((volatile __local\n                          double *) red_arr_mem_235766)[sext_i32_i64(squot32(local_tid_235758,\n                                                                             32))] =\n                            x_224328;\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_235788;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_235758, 32) == 0 &&\n                            ltid_in_bounds_235784) {\n                            x_235778 = ((volatile __local\n                                         double *) red_arr_mem_235762)[sext_i32_i64(local_tid_235758)];\n                            x_235779 = ((volatile __local\n                                         double *) red_arr_mem_235764)[sext_i32_i64(local_tid_235758)];\n                            x_235780 = ((volatile __local\n                                         double *) red_arr_mem_235766)[sext_i32_i64(local_tid_235758)];\n                            if ((local_tid_235758 - squot32(local_tid_235758,\n                                                            32) * 32) == 0) {\n                                x_235775 = x_235778;\n                                x_235776 = x_235779;\n                                x_235777 = x_235780;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_235788 = 1;\n                        while (slt32(skip_threads_235788, 32)) {\n                          ",
                   "  bool thread_active_235789 =\n                                 sle32(skip_threads_235788, local_tid_235758 -\n                                       squot32(local_tid_235758, 32) * 32) &&\n                                 (squot32(local_tid_235758, 32) == 0 &&\n                                  ltid_in_bounds_235784);\n                            \n                            if (thread_active_235789) {\n                                // read operands\n                                {\n                                    x_235775 = ((volatile __local\n                                                 double *) red_arr_mem_235762)[sext_i32_i64(local_tid_235758) -\n                                                                               sext_i32_i64(skip_threads_235788)];\n                                    x_235776 = ((volatile __local\n                                                 double *) red_arr_mem_235764)[sext_i32_i64(local_tid_235758) -\n                                                                               sext_i32_i64(skip_threads_235788)];\n                                    x_235777 = ((volatile __local\n                                                 double *) red_arr_mem_235766)[sext_i32_i64(local_tid_235758) -\n                                                                               sext_i32_i64(skip_threads_235788)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_235790 =\n                                     slt64(srem64(sext_i32_i64(local_tid_235758 *\n                                                  32 + 32 - 1), q_t_203576),\n                                           sext_i32_i64(local_tid_235758 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_235758 -\n                                                         skip_threads_",
                   "235788) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_235789 && inactive_235790) {\n                                    x_235775 = x_235778;\n                                    x_235776 = x_235779;\n                                    x_235777 = x_235780;\n                                }\n                                if (thread_active_235789) {\n                                    if (!inactive_235790) {\n                                        double defunc_1_op_res_235781 =\n                                               x_235775 + x_235778;\n                                        double defunc_1_op_res_235782 =\n                                               x_235776 + x_235779;\n                                        double defunc_1_op_res_235783 =\n                                               x_235777 + x_235780;\n                                        \n                                        x_235775 = defunc_1_op_res_235781;\n                                        x_235776 = defunc_1_op_res_235782;\n                                        x_235777 = defunc_1_op_res_235783;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_235760, skip_threads_235788)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_235789) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_235762)[sext_i32_i64(local_tid_235758)] =\n                                        x_235775;\n                                    x_235778 = x_235775;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235764)[sext_i32_",
                   "i64(local_tid_235758)] =\n                                        x_235776;\n                                    x_235779 = x_235776;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235766)[sext_i32_i64(local_tid_235758)] =\n                                        x_235777;\n                                    x_235780 = x_235777;\n                                }\n                            }\n                            if (sle32(wave_sizze_235760, skip_threads_235788)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_235788 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_235791 = squot32(local_tid_235758, 32) == 0 ||\n                     !ltid_in_bounds_235784;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_235791) {\n                            x_224329 = x_224326;\n                            x_224330 = x_224327;\n                            x_224331 = x_224328;\n                            x_224326 = ((__local\n                                         double *) red_arr_mem_235762)[sext_i32_i64(squot32(local_tid_235758,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_224327 = ((__local\n                                         double *) red_arr_mem_235764)[sext_i32_i64(squot32(local_tid_235758,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                    ",
                   "        x_224328 = ((__local\n                                         double *) red_arr_mem_235766)[sext_i32_i64(squot32(local_tid_235758,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_235792 =\n                             slt64(srem64(sext_i32_i64(local_tid_235758),\n                                          q_t_203576),\n                                   sext_i32_i64(local_tid_235758) -\n                                   sext_i32_i64(squot32(local_tid_235758, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_235791) {\n                            if (inactive_235792) {\n                                x_224326 = x_224329;\n                                x_224327 = x_224330;\n                                x_224328 = x_224331;\n                            }\n                        }\n                        if (!no_carry_in_235791) {\n                            if (!inactive_235792) {\n                                double defunc_1_op_res_224332 = x_224326 +\n                                       x_224329;\n                                double defunc_1_op_res_224333 = x_224327 +\n                                       x_224330;\n                                double defunc_1_op_res_224334 = x_224328 +\n                                       x_224331;\n                                \n                                x_224326 = defunc_1_op_res_224332;\n                                x_224327 = defunc_1_op_res_224333;\n                                x_224328 = defunc_1_op_res_224334;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n    ",
                   "                    if (!no_carry_in_235791) {\n                            ((__local\n                              double *) red_arr_mem_235762)[sext_i32_i64(local_tid_235758)] =\n                                x_224326;\n                            ((__local\n                              double *) red_arr_mem_235764)[sext_i32_i64(local_tid_235758)] =\n                                x_224327;\n                            ((__local\n                              double *) red_arr_mem_235766)[sext_i32_i64(local_tid_235758)] =\n                                x_224328;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_235758, 32) == 0 &&\n                        ltid_in_bounds_235784) {\n                        ((__local\n                          double *) red_arr_mem_235762)[sext_i32_i64(local_tid_235758)] =\n                            x_224329;\n                        ((__local\n                          double *) red_arr_mem_235764)[sext_i32_i64(local_tid_235758)] =\n                            x_224330;\n                        ((__local\n                          double *) red_arr_mem_235766)[sext_i32_i64(local_tid_235758)] =\n                            x_224331;\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_235770) *\n                      squot64(segred_group_sizze_224316,\n                              segment_sizze_nonzzero_235755) +\n                      sext_i32_i64(local_tid_235758), partition_sizze_203667 *\n                      t_n_m_203740) && slt64(sext_i32_i64(local_tid_235758),\n                                             squot64(segred_group_sizze_224316,\n                                ",
                   "                     segment_sizze_nonzzero_235755))) {\n                double tmp_235793;\n                \n                tmp_235793 = ((__local\n                               double *) red_arr_mem_235762)[(sext_i32_i64(local_tid_235758) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235755 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231277)[squot64(sext_i32_i64(virt_group_id_235770) *\n                                                squot64(segred_group_sizze_224316,\n                                                        segment_sizze_nonzzero_235755) +\n                                                sext_i32_i64(local_tid_235758),\n                                                t_n_m_203740) * t_n_m_203740 +\n                                        (sext_i32_i64(virt_group_id_235770) *\n                                         squot64(segred_group_sizze_224316,\n                                                 segment_sizze_nonzzero_235755) +\n                                         sext_i32_i64(local_tid_235758) -\n                                         squot64(sext_i32_i64(virt_group_id_235770) *\n                                                 squot64(segred_group_sizze_224316,\n                                                         segment_sizze_nonzzero_235755) +\n                                                 sext_i32_i64(local_tid_235758),\n                                                 t_n_m_203740) *\n                                         t_n_m_203740)] = tmp_235793;\n                \n                double tmp_235794;\n                \n                tmp_235794 = ((__local\n                               double *) red_arr_mem_235764)[(sext_i32_i64(local_tid_235758) +\n                                                              (int64_t) 1) *\n    ",
                   "                                                         segment_sizze_nonzzero_235755 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231281)[squot64(sext_i32_i64(virt_group_id_235770) *\n                                                squot64(segred_group_sizze_224316,\n                                                        segment_sizze_nonzzero_235755) +\n                                                sext_i32_i64(local_tid_235758),\n                                                t_n_m_203740) * t_n_m_203740 +\n                                        (sext_i32_i64(virt_group_id_235770) *\n                                         squot64(segred_group_sizze_224316,\n                                                 segment_sizze_nonzzero_235755) +\n                                         sext_i32_i64(local_tid_235758) -\n                                         squot64(sext_i32_i64(virt_group_id_235770) *\n                                                 squot64(segred_group_sizze_224316,\n                                                         segment_sizze_nonzzero_235755) +\n                                                 sext_i32_i64(local_tid_235758),\n                                                 t_n_m_203740) *\n                                         t_n_m_203740)] = tmp_235794;\n                \n                double tmp_235795;\n                \n                tmp_235795 = ((__local\n                               double *) red_arr_mem_235766)[(sext_i32_i64(local_tid_235758) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235755 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231285)[squot64(sext_i32_i64(virt_group_id_235770) *\n                                               ",
                   " squot64(segred_group_sizze_224316,\n                                                        segment_sizze_nonzzero_235755) +\n                                                sext_i32_i64(local_tid_235758),\n                                                t_n_m_203740) * t_n_m_203740 +\n                                        (sext_i32_i64(virt_group_id_235770) *\n                                         squot64(segred_group_sizze_224316,\n                                                 segment_sizze_nonzzero_235755) +\n                                         sext_i32_i64(local_tid_235758) -\n                                         squot64(sext_i32_i64(virt_group_id_235770) *\n                                                 squot64(segred_group_sizze_224316,\n                                                         segment_sizze_nonzzero_235755) +\n                                                 sext_i32_i64(local_tid_235758),\n                                                 t_n_m_203740) *\n                                         t_n_m_203740)] = tmp_235795;\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_224316\n}\n__kernel void mainzisegred_small_224397(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235874_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235872_backing_aligned_1,\n                                        int64_t n_203572, int64_t q_t_203576,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t t_n_m_203740, int64_t i_203760,\n                                        int64_t num_groups_224390,\n                ",
                   "                        int64_t segment_sizze_nonzzero_235865,\n                                        __global unsigned char *ext_mem_229304,\n                                        __global unsigned char *ext_mem_229305,\n                                        __global unsigned char *ext_mem_229568,\n                                        __global unsigned char *ext_mem_229569,\n                                        __global unsigned char *mem_231259,\n                                        __global unsigned char *mem_231263,\n                                        __global unsigned char *mem_231290,\n                                        __global unsigned char *mem_231294,\n                                        __global unsigned char *mem_231298,\n                                        __global unsigned char *mem_231303,\n                                        __global unsigned char *mem_231307)\n{\n    #define segred_group_sizze_224389 (mainzisegred_group_sizze_223748)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_235874_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235874_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_235872_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235872_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235867;\n    int32_t local_tid_235868;\n    int64_t group_sizze_235871;\n    int32_t wave_sizze_235870;\n    int32_t group_tid_235869;\n    \n    global_tid_235867 = get_global_id(0);\n    local_tid_235868 = get_local_id(0);\n    group_sizze_235871 = get_local_size(0);\n    wave_sizze_235870 = LOCKSTEP_WIDTH;\n    group_tid_235869 = get_group_id(0);\n    \n    int32_t phys_tid_224397 = global_tid_235867;\n ",
                   "   __local unsigned char *red_arr_mem_235872;\n    \n    red_arr_mem_235872 = (__local unsigned char *) red_arr_mem_235872_backing_0;\n    \n    __local unsigned char *red_arr_mem_235874;\n    \n    red_arr_mem_235874 = (__local unsigned char *) red_arr_mem_235874_backing_1;\n    \n    int32_t phys_group_id_235876;\n    \n    phys_group_id_235876 = get_group_id(0);\n    for (int32_t i_235877 = 0; i_235877 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * t_n_m_203740,\n                                          squot64(segred_group_sizze_224389,\n                                                  segment_sizze_nonzzero_235865))) -\n                   phys_group_id_235876, sext_i64_i32(num_groups_224390));\n         i_235877++) {\n        int32_t virt_group_id_235878 = phys_group_id_235876 + i_235877 *\n                sext_i64_i32(num_groups_224390);\n        int64_t slice_235879 = t_n_m_203740;\n        int64_t slice_235880 = partition_sizze_203667 * slice_235879;\n        int64_t gtid_224394 = squot64(squot64(sext_i32_i64(local_tid_235868),\n                                              segment_sizze_nonzzero_235865) +\n                                      sext_i32_i64(virt_group_id_235878) *\n                                      squot64(segred_group_sizze_224389,\n                                              segment_sizze_nonzzero_235865),\n                                      slice_235879);\n        int64_t remnant_235881 = squot64(sext_i32_i64(local_tid_235868),\n                                         segment_sizze_nonzzero_235865) +\n                sext_i32_i64(virt_group_id_235878) *\n                squot64(segred_group_sizze_224389,\n                        segment_sizze_nonzzero_235865) - gtid_224394 *\n                slice_235879;\n        int64_t gtid_224395 = remnant_235881;\n        int64_t remnant_235882 = remnant_235881 - gtid_224395;\n        int64_t gtid_224396 = srem64(sext_i32_i64(local_tid_235868),\n                                     q_t_203576);\n      ",
                   "  \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_t_203576) && ((slt64(gtid_224394,\n                                                          partition_sizze_203667) &&\n                                                    slt64(gtid_224395,\n                                                          t_n_m_203740)) &&\n                                                   slt64(sext_i32_i64(local_tid_235868),\n                                                         q_t_203576 *\n                                                         squot64(segred_group_sizze_224389,\n                                                                 segment_sizze_nonzzero_235865)))) {\n                int64_t x_224405;\n                \n                x_224405 = ((__global int64_t *) ext_mem_229304)[gtid_224394];\n                \n                int64_t x_224414;\n                \n                x_224414 = ((__global int64_t *) ext_mem_229569)[gtid_224394 *\n                                                                 t_n_m_203740 +\n                                                                 gtid_224395];\n                \n                double x_224415;\n                \n                x_224415 = ((__global double *) ext_mem_229568)[gtid_224394 *\n                                                                t_n_m_203740 +\n                                                                gtid_224395];\n                \n                int64_t binop_y_228755 = mul64(jump_t_203582, gtid_224395);\n                int64_t binop_y_228756 = smin64(i_203760, binop_y_228755);\n                int64_t index_primexp_228757 = add64((int64_t) 1,\n                                                     binop_y_228756);\n                double a11_224417;\n                \n                a11_224417 = ((__global double *) mem_231290)[gtid_224394 *\n                                                              t_n_m_203740 +\n                                          ",
                   "                    gtid_224395];\n                \n                double b11_224418;\n                \n                b11_224418 = ((__global double *) mem_231294)[gtid_224394 *\n                                                              t_n_m_203740 +\n                                                              gtid_224395];\n                \n                double c11_224419;\n                \n                c11_224419 = ((__global double *) mem_231298)[gtid_224394 *\n                                                              t_n_m_203740 +\n                                                              gtid_224395];\n                \n                bool cond_224421 = sle64(x_224405, gtid_224396);\n                int64_t defunc_0_f_res_224422;\n                \n                if (cond_224421) {\n                    defunc_0_f_res_224422 = (int64_t) 0;\n                } else {\n                    int64_t i_224423 = add64(gtid_224396, x_224414);\n                    int64_t defunc_0_add_arg_224424;\n                    \n                    defunc_0_add_arg_224424 = ((__global\n                                                int64_t *) ext_mem_229305)[gtid_224394 *\n                                                                           n_203572 +\n                                                                           i_224423];\n                    \n                    int64_t defunc_1_add_res_224425 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_224424);\n                    \n                    defunc_0_f_res_224422 = defunc_1_add_res_224425;\n                }\n                \n                double defunc_0_f_res_224426;\n                \n                if (cond_224421) {\n                    defunc_0_f_res_224426 = 0.0;\n                } else {\n                    int64_t i_224427 = add64(gtid_224396, x_224414);\n                    double defunc_0_add_arg_224428;\n                    \n                    defunc_",
                   "0_add_arg_224428 = ((__global\n                                                double *) mem_231259)[gtid_224394 *\n                                                                      n_203572 +\n                                                                      i_224427];\n                    defunc_0_f_res_224426 = defunc_0_add_arg_224428;\n                }\n                \n                int64_t binop_p_224429 = sub64(defunc_0_f_res_224422,\n                                               index_primexp_228757);\n                double defunc_0_f_res_224430 = sitofp_i64_f64(binop_p_224429);\n                double abs_res_224431 = fabs(defunc_0_f_res_224430);\n                double tmp1_224432 = abs_res_224431 / x_224415;\n                double x_224433 = tmp1_224432 * tmp1_224432;\n                double y_224434 = tmp1_224432 * x_224433;\n                double tmp2_224435 = 1.0 - y_224434;\n                double x_224436 = tmp2_224435 * tmp2_224435;\n                double tmp3_224437 = tmp2_224435 * x_224436;\n                double tmp4_224438 = defunc_0_f_res_224426 * tmp3_224437;\n                double defunc_1_f_res_224439 = defunc_0_f_res_224430 *\n                       tmp4_224438;\n                double defunc_0_f_res_224440;\n                \n                if (cond_224421) {\n                    defunc_0_f_res_224440 = 0.0;\n                } else {\n                    int64_t i_224441 = add64(gtid_224396, x_224414);\n                    double defunc_0_add_arg_224442;\n                    \n                    defunc_0_add_arg_224442 = ((__global\n                                                double *) mem_231263)[gtid_224394 *\n                                                                      n_203572 +\n                                                                      i_224441];\n                    defunc_0_f_res_224440 = defunc_0_add_arg_224442;\n                }\n                \n                double x_224443 = a11_224417 * tmp4_224438;\n            ",
                   "    double y_224444 = b11_224418 * defunc_1_f_res_224439;\n                double x_224445 = x_224443 + y_224444;\n                double defunc_9_fit_fun_res_224446 = defunc_0_f_res_224440 *\n                       x_224445;\n                double x_224447 = b11_224418 * tmp4_224438;\n                double y_224448 = c11_224419 * defunc_1_f_res_224439;\n                double x_224449 = x_224447 + y_224448;\n                double defunc_9_slope_fun_res_224450 = defunc_0_f_res_224440 *\n                       x_224449;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_235872)[sext_i32_i64(local_tid_235868)] =\n                        defunc_9_fit_fun_res_224446;\n                    ((__local\n                      double *) red_arr_mem_235874)[sext_i32_i64(local_tid_235868)] =\n                        defunc_9_slope_fun_res_224450;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_235872)[sext_i32_i64(local_tid_235868)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235874)[sext_i32_i64(local_tid_235868)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_t_203576)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_224398;\n                double x_224399;\n                double x_224400;\n                double x_224401;\n                double x_235883;\n                double x_235884;\n                double x_235885;\n                double x_235886;\n                bool ltid_in_bounds_235889 =\n                     slt64(sext_i32_i64(local_tid_235868), q_t_203576 *\n                           squot64(segred_group_sizze_224389,\n                                   segment_sizze_nonzzero_235865));\n  ",
                   "              int32_t skip_threads_235890;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_235889) {\n                        x_224400 = ((volatile __local\n                                     double *) red_arr_mem_235872)[sext_i32_i64(local_tid_235868)];\n                        x_224401 = ((volatile __local\n                                     double *) red_arr_mem_235874)[sext_i32_i64(local_tid_235868)];\n                        if ((local_tid_235868 - squot32(local_tid_235868, 32) *\n                             32) == 0) {\n                            x_224398 = x_224400;\n                            x_224399 = x_224401;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_235890 = 1;\n                    while (slt32(skip_threads_235890, 32)) {\n                        bool thread_active_235891 = sle32(skip_threads_235890,\n                                                          local_tid_235868 -\n                                                          squot32(local_tid_235868,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_235889;\n                        \n                        if (thread_active_235891) {\n                            // read operands\n                            {\n                                x_224398 = ((volatile __local\n                                             double *) red_arr_mem_235872)[sext_i32_i64(local_tid_235868) -\n                                                                           sext_i32_i64(skip_threads_235890)];\n                                x_224399 = ((volatile __local\n                                             double *) red_arr_mem_235874)[sext_i32_i64(local_tid_235868) -\n                                                                      ",
                   "     sext_i32_i64(skip_threads_235890)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_235892 =\n                                 slt64(srem64(sext_i32_i64(local_tid_235868),\n                                              q_t_203576),\n                                       sext_i32_i64(local_tid_235868) -\n                                       sext_i32_i64(local_tid_235868 -\n                                       skip_threads_235890));\n                            \n                            if (thread_active_235891 && inactive_235892) {\n                                x_224398 = x_224400;\n                                x_224399 = x_224401;\n                            }\n                            if (thread_active_235891) {\n                                if (!inactive_235892) {\n                                    double defunc_1_op_res_224402 = x_224398 +\n                                           x_224400;\n                                    double defunc_1_op_res_224403 = x_224399 +\n                                           x_224401;\n                                    \n                                    x_224398 = defunc_1_op_res_224402;\n                                    x_224399 = defunc_1_op_res_224403;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_235870, skip_threads_235890)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_235891) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235872)[sext_i32_i64(local_tid_235868)] =\n                                    x_224398;\n                                x_224400 = x_224398;\n                   ",
                   "             ((volatile __local\n                                  double *) red_arr_mem_235874)[sext_i32_i64(local_tid_235868)] =\n                                    x_224399;\n                                x_224401 = x_224399;\n                            }\n                        }\n                        if (sle32(wave_sizze_235870, skip_threads_235890)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_235890 *= 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_235868 - squot32(local_tid_235868, 32) *\n                         32) == 31 && ltid_in_bounds_235889) {\n                        ((volatile __local\n                          double *) red_arr_mem_235872)[sext_i32_i64(squot32(local_tid_235868,\n                                                                             32))] =\n                            x_224398;\n                        ((volatile __local\n                          double *) red_arr_mem_235874)[sext_i32_i64(squot32(local_tid_235868,\n                                                                             32))] =\n                            x_224399;\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_235893;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_235868, 32) == 0 &&\n                            ltid_in_bounds_235889) {\n                            x_235885 = ((volatile __local\n                                         double *) red_arr_mem_235872)[sext_i32_i64(local_tid_235868)];\n                            x_235886",
                   " = ((volatile __local\n                                         double *) red_arr_mem_235874)[sext_i32_i64(local_tid_235868)];\n                            if ((local_tid_235868 - squot32(local_tid_235868,\n                                                            32) * 32) == 0) {\n                                x_235883 = x_235885;\n                                x_235884 = x_235886;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_235893 = 1;\n                        while (slt32(skip_threads_235893, 32)) {\n                            bool thread_active_235894 =\n                                 sle32(skip_threads_235893, local_tid_235868 -\n                                       squot32(local_tid_235868, 32) * 32) &&\n                                 (squot32(local_tid_235868, 32) == 0 &&\n                                  ltid_in_bounds_235889);\n                            \n                            if (thread_active_235894) {\n                                // read operands\n                                {\n                                    x_235883 = ((volatile __local\n                                                 double *) red_arr_mem_235872)[sext_i32_i64(local_tid_235868) -\n                                                                               sext_i32_i64(skip_threads_235893)];\n                                    x_235884 = ((volatile __local\n                                                 double *) red_arr_mem_235874)[sext_i32_i64(local_tid_235868) -\n                                                                               sext_i32_i64(skip_threads_235893)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_235895 =\n                                   ",
                   "  slt64(srem64(sext_i32_i64(local_tid_235868 *\n                                                  32 + 32 - 1), q_t_203576),\n                                           sext_i32_i64(local_tid_235868 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_235868 -\n                                                         skip_threads_235893) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_235894 && inactive_235895) {\n                                    x_235883 = x_235885;\n                                    x_235884 = x_235886;\n                                }\n                                if (thread_active_235894) {\n                                    if (!inactive_235895) {\n                                        double defunc_1_op_res_235887 =\n                                               x_235883 + x_235885;\n                                        double defunc_1_op_res_235888 =\n                                               x_235884 + x_235886;\n                                        \n                                        x_235883 = defunc_1_op_res_235887;\n                                        x_235884 = defunc_1_op_res_235888;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_235870, skip_threads_235893)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_235894) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_235872)[sext_i32_i64(local_tid_235868)] =\n                                        x_235883;\n                                    x_235885 = x_235883;\n ",
                   "                                   ((volatile __local\n                                      double *) red_arr_mem_235874)[sext_i32_i64(local_tid_235868)] =\n                                        x_235884;\n                                    x_235886 = x_235884;\n                                }\n                            }\n                            if (sle32(wave_sizze_235870, skip_threads_235893)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_235893 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_235896 = squot32(local_tid_235868, 32) == 0 ||\n                     !ltid_in_bounds_235889;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_235896) {\n                            x_224400 = x_224398;\n                            x_224401 = x_224399;\n                            x_224398 = ((__local\n                                         double *) red_arr_mem_235872)[sext_i32_i64(squot32(local_tid_235868,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_224399 = ((__local\n                                         double *) red_arr_mem_235874)[sext_i32_i64(squot32(local_tid_235868,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_235897 =\n                             slt64(srem64(se",
                   "xt_i32_i64(local_tid_235868),\n                                          q_t_203576),\n                                   sext_i32_i64(local_tid_235868) -\n                                   sext_i32_i64(squot32(local_tid_235868, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_235896) {\n                            if (inactive_235897) {\n                                x_224398 = x_224400;\n                                x_224399 = x_224401;\n                            }\n                        }\n                        if (!no_carry_in_235896) {\n                            if (!inactive_235897) {\n                                double defunc_1_op_res_224402 = x_224398 +\n                                       x_224400;\n                                double defunc_1_op_res_224403 = x_224399 +\n                                       x_224401;\n                                \n                                x_224398 = defunc_1_op_res_224402;\n                                x_224399 = defunc_1_op_res_224403;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_235896) {\n                            ((__local\n                              double *) red_arr_mem_235872)[sext_i32_i64(local_tid_235868)] =\n                                x_224398;\n                            ((__local\n                              double *) red_arr_mem_235874)[sext_i32_i64(local_tid_235868)] =\n                                x_224399;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_235868, 32) == 0 &&\n                        ltid_in_bounds_235889) {\n                        ((__local\n                          double *) red_a",
                   "rr_mem_235872)[sext_i32_i64(local_tid_235868)] =\n                            x_224400;\n                        ((__local\n                          double *) red_arr_mem_235874)[sext_i32_i64(local_tid_235868)] =\n                            x_224401;\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_235878) *\n                      squot64(segred_group_sizze_224389,\n                              segment_sizze_nonzzero_235865) +\n                      sext_i32_i64(local_tid_235868), partition_sizze_203667 *\n                      t_n_m_203740) && slt64(sext_i32_i64(local_tid_235868),\n                                             squot64(segred_group_sizze_224389,\n                                                     segment_sizze_nonzzero_235865))) {\n                double tmp_235898;\n                \n                tmp_235898 = ((__local\n                               double *) red_arr_mem_235872)[(sext_i32_i64(local_tid_235868) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235865 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231303)[squot64(sext_i32_i64(virt_group_id_235878) *\n                                                squot64(segred_group_sizze_224389,\n                                                        segment_sizze_nonzzero_235865) +\n                                                sext_i32_i64(local_tid_235868),\n                                                t_n_m_203740) * t_n_m_203740 +\n                                        (sext_i32_i64(virt_group_id_235878) *\n                                         squot64(segred_group_sizze_224389,\n                     ",
                   "                            segment_sizze_nonzzero_235865) +\n                                         sext_i32_i64(local_tid_235868) -\n                                         squot64(sext_i32_i64(virt_group_id_235878) *\n                                                 squot64(segred_group_sizze_224389,\n                                                         segment_sizze_nonzzero_235865) +\n                                                 sext_i32_i64(local_tid_235868),\n                                                 t_n_m_203740) *\n                                         t_n_m_203740)] = tmp_235898;\n                \n                double tmp_235899;\n                \n                tmp_235899 = ((__local\n                               double *) red_arr_mem_235874)[(sext_i32_i64(local_tid_235868) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235865 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231307)[squot64(sext_i32_i64(virt_group_id_235878) *\n                                                squot64(segred_group_sizze_224389,\n                                                        segment_sizze_nonzzero_235865) +\n                                                sext_i32_i64(local_tid_235868),\n                                                t_n_m_203740) * t_n_m_203740 +\n                                        (sext_i32_i64(virt_group_id_235878) *\n                                         squot64(segred_group_sizze_224389,\n                                                 segment_sizze_nonzzero_235865) +\n                                         sext_i32_i64(local_tid_235868) -\n                                         squot64(sext_i32_i64(virt_group_id_235878) *\n                                                 squot64(segred_group_sizze_224389,\n                  ",
                   "                                       segment_sizze_nonzzero_235865) +\n                                                 sext_i32_i64(local_tid_235868),\n                                                 t_n_m_203740) *\n                                         t_n_m_203740)] = tmp_235899;\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_224389\n}\n__kernel void mainzisegred_small_225613(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_236047_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_236045_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_236043_backing_aligned_2,\n                                        __local volatile\n                                        int64_t *red_arr_mem_236041_backing_aligned_3,\n                                        __local volatile\n                                        int64_t *red_arr_mem_236039_backing_aligned_4,\n                                        int64_t n_203572, int64_t q_t_203576,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t t_n_m_203740, int64_t i_203760,\n                                        int64_t num_groups_225603,\n                                        int64_t segment_sizze_nonzzero_236032,\n                                        __global unsigned char *ext_mem_229304,\n                                        __global unsigned char *ext_mem_229305,\n                                        __global unsigned char *ext_mem_229568,\n                                        __globa",
                   "l unsigned char *ext_mem_229569,\n                                        __global unsigned char *mem_231428,\n                                        __global unsigned char *mem_231446,\n                                        __global unsigned char *mem_231450,\n                                        __global unsigned char *mem_231454,\n                                        __global unsigned char *mem_231458,\n                                        __global unsigned char *mem_231462)\n{\n    #define segred_group_sizze_225602 (mainzisegred_group_sizze_225051)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_236047_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236047_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_236045_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236045_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_236043_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236043_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_236041_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236041_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_236039_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236039_backing_aligned_4;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236034;\n    int32_t local_tid_236035;\n    int64_t group_sizze_236038;\n    int32_t wave_sizze_236037;\n    int32_t group_tid_236036;\n    \n    global_tid_236034 = get",
                   "_global_id(0);\n    local_tid_236035 = get_local_id(0);\n    group_sizze_236038 = get_local_size(0);\n    wave_sizze_236037 = LOCKSTEP_WIDTH;\n    group_tid_236036 = get_group_id(0);\n    \n    int32_t phys_tid_225613 = global_tid_236034;\n    __local unsigned char *red_arr_mem_236039;\n    \n    red_arr_mem_236039 = (__local unsigned char *) red_arr_mem_236039_backing_0;\n    \n    __local unsigned char *red_arr_mem_236041;\n    \n    red_arr_mem_236041 = (__local unsigned char *) red_arr_mem_236041_backing_1;\n    \n    __local unsigned char *red_arr_mem_236043;\n    \n    red_arr_mem_236043 = (__local unsigned char *) red_arr_mem_236043_backing_2;\n    \n    __local unsigned char *red_arr_mem_236045;\n    \n    red_arr_mem_236045 = (__local unsigned char *) red_arr_mem_236045_backing_3;\n    \n    __local unsigned char *red_arr_mem_236047;\n    \n    red_arr_mem_236047 = (__local unsigned char *) red_arr_mem_236047_backing_4;\n    \n    int32_t phys_group_id_236049;\n    \n    phys_group_id_236049 = get_group_id(0);\n    for (int32_t i_236050 = 0; i_236050 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * t_n_m_203740,\n                                          squot64(segred_group_sizze_225602,\n                                                  segment_sizze_nonzzero_236032))) -\n                   phys_group_id_236049, sext_i64_i32(num_groups_225603));\n         i_236050++) {\n        int32_t virt_group_id_236051 = phys_group_id_236049 + i_236050 *\n                sext_i64_i32(num_groups_225603);\n        int64_t slice_236052 = t_n_m_203740;\n        int64_t slice_236053 = partition_sizze_203667 * slice_236052;\n        int64_t gtid_225610 = squot64(squot64(sext_i32_i64(local_tid_236035),\n                                              segment_sizze_nonzzero_236032) +\n                                      sext_i32_i64(virt_group_id_236051) *\n                                      squot64(segred_group_sizze_225602,\n                                              segment_sizze_nonzzero_",
                   "236032),\n                                      slice_236052);\n        int64_t remnant_236054 = squot64(sext_i32_i64(local_tid_236035),\n                                         segment_sizze_nonzzero_236032) +\n                sext_i32_i64(virt_group_id_236051) *\n                squot64(segred_group_sizze_225602,\n                        segment_sizze_nonzzero_236032) - gtid_225610 *\n                slice_236052;\n        int64_t gtid_225611 = remnant_236054;\n        int64_t remnant_236055 = remnant_236054 - gtid_225611;\n        int64_t gtid_225612 = srem64(sext_i32_i64(local_tid_236035),\n                                     q_t_203576);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_t_203576) && ((slt64(gtid_225610,\n                                                          partition_sizze_203667) &&\n                                                    slt64(gtid_225611,\n                                                          t_n_m_203740)) &&\n                                                   slt64(sext_i32_i64(local_tid_236035),\n                                                         q_t_203576 *\n                                                         squot64(segred_group_sizze_225602,\n                                                                 segment_sizze_nonzzero_236032)))) {\n                int64_t x_225630;\n                \n                x_225630 = ((__global int64_t *) ext_mem_229304)[gtid_225610];\n                \n                int64_t x_225635;\n                \n                x_225635 = ((__global int64_t *) ext_mem_229569)[gtid_225610 *\n                                                                 t_n_m_203740 +\n                                                                 gtid_225611];\n                \n                double x_225636;\n                \n                x_225636 = ((__global double *) ext_mem_229568)[gtid_225610 *\n                                                            ",
                   "    t_n_m_203740 +\n                                                                gtid_225611];\n                \n                int64_t binop_y_228770 = mul64(jump_t_203582, gtid_225611);\n                int64_t binop_y_228771 = smin64(i_203760, binop_y_228770);\n                int64_t index_primexp_228772 = add64((int64_t) 1,\n                                                     binop_y_228771);\n                bool cond_225639 = sle64(x_225630, gtid_225612);\n                int64_t defunc_0_f_res_225640;\n                \n                if (cond_225639) {\n                    defunc_0_f_res_225640 = (int64_t) 0;\n                } else {\n                    int64_t i_225641 = add64(gtid_225612, x_225635);\n                    int64_t defunc_0_add_arg_225642;\n                    \n                    defunc_0_add_arg_225642 = ((__global\n                                                int64_t *) ext_mem_229305)[gtid_225610 *\n                                                                           n_203572 +\n                                                                           i_225641];\n                    \n                    int64_t defunc_1_add_res_225643 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_225642);\n                    \n                    defunc_0_f_res_225640 = defunc_1_add_res_225643;\n                }\n                \n                double defunc_0_f_res_225644;\n                \n                if (cond_225639) {\n                    defunc_0_f_res_225644 = 0.0;\n                } else {\n                    int64_t i_225645 = add64(gtid_225612, x_225635);\n                    double defunc_0_add_arg_225646;\n                    \n                    defunc_0_add_arg_225646 = ((__global\n                                                double *) mem_231428)[gtid_225610 *\n                                                                      n_203572 +\n                                                   ",
                   "                   i_225645];\n                    defunc_0_f_res_225644 = defunc_0_add_arg_225646;\n                }\n                \n                int64_t binop_p_225647 = sub64(defunc_0_f_res_225640,\n                                               index_primexp_228772);\n                double defunc_0_f_res_225648 = sitofp_i64_f64(binop_p_225647);\n                double abs_res_225649 = fabs(defunc_0_f_res_225648);\n                double tmp1_225650 = abs_res_225649 / x_225636;\n                double x_225651 = tmp1_225650 * tmp1_225650;\n                double y_225652 = tmp1_225650 * x_225651;\n                double tmp2_225653 = 1.0 - y_225652;\n                double x_225654 = tmp2_225653 * tmp2_225653;\n                double tmp3_225655 = tmp2_225653 * x_225654;\n                double w_j_225656 = defunc_0_f_res_225644 * tmp3_225655;\n                double xw_j_225657 = defunc_0_f_res_225648 * w_j_225656;\n                double x2w_j_225658 = defunc_0_f_res_225648 * xw_j_225657;\n                double x3w_j_225659 = defunc_0_f_res_225648 * x2w_j_225658;\n                double x4w_j_225660 = defunc_0_f_res_225648 * x3w_j_225659;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_236039)[sext_i32_i64(local_tid_236035)] =\n                        w_j_225656;\n                    ((__local\n                      double *) red_arr_mem_236041)[sext_i32_i64(local_tid_236035)] =\n                        xw_j_225657;\n                    ((__local\n                      double *) red_arr_mem_236043)[sext_i32_i64(local_tid_236035)] =\n                        x2w_j_225658;\n                    ((__local\n                      double *) red_arr_mem_236045)[sext_i32_i64(local_tid_236035)] =\n                        x3w_j_225659;\n                    ((__local\n                      double *) red_arr_mem_236047)[sext_i32_i6",
                   "4(local_tid_236035)] =\n                        x4w_j_225660;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_236039)[sext_i32_i64(local_tid_236035)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_236041)[sext_i32_i64(local_tid_236035)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_236043)[sext_i32_i64(local_tid_236035)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_236045)[sext_i32_i64(local_tid_236035)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_236047)[sext_i32_i64(local_tid_236035)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_t_203576)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_225614;\n                double x_225615;\n                double x_225616;\n                double x_225617;\n                double x_225618;\n                double x_225619;\n                double x_225620;\n                double x_225621;\n                double x_225622;\n                double x_225623;\n                double x_236056;\n                double x_236057;\n                double x_236058;\n                double x_236059;\n                double x_236060;\n                double x_236061;\n                double x_236062;\n                double x_236063;\n                double x_236064;\n                double x_236065;\n                bool ltid_in_bounds_236071 =\n                     slt64(sext_i32_i64(local_tid_236035), q_t_203576 *\n                           squot64(segred_group_sizze_225602,\n                                   segment_sizze_nonzzero_236032));\n                int32_t skip_threads_236072;\n                \n                // read input for in-block scan\n                {\n                   ",
                   " if (ltid_in_bounds_236071) {\n                        x_225619 = ((volatile __local\n                                     double *) red_arr_mem_236039)[sext_i32_i64(local_tid_236035)];\n                        x_225620 = ((volatile __local\n                                     double *) red_arr_mem_236041)[sext_i32_i64(local_tid_236035)];\n                        x_225621 = ((volatile __local\n                                     double *) red_arr_mem_236043)[sext_i32_i64(local_tid_236035)];\n                        x_225622 = ((volatile __local\n                                     double *) red_arr_mem_236045)[sext_i32_i64(local_tid_236035)];\n                        x_225623 = ((volatile __local\n                                     double *) red_arr_mem_236047)[sext_i32_i64(local_tid_236035)];\n                        if ((local_tid_236035 - squot32(local_tid_236035, 32) *\n                             32) == 0) {\n                            x_225614 = x_225619;\n                            x_225615 = x_225620;\n                            x_225616 = x_225621;\n                            x_225617 = x_225622;\n                            x_225618 = x_225623;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_236072 = 1;\n                    while (slt32(skip_threads_236072, 32)) {\n                        bool thread_active_236073 = sle32(skip_threads_236072,\n                                                          local_tid_236035 -\n                                                          squot32(local_tid_236035,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_236071;\n                        \n                        if (thread_active_236073) {\n                            // read operands\n                            {\n                                x_225614 = ((volatile __l",
                   "ocal\n                                             double *) red_arr_mem_236039)[sext_i32_i64(local_tid_236035) -\n                                                                           sext_i32_i64(skip_threads_236072)];\n                                x_225615 = ((volatile __local\n                                             double *) red_arr_mem_236041)[sext_i32_i64(local_tid_236035) -\n                                                                           sext_i32_i64(skip_threads_236072)];\n                                x_225616 = ((volatile __local\n                                             double *) red_arr_mem_236043)[sext_i32_i64(local_tid_236035) -\n                                                                           sext_i32_i64(skip_threads_236072)];\n                                x_225617 = ((volatile __local\n                                             double *) red_arr_mem_236045)[sext_i32_i64(local_tid_236035) -\n                                                                           sext_i32_i64(skip_threads_236072)];\n                                x_225618 = ((volatile __local\n                                             double *) red_arr_mem_236047)[sext_i32_i64(local_tid_236035) -\n                                                                           sext_i32_i64(skip_threads_236072)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_236074 =\n                                 slt64(srem64(sext_i32_i64(local_tid_236035),\n                                              q_t_203576),\n                                       sext_i32_i64(local_tid_236035) -\n                                       sext_i32_i64(local_tid_236035 -\n                                       skip_threads_236072));\n                            \n                            if (thread_active_236073 && inactive_236074) {\n                            ",
                   "    x_225614 = x_225619;\n                                x_225615 = x_225620;\n                                x_225616 = x_225621;\n                                x_225617 = x_225622;\n                                x_225618 = x_225623;\n                            }\n                            if (thread_active_236073) {\n                                if (!inactive_236074) {\n                                    double defunc_1_op_res_225624 = x_225614 +\n                                           x_225619;\n                                    double defunc_1_op_res_225625 = x_225615 +\n                                           x_225620;\n                                    double defunc_1_op_res_225626 = x_225616 +\n                                           x_225621;\n                                    double defunc_1_op_res_225627 = x_225617 +\n                                           x_225622;\n                                    double defunc_1_op_res_225628 = x_225618 +\n                                           x_225623;\n                                    \n                                    x_225614 = defunc_1_op_res_225624;\n                                    x_225615 = defunc_1_op_res_225625;\n                                    x_225616 = defunc_1_op_res_225626;\n                                    x_225617 = defunc_1_op_res_225627;\n                                    x_225618 = defunc_1_op_res_225628;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_236037, skip_threads_236072)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_236073) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_236039)[sext_i32_i64(local_tid_236035)] =\n                                    x_22561",
                   "4;\n                                x_225619 = x_225614;\n                                ((volatile __local\n                                  double *) red_arr_mem_236041)[sext_i32_i64(local_tid_236035)] =\n                                    x_225615;\n                                x_225620 = x_225615;\n                                ((volatile __local\n                                  double *) red_arr_mem_236043)[sext_i32_i64(local_tid_236035)] =\n                                    x_225616;\n                                x_225621 = x_225616;\n                                ((volatile __local\n                                  double *) red_arr_mem_236045)[sext_i32_i64(local_tid_236035)] =\n                                    x_225617;\n                                x_225622 = x_225617;\n                                ((volatile __local\n                                  double *) red_arr_mem_236047)[sext_i32_i64(local_tid_236035)] =\n                                    x_225618;\n                                x_225623 = x_225618;\n                            }\n                        }\n                        if (sle32(wave_sizze_236037, skip_threads_236072)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_236072 *= 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_236035 - squot32(local_tid_236035, 32) *\n                         32) == 31 && ltid_in_bounds_236071) {\n                        ((volatile __local\n                          double *) red_arr_mem_236039)[sext_i32_i64(squot32(local_tid_236035,\n                                                                             32))] =\n                            x_225614;\n                        ((volatile __local\n                          double *) red_arr_mem_236041)[sext_i",
                   "32_i64(squot32(local_tid_236035,\n                                                                             32))] =\n                            x_225615;\n                        ((volatile __local\n                          double *) red_arr_mem_236043)[sext_i32_i64(squot32(local_tid_236035,\n                                                                             32))] =\n                            x_225616;\n                        ((volatile __local\n                          double *) red_arr_mem_236045)[sext_i32_i64(squot32(local_tid_236035,\n                                                                             32))] =\n                            x_225617;\n                        ((volatile __local\n                          double *) red_arr_mem_236047)[sext_i32_i64(squot32(local_tid_236035,\n                                                                             32))] =\n                            x_225618;\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_236075;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_236035, 32) == 0 &&\n                            ltid_in_bounds_236071) {\n                            x_236061 = ((volatile __local\n                                         double *) red_arr_mem_236039)[sext_i32_i64(local_tid_236035)];\n                            x_236062 = ((volatile __local\n                                         double *) red_arr_mem_236041)[sext_i32_i64(local_tid_236035)];\n                            x_236063 = ((volatile __local\n                                         double *) red_arr_mem_236043)[sext_i32_i64(local_tid_236035)];\n                            x_236064 = ((volatile __local\n                                         double *) r",
                   "ed_arr_mem_236045)[sext_i32_i64(local_tid_236035)];\n                            x_236065 = ((volatile __local\n                                         double *) red_arr_mem_236047)[sext_i32_i64(local_tid_236035)];\n                            if ((local_tid_236035 - squot32(local_tid_236035,\n                                                            32) * 32) == 0) {\n                                x_236056 = x_236061;\n                                x_236057 = x_236062;\n                                x_236058 = x_236063;\n                                x_236059 = x_236064;\n                                x_236060 = x_236065;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_236075 = 1;\n                        while (slt32(skip_threads_236075, 32)) {\n                            bool thread_active_236076 =\n                                 sle32(skip_threads_236075, local_tid_236035 -\n                                       squot32(local_tid_236035, 32) * 32) &&\n                                 (squot32(local_tid_236035, 32) == 0 &&\n                                  ltid_in_bounds_236071);\n                            \n                            if (thread_active_236076) {\n                                // read operands\n                                {\n                                    x_236056 = ((volatile __local\n                                                 double *) red_arr_mem_236039)[sext_i32_i64(local_tid_236035) -\n                                                                               sext_i32_i64(skip_threads_236075)];\n                                    x_236057 = ((volatile __local\n                                                 double *) red_arr_mem_236041)[sext_i32_i64(local_tid_236035) -\n                                                                               sext_i32_i64(skip_thre",
                   "ads_236075)];\n                                    x_236058 = ((volatile __local\n                                                 double *) red_arr_mem_236043)[sext_i32_i64(local_tid_236035) -\n                                                                               sext_i32_i64(skip_threads_236075)];\n                                    x_236059 = ((volatile __local\n                                                 double *) red_arr_mem_236045)[sext_i32_i64(local_tid_236035) -\n                                                                               sext_i32_i64(skip_threads_236075)];\n                                    x_236060 = ((volatile __local\n                                                 double *) red_arr_mem_236047)[sext_i32_i64(local_tid_236035) -\n                                                                               sext_i32_i64(skip_threads_236075)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_236077 =\n                                     slt64(srem64(sext_i32_i64(local_tid_236035 *\n                                                  32 + 32 - 1), q_t_203576),\n                                           sext_i32_i64(local_tid_236035 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_236035 -\n                                                         skip_threads_236075) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_236076 && inactive_236077) {\n                                    x_236056 = x_236061;\n                                    x_236057 = x_236062;\n                                    x_236058 = x_236063;\n                                    x_236059 = x_236064;\n                                    x_236060 = x_236065;\n      ",
                   "                          }\n                                if (thread_active_236076) {\n                                    if (!inactive_236077) {\n                                        double defunc_1_op_res_236066 =\n                                               x_236056 + x_236061;\n                                        double defunc_1_op_res_236067 =\n                                               x_236057 + x_236062;\n                                        double defunc_1_op_res_236068 =\n                                               x_236058 + x_236063;\n                                        double defunc_1_op_res_236069 =\n                                               x_236059 + x_236064;\n                                        double defunc_1_op_res_236070 =\n                                               x_236060 + x_236065;\n                                        \n                                        x_236056 = defunc_1_op_res_236066;\n                                        x_236057 = defunc_1_op_res_236067;\n                                        x_236058 = defunc_1_op_res_236068;\n                                        x_236059 = defunc_1_op_res_236069;\n                                        x_236060 = defunc_1_op_res_236070;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_236037, skip_threads_236075)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_236076) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_236039)[sext_i32_i64(local_tid_236035)] =\n                                        x_236056;\n                                    x_236061 = x_236056;\n                                    ((volatile __local\n    ",
                   "                                  double *) red_arr_mem_236041)[sext_i32_i64(local_tid_236035)] =\n                                        x_236057;\n                                    x_236062 = x_236057;\n                                    ((volatile __local\n                                      double *) red_arr_mem_236043)[sext_i32_i64(local_tid_236035)] =\n                                        x_236058;\n                                    x_236063 = x_236058;\n                                    ((volatile __local\n                                      double *) red_arr_mem_236045)[sext_i32_i64(local_tid_236035)] =\n                                        x_236059;\n                                    x_236064 = x_236059;\n                                    ((volatile __local\n                                      double *) red_arr_mem_236047)[sext_i32_i64(local_tid_236035)] =\n                                        x_236060;\n                                    x_236065 = x_236060;\n                                }\n                            }\n                            if (sle32(wave_sizze_236037, skip_threads_236075)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_236075 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_236078 = squot32(local_tid_236035, 32) == 0 ||\n                     !ltid_in_bounds_236071;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_236078) {\n                            x_225619 = x_225614;\n                            x_225620 = x_225615;\n                            x_225621 = x_225616;\n                            x_225622 = x_225617;\n                            x_225623 = x_225618;\n       ",
                   "                     x_225614 = ((__local\n                                         double *) red_arr_mem_236039)[sext_i32_i64(squot32(local_tid_236035,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_225615 = ((__local\n                                         double *) red_arr_mem_236041)[sext_i32_i64(squot32(local_tid_236035,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_225616 = ((__local\n                                         double *) red_arr_mem_236043)[sext_i32_i64(squot32(local_tid_236035,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_225617 = ((__local\n                                         double *) red_arr_mem_236045)[sext_i32_i64(squot32(local_tid_236035,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_225618 = ((__local\n                                         double *) red_arr_mem_236047)[sext_i32_i64(squot32(local_tid_236035,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_236079 =\n                             slt64(srem64(sext_i32_i64(local_tid_236035),\n                                          q_t_203576),\n     ",
                   "                              sext_i32_i64(local_tid_236035) -\n                                   sext_i32_i64(squot32(local_tid_236035, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_236078) {\n                            if (inactive_236079) {\n                                x_225614 = x_225619;\n                                x_225615 = x_225620;\n                                x_225616 = x_225621;\n                                x_225617 = x_225622;\n                                x_225618 = x_225623;\n                            }\n                        }\n                        if (!no_carry_in_236078) {\n                            if (!inactive_236079) {\n                                double defunc_1_op_res_225624 = x_225614 +\n                                       x_225619;\n                                double defunc_1_op_res_225625 = x_225615 +\n                                       x_225620;\n                                double defunc_1_op_res_225626 = x_225616 +\n                                       x_225621;\n                                double defunc_1_op_res_225627 = x_225617 +\n                                       x_225622;\n                                double defunc_1_op_res_225628 = x_225618 +\n                                       x_225623;\n                                \n                                x_225614 = defunc_1_op_res_225624;\n                                x_225615 = defunc_1_op_res_225625;\n                                x_225616 = defunc_1_op_res_225626;\n                                x_225617 = defunc_1_op_res_225627;\n                                x_225618 = defunc_1_op_res_225628;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_236078) {\n                            ((__local\n                              double *) re",
                   "d_arr_mem_236039)[sext_i32_i64(local_tid_236035)] =\n                                x_225614;\n                            ((__local\n                              double *) red_arr_mem_236041)[sext_i32_i64(local_tid_236035)] =\n                                x_225615;\n                            ((__local\n                              double *) red_arr_mem_236043)[sext_i32_i64(local_tid_236035)] =\n                                x_225616;\n                            ((__local\n                              double *) red_arr_mem_236045)[sext_i32_i64(local_tid_236035)] =\n                                x_225617;\n                            ((__local\n                              double *) red_arr_mem_236047)[sext_i32_i64(local_tid_236035)] =\n                                x_225618;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_236035, 32) == 0 &&\n                        ltid_in_bounds_236071) {\n                        ((__local\n                          double *) red_arr_mem_236039)[sext_i32_i64(local_tid_236035)] =\n                            x_225619;\n                        ((__local\n                          double *) red_arr_mem_236041)[sext_i32_i64(local_tid_236035)] =\n                            x_225620;\n                        ((__local\n                          double *) red_arr_mem_236043)[sext_i32_i64(local_tid_236035)] =\n                            x_225621;\n                        ((__local\n                          double *) red_arr_mem_236045)[sext_i32_i64(local_tid_236035)] =\n                            x_225622;\n                        ((__local\n                          double *) red_arr_mem_236047)[sext_i32_i64(local_tid_236035)] =\n                            x_225623;\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_236051) *\n                      squot64(segred_group_sizze_225602,\n                              segment_sizze_nonzzero_236032) +\n                      sext_i32_i64(local_tid_236035), partition_sizze_203667 *\n                      t_n_m_203740) && slt64(sext_i32_i64(local_tid_236035),\n                                             squot64(segred_group_sizze_225602,\n                                                     segment_sizze_nonzzero_236032))) {\n                double tmp_236080;\n                \n                tmp_236080 = ((__local\n                               double *) red_arr_mem_236039)[(sext_i32_i64(local_tid_236035) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_236032 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231446)[squot64(sext_i32_i64(virt_group_id_236051) *\n                                                squot64(segred_group_sizze_225602,\n                                                        segment_sizze_nonzzero_236032) +\n                                                sext_i32_i64(local_tid_236035),\n                                                t_n_m_203740) * t_n_m_203740 +\n                                        (sext_i32_i64(virt_group_id_236051) *\n                                         squot64(segred_group_sizze_225602,\n                                                 segment_sizze_nonzzero_236032) +\n                                         sext_i32_i64(local_tid_236035) -\n                                         squot64(sext_i32_i64(virt_group_id_236051) *\n                                                 squot64(segred_group_sizze_225602,\n                                             ",
                   "            segment_sizze_nonzzero_236032) +\n                                                 sext_i32_i64(local_tid_236035),\n                                                 t_n_m_203740) *\n                                         t_n_m_203740)] = tmp_236080;\n                \n                double tmp_236081;\n                \n                tmp_236081 = ((__local\n                               double *) red_arr_mem_236041)[(sext_i32_i64(local_tid_236035) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_236032 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231450)[squot64(sext_i32_i64(virt_group_id_236051) *\n                                                squot64(segred_group_sizze_225602,\n                                                        segment_sizze_nonzzero_236032) +\n                                                sext_i32_i64(local_tid_236035),\n                                                t_n_m_203740) * t_n_m_203740 +\n                                        (sext_i32_i64(virt_group_id_236051) *\n                                         squot64(segred_group_sizze_225602,\n                                                 segment_sizze_nonzzero_236032) +\n                                         sext_i32_i64(local_tid_236035) -\n                                         squot64(sext_i32_i64(virt_group_id_236051) *\n                                                 squot64(segred_group_sizze_225602,\n                                                         segment_sizze_nonzzero_236032) +\n                                                 sext_i32_i64(local_tid_236035),\n                                                 t_n_m_203740) *\n                                         t_n_m_203740)] = tmp_236081;\n                \n                double tmp_236082;\n          ",
                   "      \n                tmp_236082 = ((__local\n                               double *) red_arr_mem_236043)[(sext_i32_i64(local_tid_236035) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_236032 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231454)[squot64(sext_i32_i64(virt_group_id_236051) *\n                                                squot64(segred_group_sizze_225602,\n                                                        segment_sizze_nonzzero_236032) +\n                                                sext_i32_i64(local_tid_236035),\n                                                t_n_m_203740) * t_n_m_203740 +\n                                        (sext_i32_i64(virt_group_id_236051) *\n                                         squot64(segred_group_sizze_225602,\n                                                 segment_sizze_nonzzero_236032) +\n                                         sext_i32_i64(local_tid_236035) -\n                                         squot64(sext_i32_i64(virt_group_id_236051) *\n                                                 squot64(segred_group_sizze_225602,\n                                                         segment_sizze_nonzzero_236032) +\n                                                 sext_i32_i64(local_tid_236035),\n                                                 t_n_m_203740) *\n                                         t_n_m_203740)] = tmp_236082;\n                \n                double tmp_236083;\n                \n                tmp_236083 = ((__local\n                               double *) red_arr_mem_236045)[(sext_i32_i64(local_tid_236035) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_236032 -\n            ",
                   "                                                 (int64_t) 1];\n                ((__global\n                  double *) mem_231458)[squot64(sext_i32_i64(virt_group_id_236051) *\n                                                squot64(segred_group_sizze_225602,\n                                                        segment_sizze_nonzzero_236032) +\n                                                sext_i32_i64(local_tid_236035),\n                                                t_n_m_203740) * t_n_m_203740 +\n                                        (sext_i32_i64(virt_group_id_236051) *\n                                         squot64(segred_group_sizze_225602,\n                                                 segment_sizze_nonzzero_236032) +\n                                         sext_i32_i64(local_tid_236035) -\n                                         squot64(sext_i32_i64(virt_group_id_236051) *\n                                                 squot64(segred_group_sizze_225602,\n                                                         segment_sizze_nonzzero_236032) +\n                                                 sext_i32_i64(local_tid_236035),\n                                                 t_n_m_203740) *\n                                         t_n_m_203740)] = tmp_236083;\n                \n                double tmp_236084;\n                \n                tmp_236084 = ((__local\n                               double *) red_arr_mem_236047)[(sext_i32_i64(local_tid_236035) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_236032 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231462)[squot64(sext_i32_i64(virt_group_id_236051) *\n                                                squot64(segred_group_sizze_225602,\n                                                        segment_s",
                   "izze_nonzzero_236032) +\n                                                sext_i32_i64(local_tid_236035),\n                                                t_n_m_203740) * t_n_m_203740 +\n                                        (sext_i32_i64(virt_group_id_236051) *\n                                         squot64(segred_group_sizze_225602,\n                                                 segment_sizze_nonzzero_236032) +\n                                         sext_i32_i64(local_tid_236035) -\n                                         squot64(sext_i32_i64(virt_group_id_236051) *\n                                                 squot64(segred_group_sizze_225602,\n                                                         segment_sizze_nonzzero_236032) +\n                                                 sext_i32_i64(local_tid_236035),\n                                                 t_n_m_203740) *\n                                         t_n_m_203740)] = tmp_236084;\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_225602\n}\n__kernel void mainzisegred_small_225714(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_236179_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_236177_backing_aligned_1,\n                                        int64_t n_203572, int64_t q_t_203576,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t t_n_m_203740, int64_t i_203760,\n                                        int64_t num_groups_225707,\n                                        int64_t segment_sizze_nonzzero_236170,\n                                      ",
                   "  __global unsigned char *ext_mem_229304,\n                                        __global unsigned char *ext_mem_229305,\n                                        __global unsigned char *ext_mem_229568,\n                                        __global unsigned char *ext_mem_229569,\n                                        __global unsigned char *mem_231428,\n                                        __global unsigned char *mem_231432,\n                                        __global unsigned char *mem_231467,\n                                        __global unsigned char *mem_231471,\n                                        __global unsigned char *mem_231475,\n                                        __global unsigned char *mem_231479,\n                                        __global unsigned char *mem_231483,\n                                        __global unsigned char *mem_231488,\n                                        __global unsigned char *mem_231492)\n{\n    #define segred_group_sizze_225706 (mainzisegred_group_sizze_224922)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_236179_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236179_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_236177_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236177_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236172;\n    int32_t local_tid_236173;\n    int64_t group_sizze_236176;\n    int32_t wave_sizze_236175;\n    int32_t group_tid_236174;\n    \n    global_tid_236172 = get_global_id(0);\n    local_tid_236173 = get_local_id(0);\n    group_sizze_236176 = get_local_size(0);\n    wave_sizze_236175 = LOCKSTEP_WIDTH;\n    group_tid_236174 = get_group_id(0);\n    ",
                   "\n    int32_t phys_tid_225714 = global_tid_236172;\n    __local unsigned char *red_arr_mem_236177;\n    \n    red_arr_mem_236177 = (__local unsigned char *) red_arr_mem_236177_backing_0;\n    \n    __local unsigned char *red_arr_mem_236179;\n    \n    red_arr_mem_236179 = (__local unsigned char *) red_arr_mem_236179_backing_1;\n    \n    int32_t phys_group_id_236181;\n    \n    phys_group_id_236181 = get_group_id(0);\n    for (int32_t i_236182 = 0; i_236182 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * t_n_m_203740,\n                                          squot64(segred_group_sizze_225706,\n                                                  segment_sizze_nonzzero_236170))) -\n                   phys_group_id_236181, sext_i64_i32(num_groups_225707));\n         i_236182++) {\n        int32_t virt_group_id_236183 = phys_group_id_236181 + i_236182 *\n                sext_i64_i32(num_groups_225707);\n        int64_t slice_236184 = t_n_m_203740;\n        int64_t slice_236185 = partition_sizze_203667 * slice_236184;\n        int64_t gtid_225711 = squot64(squot64(sext_i32_i64(local_tid_236173),\n                                              segment_sizze_nonzzero_236170) +\n                                      sext_i32_i64(virt_group_id_236183) *\n                                      squot64(segred_group_sizze_225706,\n                                              segment_sizze_nonzzero_236170),\n                                      slice_236184);\n        int64_t remnant_236186 = squot64(sext_i32_i64(local_tid_236173),\n                                         segment_sizze_nonzzero_236170) +\n                sext_i32_i64(virt_group_id_236183) *\n                squot64(segred_group_sizze_225706,\n                        segment_sizze_nonzzero_236170) - gtid_225711 *\n                slice_236184;\n        int64_t gtid_225712 = remnant_236186;\n        int64_t remnant_236187 = remnant_236186 - gtid_225712;\n        int64_t gtid_225713 = srem64(sext_i32_i64(local_tid_236173),\n     ",
                   "                                q_t_203576);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_t_203576) && ((slt64(gtid_225711,\n                                                          partition_sizze_203667) &&\n                                                    slt64(gtid_225712,\n                                                          t_n_m_203740)) &&\n                                                   slt64(sext_i32_i64(local_tid_236173),\n                                                         q_t_203576 *\n                                                         squot64(segred_group_sizze_225706,\n                                                                 segment_sizze_nonzzero_236170)))) {\n                int64_t x_225722;\n                \n                x_225722 = ((__global int64_t *) ext_mem_229304)[gtid_225711];\n                \n                int64_t x_225733;\n                \n                x_225733 = ((__global int64_t *) ext_mem_229569)[gtid_225711 *\n                                                                 t_n_m_203740 +\n                                                                 gtid_225712];\n                \n                double x_225734;\n                \n                x_225734 = ((__global double *) ext_mem_229568)[gtid_225711 *\n                                                                t_n_m_203740 +\n                                                                gtid_225712];\n                \n                int64_t binop_y_228765 = mul64(jump_t_203582, gtid_225712);\n                int64_t binop_y_228766 = smin64(i_203760, binop_y_228765);\n                int64_t index_primexp_228767 = add64((int64_t) 1,\n                                                     binop_y_228766);\n                double a12_225736;\n                \n                a12_225736 = ((__global double *) mem_231467)[gtid_225711 *\n                                                              t_n_m_",
                   "203740 +\n                                                              gtid_225712];\n                \n                double b12_225737;\n                \n                b12_225737 = ((__global double *) mem_231471)[gtid_225711 *\n                                                              t_n_m_203740 +\n                                                              gtid_225712];\n                \n                double c12_225738;\n                \n                c12_225738 = ((__global double *) mem_231475)[gtid_225711 *\n                                                              t_n_m_203740 +\n                                                              gtid_225712];\n                \n                double b2_225739;\n                \n                b2_225739 = ((__global double *) mem_231479)[gtid_225711 *\n                                                             t_n_m_203740 +\n                                                             gtid_225712];\n                \n                double c2_225740;\n                \n                c2_225740 = ((__global double *) mem_231483)[gtid_225711 *\n                                                             t_n_m_203740 +\n                                                             gtid_225712];\n                \n                bool cond_225742 = sle64(x_225722, gtid_225713);\n                int64_t defunc_0_f_res_225743;\n                \n                if (cond_225742) {\n                    defunc_0_f_res_225743 = (int64_t) 0;\n                } else {\n                    int64_t i_225744 = add64(gtid_225713, x_225733);\n                    int64_t defunc_0_add_arg_225745;\n                    \n                    defunc_0_add_arg_225745 = ((__global\n                                                int64_t *) ext_mem_229305)[gtid_225711 *\n                                                                           n_203572 +\n                                                                           i_225744];\n       ",
                   "             \n                    int64_t defunc_1_add_res_225746 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_225745);\n                    \n                    defunc_0_f_res_225743 = defunc_1_add_res_225746;\n                }\n                \n                double defunc_0_f_res_225747;\n                \n                if (cond_225742) {\n                    defunc_0_f_res_225747 = 0.0;\n                } else {\n                    int64_t i_225748 = add64(gtid_225713, x_225733);\n                    double defunc_0_add_arg_225749;\n                    \n                    defunc_0_add_arg_225749 = ((__global\n                                                double *) mem_231428)[gtid_225711 *\n                                                                      n_203572 +\n                                                                      i_225748];\n                    defunc_0_f_res_225747 = defunc_0_add_arg_225749;\n                }\n                \n                int64_t binop_p_225750 = sub64(defunc_0_f_res_225743,\n                                               index_primexp_228767);\n                double defunc_0_f_res_225751 = sitofp_i64_f64(binop_p_225750);\n                double abs_res_225752 = fabs(defunc_0_f_res_225751);\n                double tmp1_225753 = abs_res_225752 / x_225734;\n                double x_225754 = tmp1_225753 * tmp1_225753;\n                double y_225755 = tmp1_225753 * x_225754;\n                double tmp2_225756 = 1.0 - y_225755;\n                double x_225757 = tmp2_225756 * tmp2_225756;\n                double tmp3_225758 = tmp2_225756 * x_225757;\n                double tmp4_225759 = defunc_0_f_res_225747 * tmp3_225758;\n                double defunc_1_f_res_225760 = defunc_0_f_res_225751 *\n                       tmp4_225759;\n                double defunc_1_f_res_225761 = defunc_0_f_res_225751 *\n                       defunc_1_f_res_225760;\n                double defunc_0_f_res",
                   "_225762;\n                \n                if (cond_225742) {\n                    defunc_0_f_res_225762 = 0.0;\n                } else {\n                    int64_t i_225763 = add64(gtid_225713, x_225733);\n                    double defunc_0_add_arg_225764;\n                    \n                    defunc_0_add_arg_225764 = ((__global\n                                                double *) mem_231432)[gtid_225711 *\n                                                                      n_203572 +\n                                                                      i_225763];\n                    defunc_0_f_res_225762 = defunc_0_add_arg_225764;\n                }\n                \n                double x_225765 = a12_225736 * tmp4_225759;\n                double y_225766 = b12_225737 * defunc_1_f_res_225760;\n                double x_225767 = x_225765 + y_225766;\n                double y_225768 = c12_225738 * defunc_1_f_res_225761;\n                double x_225769 = x_225767 + y_225768;\n                double defunc_9_fit_fun_res_225770 = defunc_0_f_res_225762 *\n                       x_225769;\n                double x_225771 = b12_225737 * tmp4_225759;\n                double y_225772 = b2_225739 * defunc_1_f_res_225760;\n                double x_225773 = x_225771 + y_225772;\n                double y_225774 = c2_225740 * defunc_1_f_res_225761;\n                double x_225775 = x_225773 + y_225774;\n                double defunc_9_slope_fun_res_225776 = defunc_0_f_res_225762 *\n                       x_225775;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_236177)[sext_i32_i64(local_tid_236173)] =\n                        defunc_9_fit_fun_res_225770;\n                    ((__local\n                      double *) red_arr_mem_236179)[sext_i32_i64(local_tid_236173)] =\n                        defunc_9_slope_fun_res_225",
                   "776;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_236177)[sext_i32_i64(local_tid_236173)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_236179)[sext_i32_i64(local_tid_236173)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_t_203576)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_225715;\n                double x_225716;\n                double x_225717;\n                double x_225718;\n                double x_236188;\n                double x_236189;\n                double x_236190;\n                double x_236191;\n                bool ltid_in_bounds_236194 =\n                     slt64(sext_i32_i64(local_tid_236173), q_t_203576 *\n                           squot64(segred_group_sizze_225706,\n                                   segment_sizze_nonzzero_236170));\n                int32_t skip_threads_236195;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_236194) {\n                        x_225717 = ((volatile __local\n                                     double *) red_arr_mem_236177)[sext_i32_i64(local_tid_236173)];\n                        x_225718 = ((volatile __local\n                                     double *) red_arr_mem_236179)[sext_i32_i64(local_tid_236173)];\n                        if ((local_tid_236173 - squot32(local_tid_236173, 32) *\n                             32) == 0) {\n                            x_225715 = x_225717;\n                            x_225716 = x_225718;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_236195 = 1;\n                    while (slt32(skip_threads_236195, 32)) {\n                        bool thread_acti",
                   "ve_236196 = sle32(skip_threads_236195,\n                                                          local_tid_236173 -\n                                                          squot32(local_tid_236173,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_236194;\n                        \n                        if (thread_active_236196) {\n                            // read operands\n                            {\n                                x_225715 = ((volatile __local\n                                             double *) red_arr_mem_236177)[sext_i32_i64(local_tid_236173) -\n                                                                           sext_i32_i64(skip_threads_236195)];\n                                x_225716 = ((volatile __local\n                                             double *) red_arr_mem_236179)[sext_i32_i64(local_tid_236173) -\n                                                                           sext_i32_i64(skip_threads_236195)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_236197 =\n                                 slt64(srem64(sext_i32_i64(local_tid_236173),\n                                              q_t_203576),\n                                       sext_i32_i64(local_tid_236173) -\n                                       sext_i32_i64(local_tid_236173 -\n                                       skip_threads_236195));\n                            \n                            if (thread_active_236196 && inactive_236197) {\n                                x_225715 = x_225717;\n                                x_225716 = x_225718;\n                            }\n                            if (thread_active_236196) {\n                                if (!inactive_236197) {\n                                    double defunc_1_op_res_225719 = x_225715 +\n    ",
                   "                                       x_225717;\n                                    double defunc_1_op_res_225720 = x_225716 +\n                                           x_225718;\n                                    \n                                    x_225715 = defunc_1_op_res_225719;\n                                    x_225716 = defunc_1_op_res_225720;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_236175, skip_threads_236195)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_236196) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_236177)[sext_i32_i64(local_tid_236173)] =\n                                    x_225715;\n                                x_225717 = x_225715;\n                                ((volatile __local\n                                  double *) red_arr_mem_236179)[sext_i32_i64(local_tid_236173)] =\n                                    x_225716;\n                                x_225718 = x_225716;\n                            }\n                        }\n                        if (sle32(wave_sizze_236175, skip_threads_236195)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_236195 *= 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_236173 - squot32(local_tid_236173, 32) *\n                         32) == 31 && ltid_in_bounds_236194) {\n                        ((volatile __local\n                          double *) red_arr_mem_236177)[sext_i32_i64(squot32(local_tid_236173,\n                                           ",
                   "                                  32))] =\n                            x_225715;\n                        ((volatile __local\n                          double *) red_arr_mem_236179)[sext_i32_i64(squot32(local_tid_236173,\n                                                                             32))] =\n                            x_225716;\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_236198;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_236173, 32) == 0 &&\n                            ltid_in_bounds_236194) {\n                            x_236190 = ((volatile __local\n                                         double *) red_arr_mem_236177)[sext_i32_i64(local_tid_236173)];\n                            x_236191 = ((volatile __local\n                                         double *) red_arr_mem_236179)[sext_i32_i64(local_tid_236173)];\n                            if ((local_tid_236173 - squot32(local_tid_236173,\n                                                            32) * 32) == 0) {\n                                x_236188 = x_236190;\n                                x_236189 = x_236191;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_236198 = 1;\n                        while (slt32(skip_threads_236198, 32)) {\n                            bool thread_active_236199 =\n                                 sle32(skip_threads_236198, local_tid_236173 -\n                                       squot32(local_tid_236173, 32) * 32) &&\n                                 (squot32(local_tid_236173, 32) == 0 &&\n                                  ltid_in",
                   "_bounds_236194);\n                            \n                            if (thread_active_236199) {\n                                // read operands\n                                {\n                                    x_236188 = ((volatile __local\n                                                 double *) red_arr_mem_236177)[sext_i32_i64(local_tid_236173) -\n                                                                               sext_i32_i64(skip_threads_236198)];\n                                    x_236189 = ((volatile __local\n                                                 double *) red_arr_mem_236179)[sext_i32_i64(local_tid_236173) -\n                                                                               sext_i32_i64(skip_threads_236198)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_236200 =\n                                     slt64(srem64(sext_i32_i64(local_tid_236173 *\n                                                  32 + 32 - 1), q_t_203576),\n                                           sext_i32_i64(local_tid_236173 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_236173 -\n                                                         skip_threads_236198) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_236199 && inactive_236200) {\n                                    x_236188 = x_236190;\n                                    x_236189 = x_236191;\n                                }\n                                if (thread_active_236199) {\n                                    if (!inactive_236200) {\n                                        double defunc_1_op_res_236192 =\n                                               x_236188 + x_236190;\n     ",
                   "                                   double defunc_1_op_res_236193 =\n                                               x_236189 + x_236191;\n                                        \n                                        x_236188 = defunc_1_op_res_236192;\n                                        x_236189 = defunc_1_op_res_236193;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_236175, skip_threads_236198)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_236199) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_236177)[sext_i32_i64(local_tid_236173)] =\n                                        x_236188;\n                                    x_236190 = x_236188;\n                                    ((volatile __local\n                                      double *) red_arr_mem_236179)[sext_i32_i64(local_tid_236173)] =\n                                        x_236189;\n                                    x_236191 = x_236189;\n                                }\n                            }\n                            if (sle32(wave_sizze_236175, skip_threads_236198)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_236198 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_236201 = squot32(local_tid_236173, 32) == 0 ||\n                     !ltid_in_bounds_236194;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_c",
                   "arry_in_236201) {\n                            x_225717 = x_225715;\n                            x_225718 = x_225716;\n                            x_225715 = ((__local\n                                         double *) red_arr_mem_236177)[sext_i32_i64(squot32(local_tid_236173,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_225716 = ((__local\n                                         double *) red_arr_mem_236179)[sext_i32_i64(squot32(local_tid_236173,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_236202 =\n                             slt64(srem64(sext_i32_i64(local_tid_236173),\n                                          q_t_203576),\n                                   sext_i32_i64(local_tid_236173) -\n                                   sext_i32_i64(squot32(local_tid_236173, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_236201) {\n                            if (inactive_236202) {\n                                x_225715 = x_225717;\n                                x_225716 = x_225718;\n                            }\n                        }\n                        if (!no_carry_in_236201) {\n                            if (!inactive_236202) {\n                                double defunc_1_op_res_225719 = x_225715 +\n                                       x_225717;\n                                double defunc_1_op_res_225720 = x_225716 +\n                                       x_225718;\n                                \n                                x_225715 = de",
                   "func_1_op_res_225719;\n                                x_225716 = defunc_1_op_res_225720;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_236201) {\n                            ((__local\n                              double *) red_arr_mem_236177)[sext_i32_i64(local_tid_236173)] =\n                                x_225715;\n                            ((__local\n                              double *) red_arr_mem_236179)[sext_i32_i64(local_tid_236173)] =\n                                x_225716;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_236173, 32) == 0 &&\n                        ltid_in_bounds_236194) {\n                        ((__local\n                          double *) red_arr_mem_236177)[sext_i32_i64(local_tid_236173)] =\n                            x_225717;\n                        ((__local\n                          double *) red_arr_mem_236179)[sext_i32_i64(local_tid_236173)] =\n                            x_225718;\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_236183) *\n                      squot64(segred_group_sizze_225706,\n                              segment_sizze_nonzzero_236170) +\n                      sext_i32_i64(local_tid_236173), partition_sizze_203667 *\n                      t_n_m_203740) && slt64(sext_i32_i64(local_tid_236173),\n                                             squot64(segred_group_sizze_225706,\n                                                     segment_sizze_nonzzero_236170))) {\n                double tmp_236203;\n          ",
                   "      \n                tmp_236203 = ((__local\n                               double *) red_arr_mem_236177)[(sext_i32_i64(local_tid_236173) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_236170 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231488)[squot64(sext_i32_i64(virt_group_id_236183) *\n                                                squot64(segred_group_sizze_225706,\n                                                        segment_sizze_nonzzero_236170) +\n                                                sext_i32_i64(local_tid_236173),\n                                                t_n_m_203740) * t_n_m_203740 +\n                                        (sext_i32_i64(virt_group_id_236183) *\n                                         squot64(segred_group_sizze_225706,\n                                                 segment_sizze_nonzzero_236170) +\n                                         sext_i32_i64(local_tid_236173) -\n                                         squot64(sext_i32_i64(virt_group_id_236183) *\n                                                 squot64(segred_group_sizze_225706,\n                                                         segment_sizze_nonzzero_236170) +\n                                                 sext_i32_i64(local_tid_236173),\n                                                 t_n_m_203740) *\n                                         t_n_m_203740)] = tmp_236203;\n                \n                double tmp_236204;\n                \n                tmp_236204 = ((__local\n                               double *) red_arr_mem_236179)[(sext_i32_i64(local_tid_236173) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_236170 -\n            ",
                   "                                                 (int64_t) 1];\n                ((__global\n                  double *) mem_231492)[squot64(sext_i32_i64(virt_group_id_236183) *\n                                                squot64(segred_group_sizze_225706,\n                                                        segment_sizze_nonzzero_236170) +\n                                                sext_i32_i64(local_tid_236173),\n                                                t_n_m_203740) * t_n_m_203740 +\n                                        (sext_i32_i64(virt_group_id_236183) *\n                                         squot64(segred_group_sizze_225706,\n                                                 segment_sizze_nonzzero_236170) +\n                                         sext_i32_i64(local_tid_236173) -\n                                         squot64(sext_i32_i64(virt_group_id_236183) *\n                                                 squot64(segred_group_sizze_225706,\n                                                         segment_sizze_nonzzero_236170) +\n                                                 sext_i32_i64(local_tid_236173),\n                                                 t_n_m_203740) *\n                                         t_n_m_203740)] = tmp_236204;\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_225706\n}\n__kernel void mainzisegred_small_228180(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_236698_backing_aligned_0,\n                                        int64_t n_203572,\n                                        int64_t partition_sizze_203667,\n                                        int64_t stl_res_203754,\n                                        int64_t j_m_i_204223,\n                                        in",
                   "t64_t num_groups_228175,\n                                        int64_t segment_sizze_nonzzero_236691,\n                                        __global unsigned char *ext_mem_231924,\n                                        __global unsigned char *mem_231941)\n{\n    #define segred_group_sizze_228174 (mainzisegred_group_sizze_228157)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_236698_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236698_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236693;\n    int32_t local_tid_236694;\n    int64_t group_sizze_236697;\n    int32_t wave_sizze_236696;\n    int32_t group_tid_236695;\n    \n    global_tid_236693 = get_global_id(0);\n    local_tid_236694 = get_local_id(0);\n    group_sizze_236697 = get_local_size(0);\n    wave_sizze_236696 = LOCKSTEP_WIDTH;\n    group_tid_236695 = get_group_id(0);\n    \n    int32_t phys_tid_228180 = global_tid_236693;\n    __local unsigned char *red_arr_mem_236698;\n    \n    red_arr_mem_236698 = (__local unsigned char *) red_arr_mem_236698_backing_0;\n    \n    int32_t phys_group_id_236700;\n    \n    phys_group_id_236700 = get_group_id(0);\n    for (int32_t i_236701 = 0; i_236701 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667,\n                                          squot64(segred_group_sizze_228174,\n                                                  segment_sizze_nonzzero_236691))) -\n                   phys_group_id_236700, sext_i64_i32(num_groups_228175));\n         i_236701++) {\n        int32_t virt_group_id_236702 = phys_group_id_236700 + i_236701 *\n                sext_i64_i32(num_groups_228175);\n        int64_t slice_236703 = partition_sizze_203667;\n        int64_t gtid_228178 = squot64(sext_i32_i64(local_tid_236694),\n                                      se",
                   "gment_sizze_nonzzero_236691) +\n                sext_i32_i64(virt_group_id_236702) *\n                squot64(segred_group_sizze_228174,\n                        segment_sizze_nonzzero_236691);\n        int64_t remnant_236704 = squot64(sext_i32_i64(local_tid_236694),\n                                         segment_sizze_nonzzero_236691) +\n                sext_i32_i64(virt_group_id_236702) *\n                squot64(segred_group_sizze_228174,\n                        segment_sizze_nonzzero_236691) - gtid_228178;\n        int64_t gtid_228179 = srem64(sext_i32_i64(local_tid_236694),\n                                     j_m_i_204223);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, j_m_i_204223) && (slt64(gtid_228178,\n                                                           partition_sizze_203667) &&\n                                                     slt64(sext_i32_i64(local_tid_236694),\n                                                           j_m_i_204223 *\n                                                           squot64(segred_group_sizze_228174,\n                                                                   segment_sizze_nonzzero_236691)))) {\n                int64_t slice_228309 = stl_res_203754 + gtid_228179;\n                double x_228185;\n                \n                x_228185 = ((__global double *) ext_mem_231924)[gtid_228178 *\n                                                                n_203572 +\n                                                                slice_228309];\n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_236698)[sext_i32_i64(local_tid_236694)] =\n                        x_228185;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_236698)[sext_i32_i64(local_tid_236694)] =\n             ",
                   "       0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, j_m_i_204223)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_228181;\n                double x_228182;\n                double x_236705;\n                double x_236706;\n                bool ltid_in_bounds_236708 =\n                     slt64(sext_i32_i64(local_tid_236694), j_m_i_204223 *\n                           squot64(segred_group_sizze_228174,\n                                   segment_sizze_nonzzero_236691));\n                int32_t skip_threads_236709;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_236708) {\n                        x_228182 = ((volatile __local\n                                     double *) red_arr_mem_236698)[sext_i32_i64(local_tid_236694)];\n                        if ((local_tid_236694 - squot32(local_tid_236694, 32) *\n                             32) == 0) {\n                            x_228181 = x_228182;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_236709 = 1;\n                    while (slt32(skip_threads_236709, 32)) {\n                        bool thread_active_236710 = sle32(skip_threads_236709,\n                                                          local_tid_236694 -\n                                                          squot32(local_tid_236694,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_236708;\n                        \n                        if (thread_active_236710) {\n                            // read operands\n                            {\n                                x_228181 = ((volatile __local\n                                             double *) red_arr_mem_236698)[sext_i32_",
                   "i64(local_tid_236694) -\n                                                                           sext_i32_i64(skip_threads_236709)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_236711 =\n                                 slt64(srem64(sext_i32_i64(local_tid_236694),\n                                              j_m_i_204223),\n                                       sext_i32_i64(local_tid_236694) -\n                                       sext_i32_i64(local_tid_236694 -\n                                       skip_threads_236709));\n                            \n                            if (thread_active_236710 && inactive_236711) {\n                                x_228181 = x_228182;\n                            }\n                            if (thread_active_236710) {\n                                if (!inactive_236711) {\n                                    double defunc_1_op_res_228183 = x_228181 +\n                                           x_228182;\n                                    \n                                    x_228181 = defunc_1_op_res_228183;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_236696, skip_threads_236709)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_236710) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_236698)[sext_i32_i64(local_tid_236694)] =\n                                    x_228181;\n                                x_228182 = x_228181;\n                            }\n                        }\n                        if (sle32(wave_sizze_236696, skip_threads_236709)) {\n                            barrier(CLK_LOCAL_",
                   "MEM_FENCE);\n                        }\n                        skip_threads_236709 *= 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_236694 - squot32(local_tid_236694, 32) *\n                         32) == 31 && ltid_in_bounds_236708) {\n                        ((volatile __local\n                          double *) red_arr_mem_236698)[sext_i32_i64(squot32(local_tid_236694,\n                                                                             32))] =\n                            x_228181;\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_236712;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_236694, 32) == 0 &&\n                            ltid_in_bounds_236708) {\n                            x_236706 = ((volatile __local\n                                         double *) red_arr_mem_236698)[sext_i32_i64(local_tid_236694)];\n                            if ((local_tid_236694 - squot32(local_tid_236694,\n                                                            32) * 32) == 0) {\n                                x_236705 = x_236706;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_236712 = 1;\n                        while (slt32(skip_threads_236712, 32)) {\n                            bool thread_active_236713 =\n                                 sle32(skip_threads_236712, local_tid_236694 -\n                                       squot32(local_tid_236694, 32) * 32) &&\n ",
                   "                                (squot32(local_tid_236694, 32) == 0 &&\n                                  ltid_in_bounds_236708);\n                            \n                            if (thread_active_236713) {\n                                // read operands\n                                {\n                                    x_236705 = ((volatile __local\n                                                 double *) red_arr_mem_236698)[sext_i32_i64(local_tid_236694) -\n                                                                               sext_i32_i64(skip_threads_236712)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_236714 =\n                                     slt64(srem64(sext_i32_i64(local_tid_236694 *\n                                                  32 + 32 - 1), j_m_i_204223),\n                                           sext_i32_i64(local_tid_236694 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_236694 -\n                                                         skip_threads_236712) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_236713 && inactive_236714) {\n                                    x_236705 = x_236706;\n                                }\n                                if (thread_active_236713) {\n                                    if (!inactive_236714) {\n                                        double defunc_1_op_res_236707 =\n                                               x_236705 + x_236706;\n                                        \n                                        x_236705 = defunc_1_op_res_236707;\n                                    }\n                                }\n                            }\n                       ",
                   "     if (sle32(wave_sizze_236696, skip_threads_236712)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_236713) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_236698)[sext_i32_i64(local_tid_236694)] =\n                                        x_236705;\n                                    x_236706 = x_236705;\n                                }\n                            }\n                            if (sle32(wave_sizze_236696, skip_threads_236712)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_236712 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_236715 = squot32(local_tid_236694, 32) == 0 ||\n                     !ltid_in_bounds_236708;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_236715) {\n                            x_228182 = x_228181;\n                            x_228181 = ((__local\n                                         double *) red_arr_mem_236698)[sext_i32_i64(squot32(local_tid_236694,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_236716 =\n                             slt64(srem64(sext_i32_i64(local_tid_236694),\n                                          j_m_i_204223),\n                ",
                   "                   sext_i32_i64(local_tid_236694) -\n                                   sext_i32_i64(squot32(local_tid_236694, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_236715) {\n                            if (inactive_236716) {\n                                x_228181 = x_228182;\n                            }\n                        }\n                        if (!no_carry_in_236715) {\n                            if (!inactive_236716) {\n                                double defunc_1_op_res_228183 = x_228181 +\n                                       x_228182;\n                                \n                                x_228181 = defunc_1_op_res_228183;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_236715) {\n                            ((__local\n                              double *) red_arr_mem_236698)[sext_i32_i64(local_tid_236694)] =\n                                x_228181;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_236694, 32) == 0 &&\n                        ltid_in_bounds_236708) {\n                        ((__local\n                          double *) red_arr_mem_236698)[sext_i32_i64(local_tid_236694)] =\n                            x_228182;\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_236702) *\n                      squot64(segred_group_sizze_228174,\n                              segment_sizze_nonzzero_236691) +\n                      sext_i32_i64(local_tid_236694), ",
                   "partition_sizze_203667) &&\n                slt64(sext_i32_i64(local_tid_236694),\n                      squot64(segred_group_sizze_228174,\n                              segment_sizze_nonzzero_236691))) {\n                double tmp_236717;\n                \n                tmp_236717 = ((__local\n                               double *) red_arr_mem_236698)[(sext_i32_i64(local_tid_236694) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_236691 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231941)[sext_i32_i64(virt_group_id_236702) *\n                                        squot64(segred_group_sizze_228174,\n                                                segment_sizze_nonzzero_236691) +\n                                        sext_i32_i64(local_tid_236694)] =\n                    tmp_236717;\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_228174\n}\n",
                   NULL};
static const char *tuning_param_names[] =
                  {"builtin#replicate_f64.group_size_232954",
                   "builtin#replicate_i64.group_size_232537",
                   "main.group_size_232555", "main.group_size_232714",
                   "main.group_size_234637", "main.group_size_234836",
                   "main.group_size_235086", "main.group_size_235464",
                   "main.group_size_235686", "main.group_size_235959",
                   "main.segmap_group_size_206961",
                   "main.segmap_group_size_207015",
                   "main.segmap_group_size_207172",
                   "main.segmap_group_size_207440",
                   "main.segmap_group_size_208295",
                   "main.segmap_group_size_208534",
                   "main.segmap_group_size_208565",
                   "main.segmap_group_size_209297",
                   "main.segmap_group_size_209501",
                   "main.segmap_group_size_209527",
                   "main.segmap_group_size_209923",
                   "main.segmap_group_size_210127",
                   "main.segmap_group_size_210153",
                   "main.segmap_group_size_210326",
                   "main.segmap_group_size_210389",
                   "main.segmap_group_size_210531",
                   "main.segmap_group_size_210726",
                   "main.segmap_group_size_211061",
                   "main.segmap_group_size_211236",
                   "main.segmap_group_size_211322",
                   "main.segmap_group_size_212223",
                   "main.segmap_group_size_212479",
                   "main.segmap_group_size_212912",
                   "main.segmap_group_size_213144",
                   "main.segmap_group_size_213247",
                   "main.segmap_group_size_214396",
                   "main.segmap_group_size_214716",
                   "main.segmap_group_size_215257",
                   "main.segmap_group_size_215544",
                   "main.segmap_group_size_215674",
                   "main.segmap_group_size_218205",
                   "main.segmap_group_size_218601",
                   "main.segmap_group_size_218672",
                   "main.segmap_group_size_218803",
                   "main.segmap_group_size_218934",
                   "main.segmap_group_size_219065",
                   "main.segmap_group_size_219206",
                   "main.segmap_group_size_219337",
                   "main.segmap_group_size_219698",
                   "main.segmap_group_size_219898",
                   "main.segmap_group_size_220080",
                   "main.segmap_group_size_220563",
                   "main.segmap_group_size_220827",
                   "main.segmap_group_size_221058",
                   "main.segmap_group_size_222316",
                   "main.segmap_group_size_222503",
                   "main.segmap_group_size_222544",
                   "main.segmap_group_size_222733",
                   "main.segmap_group_size_222871",
                   "main.segmap_group_size_223070",
                   "main.segmap_group_size_223126",
                   "main.segmap_group_size_223386",
                   "main.segmap_group_size_223634",
                   "main.segmap_group_size_223823",
                   "main.segmap_group_size_224076",
                   "main.segmap_group_size_224132",
                   "main.segmap_group_size_224460",
                   "main.segmap_group_size_224772",
                   "main.segmap_group_size_225010",
                   "main.segmap_group_size_225330",
                   "main.segmap_group_size_225386",
                   "main.segmap_group_size_225876",
                   "main.segmap_group_size_225932",
                   "main.segmap_group_size_226188",
                   "main.segmap_group_size_226244",
                   "main.segmap_group_size_226592",
                   "main.segmap_group_size_226648",
                   "main.segmap_group_size_226861",
                   "main.segmap_group_size_227117",
                   "main.segmap_group_size_227160",
                   "main.segmap_group_size_227248",
                   "main.segmap_group_size_227667",
                   "main.segmap_group_size_228110",
                   "main.segmap_group_size_228145",
                   "main.segmap_group_size_228214",
                   "main.segmap_group_size_228304",
                   "main.segmap_num_groups_206963",
                   "main.segmap_num_groups_210533",
                   "main.segmap_num_groups_210728",
                   "main.segmap_num_groups_212225",
                   "main.segmap_num_groups_212481",
                   "main.segmap_num_groups_214398",
                   "main.segmap_num_groups_214718",
                   "main.segmap_num_groups_219067",
                   "main.segmap_num_groups_219700",
                   "main.segmap_num_groups_220565",
                   "main.segmap_num_groups_222546",
                   "main.segmap_num_groups_223388",
                   "main.segmap_num_groups_224462",
                   "main.segmap_num_groups_227250",
                   "main.segmap_num_groups_228306",
                   "main.segred_group_size_211164",
                   "main.segred_group_size_211266",
                   "main.segred_group_size_213050",
                   "main.segred_group_size_213183",
                   "main.segred_group_size_215433",
                   "main.segred_group_size_215602",
                   "main.segred_group_size_218698",
                   "main.segred_group_size_218829",
                   "main.segred_group_size_218960",
                   "main.segred_group_size_219283",
                   "main.segred_group_size_219350",
                   "main.segred_group_size_220008",
                   "main.segred_group_size_220102",
                   "main.segred_group_size_220973",
                   "main.segred_group_size_221099",
                   "main.segred_group_size_222814",
                   "main.segred_group_size_222884",
                   "main.segred_group_size_223748",
                   "main.segred_group_size_223845",
                   "main.segred_group_size_224922",
                   "main.segred_group_size_225051",
                   "main.segred_group_size_228157",
                   "main.segred_num_groups_211166",
                   "main.segred_num_groups_211268",
                   "main.segred_num_groups_213052",
                   "main.segred_num_groups_213185",
                   "main.segred_num_groups_215435",
                   "main.segred_num_groups_215604",
                   "main.segred_num_groups_218700",
                   "main.segred_num_groups_218831",
                   "main.segred_num_groups_218962",
                   "main.segred_num_groups_219285",
                   "main.segred_num_groups_219352",
                   "main.segred_num_groups_220010",
                   "main.segred_num_groups_220104",
                   "main.segred_num_groups_220975",
                   "main.segred_num_groups_221101",
                   "main.segred_num_groups_222816",
                   "main.segred_num_groups_222886",
                   "main.segred_num_groups_223750",
                   "main.segred_num_groups_223847",
                   "main.segred_num_groups_224924",
                   "main.segred_num_groups_225053",
                   "main.segred_num_groups_228159",
                   "main.segscan_group_size_206951",
                   "main.segscan_group_size_207071",
                   "main.segscan_group_size_207509",
                   "main.segscan_group_size_218731",
                   "main.segscan_group_size_218862",
                   "main.segscan_group_size_218993",
                   "main.segscan_group_size_227715",
                   "main.segscan_num_groups_206953",
                   "main.segscan_num_groups_207073",
                   "main.segscan_num_groups_207511",
                   "main.segscan_num_groups_218733",
                   "main.segscan_num_groups_218864",
                   "main.segscan_num_groups_218995",
                   "main.segscan_num_groups_227717", "main.suff_intra_par_0",
                   "main.suff_intra_par_1", "main.suff_intra_par_13",
                   "main.suff_intra_par_17", "main.suff_intra_par_2",
                   "main.suff_intra_par_3", "main.suff_intra_par_34",
                   "main.suff_intra_par_36", "main.suff_intra_par_37",
                   "main.suff_intra_par_4", "main.suff_intra_par_5",
                   "main.suff_intra_par_6", "main.suff_intra_par_9",
                   "main.suff_outer_par_10", "main.suff_outer_par_11",
                   "main.suff_outer_par_12", "main.suff_outer_par_14",
                   "main.suff_outer_par_15", "main.suff_outer_par_16",
                   "main.suff_outer_par_18", "main.suff_outer_par_19",
                   "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_27",
                   "main.suff_outer_par_28", "main.suff_outer_par_29",
                   "main.suff_outer_par_30", "main.suff_outer_par_31",
                   "main.suff_outer_par_32", "main.suff_outer_par_33",
                   "main.suff_outer_par_35", "main.suff_outer_par_38",
                   "main.suff_outer_par_7", "main.suff_outer_par_8"};
static const char *tuning_param_vars[] =
                  {"builtinzhreplicate_f64zigroup_sizze_232954",
                   "builtinzhreplicate_i64zigroup_sizze_232537",
                   "mainzigroup_sizze_232555", "mainzigroup_sizze_232714",
                   "mainzigroup_sizze_234637", "mainzigroup_sizze_234836",
                   "mainzigroup_sizze_235086", "mainzigroup_sizze_235464",
                   "mainzigroup_sizze_235686", "mainzigroup_sizze_235959",
                   "mainzisegmap_group_sizze_206961",
                   "mainzisegmap_group_sizze_207015",
                   "mainzisegmap_group_sizze_207172",
                   "mainzisegmap_group_sizze_207440",
                   "mainzisegmap_group_sizze_208295",
                   "mainzisegmap_group_sizze_208534",
                   "mainzisegmap_group_sizze_208565",
                   "mainzisegmap_group_sizze_209297",
                   "mainzisegmap_group_sizze_209501",
                   "mainzisegmap_group_sizze_209527",
                   "mainzisegmap_group_sizze_209923",
                   "mainzisegmap_group_sizze_210127",
                   "mainzisegmap_group_sizze_210153",
                   "mainzisegmap_group_sizze_210326",
                   "mainzisegmap_group_sizze_210389",
                   "mainzisegmap_group_sizze_210531",
                   "mainzisegmap_group_sizze_210726",
                   "mainzisegmap_group_sizze_211061",
                   "mainzisegmap_group_sizze_211236",
                   "mainzisegmap_group_sizze_211322",
                   "mainzisegmap_group_sizze_212223",
                   "mainzisegmap_group_sizze_212479",
                   "mainzisegmap_group_sizze_212912",
                   "mainzisegmap_group_sizze_213144",
                   "mainzisegmap_group_sizze_213247",
                   "mainzisegmap_group_sizze_214396",
                   "mainzisegmap_group_sizze_214716",
                   "mainzisegmap_group_sizze_215257",
                   "mainzisegmap_group_sizze_215544",
                   "mainzisegmap_group_sizze_215674",
                   "mainzisegmap_group_sizze_218205",
                   "mainzisegmap_group_sizze_218601",
                   "mainzisegmap_group_sizze_218672",
                   "mainzisegmap_group_sizze_218803",
                   "mainzisegmap_group_sizze_218934",
                   "mainzisegmap_group_sizze_219065",
                   "mainzisegmap_group_sizze_219206",
                   "mainzisegmap_group_sizze_219337",
                   "mainzisegmap_group_sizze_219698",
                   "mainzisegmap_group_sizze_219898",
                   "mainzisegmap_group_sizze_220080",
                   "mainzisegmap_group_sizze_220563",
                   "mainzisegmap_group_sizze_220827",
                   "mainzisegmap_group_sizze_221058",
                   "mainzisegmap_group_sizze_222316",
                   "mainzisegmap_group_sizze_222503",
                   "mainzisegmap_group_sizze_222544",
                   "mainzisegmap_group_sizze_222733",
                   "mainzisegmap_group_sizze_222871",
                   "mainzisegmap_group_sizze_223070",
                   "mainzisegmap_group_sizze_223126",
                   "mainzisegmap_group_sizze_223386",
                   "mainzisegmap_group_sizze_223634",
                   "mainzisegmap_group_sizze_223823",
                   "mainzisegmap_group_sizze_224076",
                   "mainzisegmap_group_sizze_224132",
                   "mainzisegmap_group_sizze_224460",
                   "mainzisegmap_group_sizze_224772",
                   "mainzisegmap_group_sizze_225010",
                   "mainzisegmap_group_sizze_225330",
                   "mainzisegmap_group_sizze_225386",
                   "mainzisegmap_group_sizze_225876",
                   "mainzisegmap_group_sizze_225932",
                   "mainzisegmap_group_sizze_226188",
                   "mainzisegmap_group_sizze_226244",
                   "mainzisegmap_group_sizze_226592",
                   "mainzisegmap_group_sizze_226648",
                   "mainzisegmap_group_sizze_226861",
                   "mainzisegmap_group_sizze_227117",
                   "mainzisegmap_group_sizze_227160",
                   "mainzisegmap_group_sizze_227248",
                   "mainzisegmap_group_sizze_227667",
                   "mainzisegmap_group_sizze_228110",
                   "mainzisegmap_group_sizze_228145",
                   "mainzisegmap_group_sizze_228214",
                   "mainzisegmap_group_sizze_228304",
                   "mainzisegmap_num_groups_206963",
                   "mainzisegmap_num_groups_210533",
                   "mainzisegmap_num_groups_210728",
                   "mainzisegmap_num_groups_212225",
                   "mainzisegmap_num_groups_212481",
                   "mainzisegmap_num_groups_214398",
                   "mainzisegmap_num_groups_214718",
                   "mainzisegmap_num_groups_219067",
                   "mainzisegmap_num_groups_219700",
                   "mainzisegmap_num_groups_220565",
                   "mainzisegmap_num_groups_222546",
                   "mainzisegmap_num_groups_223388",
                   "mainzisegmap_num_groups_224462",
                   "mainzisegmap_num_groups_227250",
                   "mainzisegmap_num_groups_228306",
                   "mainzisegred_group_sizze_211164",
                   "mainzisegred_group_sizze_211266",
                   "mainzisegred_group_sizze_213050",
                   "mainzisegred_group_sizze_213183",
                   "mainzisegred_group_sizze_215433",
                   "mainzisegred_group_sizze_215602",
                   "mainzisegred_group_sizze_218698",
                   "mainzisegred_group_sizze_218829",
                   "mainzisegred_group_sizze_218960",
                   "mainzisegred_group_sizze_219283",
                   "mainzisegred_group_sizze_219350",
                   "mainzisegred_group_sizze_220008",
                   "mainzisegred_group_sizze_220102",
                   "mainzisegred_group_sizze_220973",
                   "mainzisegred_group_sizze_221099",
                   "mainzisegred_group_sizze_222814",
                   "mainzisegred_group_sizze_222884",
                   "mainzisegred_group_sizze_223748",
                   "mainzisegred_group_sizze_223845",
                   "mainzisegred_group_sizze_224922",
                   "mainzisegred_group_sizze_225051",
                   "mainzisegred_group_sizze_228157",
                   "mainzisegred_num_groups_211166",
                   "mainzisegred_num_groups_211268",
                   "mainzisegred_num_groups_213052",
                   "mainzisegred_num_groups_213185",
                   "mainzisegred_num_groups_215435",
                   "mainzisegred_num_groups_215604",
                   "mainzisegred_num_groups_218700",
                   "mainzisegred_num_groups_218831",
                   "mainzisegred_num_groups_218962",
                   "mainzisegred_num_groups_219285",
                   "mainzisegred_num_groups_219352",
                   "mainzisegred_num_groups_220010",
                   "mainzisegred_num_groups_220104",
                   "mainzisegred_num_groups_220975",
                   "mainzisegred_num_groups_221101",
                   "mainzisegred_num_groups_222816",
                   "mainzisegred_num_groups_222886",
                   "mainzisegred_num_groups_223750",
                   "mainzisegred_num_groups_223847",
                   "mainzisegred_num_groups_224924",
                   "mainzisegred_num_groups_225053",
                   "mainzisegred_num_groups_228159",
                   "mainzisegscan_group_sizze_206951",
                   "mainzisegscan_group_sizze_207071",
                   "mainzisegscan_group_sizze_207509",
                   "mainzisegscan_group_sizze_218731",
                   "mainzisegscan_group_sizze_218862",
                   "mainzisegscan_group_sizze_218993",
                   "mainzisegscan_group_sizze_227715",
                   "mainzisegscan_num_groups_206953",
                   "mainzisegscan_num_groups_207073",
                   "mainzisegscan_num_groups_207511",
                   "mainzisegscan_num_groups_218733",
                   "mainzisegscan_num_groups_218864",
                   "mainzisegscan_num_groups_218995",
                   "mainzisegscan_num_groups_227717", "mainzisuff_intra_par_0",
                   "mainzisuff_intra_par_1", "mainzisuff_intra_par_13",
                   "mainzisuff_intra_par_17", "mainzisuff_intra_par_2",
                   "mainzisuff_intra_par_3", "mainzisuff_intra_par_34",
                   "mainzisuff_intra_par_36", "mainzisuff_intra_par_37",
                   "mainzisuff_intra_par_4", "mainzisuff_intra_par_5",
                   "mainzisuff_intra_par_6", "mainzisuff_intra_par_9",
                   "mainzisuff_outer_par_10", "mainzisuff_outer_par_11",
                   "mainzisuff_outer_par_12", "mainzisuff_outer_par_14",
                   "mainzisuff_outer_par_15", "mainzisuff_outer_par_16",
                   "mainzisuff_outer_par_18", "mainzisuff_outer_par_19",
                   "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_27",
                   "mainzisuff_outer_par_28", "mainzisuff_outer_par_29",
                   "mainzisuff_outer_par_30", "mainzisuff_outer_par_31",
                   "mainzisuff_outer_par_32", "mainzisuff_outer_par_33",
                   "mainzisuff_outer_par_35", "mainzisuff_outer_par_38",
                   "mainzisuff_outer_par_7", "mainzisuff_outer_par_8"};
static const char *tuning_param_classes[] = {"group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "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",
                                             "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", "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", "num_groups",
                                             "num_groups", "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", "threshold(32,)",
                                             "threshold(32,)",
                                             "threshold(32, !main.suff_outer_par_12 !main.suff_outer_par_11)",
                                             "threshold(32, !main.suff_outer_par_16 !main.suff_outer_par_15)",
                                             "threshold(32, !main.suff_intra_par_1)",
                                             "threshold(32,)", "threshold(32,)",
                                             "threshold(32, !main.suff_outer_par_35)",
                                             "threshold(32, !main.suff_outer_par_35 !main.suff_intra_par_36)",
                                             "threshold(32, !main.suff_intra_par_3)",
                                             "threshold(32,)", "threshold(32,)",
                                             "threshold(32, !main.suff_outer_par_8 !main.suff_outer_par_7)",
                                             "threshold(def, !main.suff_outer_par_8 !main.suff_intra_par_9 !main.suff_outer_par_7)",
                                             "threshold(def,)",
                                             "threshold(def, !main.suff_outer_par_11)",
                                             "threshold(def, !main.suff_outer_par_12 !main.suff_intra_par_13 !main.suff_outer_par_11)",
                                             "threshold(def,)",
                                             "threshold(def, !main.suff_outer_par_15)",
                                             "threshold(def, !main.suff_outer_par_16 !main.suff_intra_par_17 !main.suff_outer_par_15)",
                                             "threshold(def,)",
                                             "threshold(def,)",
                                             "threshold(def,)",
                                             "threshold(def,)",
                                             "threshold(def, !main.suff_outer_par_22)",
                                             "threshold(def,)",
                                             "threshold(def, !main.suff_outer_par_24)",
                                             "threshold(def,)",
                                             "threshold(def, !main.suff_outer_par_26)",
                                             "threshold(def,)",
                                             "threshold(def, !main.suff_outer_par_28)",
                                             "threshold(def,)",
                                             "threshold(def, !main.suff_outer_par_30)",
                                             "threshold(def,)",
                                             "threshold(def, !main.suff_outer_par_32)",
                                             "threshold(def,)",
                                             "threshold(def,)",
                                             "threshold(def,)",
                                             "threshold(def, !main.suff_outer_par_7)"};
struct tuning_params {
    int64_t *builtinzhreplicate_f64zigroup_sizze_232954;
    int64_t *builtinzhreplicate_i64zigroup_sizze_232537;
    int64_t *mainzigroup_sizze_232555;
    int64_t *mainzigroup_sizze_232714;
    int64_t *mainzigroup_sizze_234637;
    int64_t *mainzigroup_sizze_234836;
    int64_t *mainzigroup_sizze_235086;
    int64_t *mainzigroup_sizze_235464;
    int64_t *mainzigroup_sizze_235686;
    int64_t *mainzigroup_sizze_235959;
    int64_t *mainzisegmap_group_sizze_206961;
    int64_t *mainzisegmap_group_sizze_207015;
    int64_t *mainzisegmap_group_sizze_207172;
    int64_t *mainzisegmap_group_sizze_207440;
    int64_t *mainzisegmap_group_sizze_208295;
    int64_t *mainzisegmap_group_sizze_208534;
    int64_t *mainzisegmap_group_sizze_208565;
    int64_t *mainzisegmap_group_sizze_209297;
    int64_t *mainzisegmap_group_sizze_209501;
    int64_t *mainzisegmap_group_sizze_209527;
    int64_t *mainzisegmap_group_sizze_209923;
    int64_t *mainzisegmap_group_sizze_210127;
    int64_t *mainzisegmap_group_sizze_210153;
    int64_t *mainzisegmap_group_sizze_210326;
    int64_t *mainzisegmap_group_sizze_210389;
    int64_t *mainzisegmap_group_sizze_210531;
    int64_t *mainzisegmap_group_sizze_210726;
    int64_t *mainzisegmap_group_sizze_211061;
    int64_t *mainzisegmap_group_sizze_211236;
    int64_t *mainzisegmap_group_sizze_211322;
    int64_t *mainzisegmap_group_sizze_212223;
    int64_t *mainzisegmap_group_sizze_212479;
    int64_t *mainzisegmap_group_sizze_212912;
    int64_t *mainzisegmap_group_sizze_213144;
    int64_t *mainzisegmap_group_sizze_213247;
    int64_t *mainzisegmap_group_sizze_214396;
    int64_t *mainzisegmap_group_sizze_214716;
    int64_t *mainzisegmap_group_sizze_215257;
    int64_t *mainzisegmap_group_sizze_215544;
    int64_t *mainzisegmap_group_sizze_215674;
    int64_t *mainzisegmap_group_sizze_218205;
    int64_t *mainzisegmap_group_sizze_218601;
    int64_t *mainzisegmap_group_sizze_218672;
    int64_t *mainzisegmap_group_sizze_218803;
    int64_t *mainzisegmap_group_sizze_218934;
    int64_t *mainzisegmap_group_sizze_219065;
    int64_t *mainzisegmap_group_sizze_219206;
    int64_t *mainzisegmap_group_sizze_219337;
    int64_t *mainzisegmap_group_sizze_219698;
    int64_t *mainzisegmap_group_sizze_219898;
    int64_t *mainzisegmap_group_sizze_220080;
    int64_t *mainzisegmap_group_sizze_220563;
    int64_t *mainzisegmap_group_sizze_220827;
    int64_t *mainzisegmap_group_sizze_221058;
    int64_t *mainzisegmap_group_sizze_222316;
    int64_t *mainzisegmap_group_sizze_222503;
    int64_t *mainzisegmap_group_sizze_222544;
    int64_t *mainzisegmap_group_sizze_222733;
    int64_t *mainzisegmap_group_sizze_222871;
    int64_t *mainzisegmap_group_sizze_223070;
    int64_t *mainzisegmap_group_sizze_223126;
    int64_t *mainzisegmap_group_sizze_223386;
    int64_t *mainzisegmap_group_sizze_223634;
    int64_t *mainzisegmap_group_sizze_223823;
    int64_t *mainzisegmap_group_sizze_224076;
    int64_t *mainzisegmap_group_sizze_224132;
    int64_t *mainzisegmap_group_sizze_224460;
    int64_t *mainzisegmap_group_sizze_224772;
    int64_t *mainzisegmap_group_sizze_225010;
    int64_t *mainzisegmap_group_sizze_225330;
    int64_t *mainzisegmap_group_sizze_225386;
    int64_t *mainzisegmap_group_sizze_225876;
    int64_t *mainzisegmap_group_sizze_225932;
    int64_t *mainzisegmap_group_sizze_226188;
    int64_t *mainzisegmap_group_sizze_226244;
    int64_t *mainzisegmap_group_sizze_226592;
    int64_t *mainzisegmap_group_sizze_226648;
    int64_t *mainzisegmap_group_sizze_226861;
    int64_t *mainzisegmap_group_sizze_227117;
    int64_t *mainzisegmap_group_sizze_227160;
    int64_t *mainzisegmap_group_sizze_227248;
    int64_t *mainzisegmap_group_sizze_227667;
    int64_t *mainzisegmap_group_sizze_228110;
    int64_t *mainzisegmap_group_sizze_228145;
    int64_t *mainzisegmap_group_sizze_228214;
    int64_t *mainzisegmap_group_sizze_228304;
    int64_t *mainzisegmap_num_groups_206963;
    int64_t *mainzisegmap_num_groups_210533;
    int64_t *mainzisegmap_num_groups_210728;
    int64_t *mainzisegmap_num_groups_212225;
    int64_t *mainzisegmap_num_groups_212481;
    int64_t *mainzisegmap_num_groups_214398;
    int64_t *mainzisegmap_num_groups_214718;
    int64_t *mainzisegmap_num_groups_219067;
    int64_t *mainzisegmap_num_groups_219700;
    int64_t *mainzisegmap_num_groups_220565;
    int64_t *mainzisegmap_num_groups_222546;
    int64_t *mainzisegmap_num_groups_223388;
    int64_t *mainzisegmap_num_groups_224462;
    int64_t *mainzisegmap_num_groups_227250;
    int64_t *mainzisegmap_num_groups_228306;
    int64_t *mainzisegred_group_sizze_211164;
    int64_t *mainzisegred_group_sizze_211266;
    int64_t *mainzisegred_group_sizze_213050;
    int64_t *mainzisegred_group_sizze_213183;
    int64_t *mainzisegred_group_sizze_215433;
    int64_t *mainzisegred_group_sizze_215602;
    int64_t *mainzisegred_group_sizze_218698;
    int64_t *mainzisegred_group_sizze_218829;
    int64_t *mainzisegred_group_sizze_218960;
    int64_t *mainzisegred_group_sizze_219283;
    int64_t *mainzisegred_group_sizze_219350;
    int64_t *mainzisegred_group_sizze_220008;
    int64_t *mainzisegred_group_sizze_220102;
    int64_t *mainzisegred_group_sizze_220973;
    int64_t *mainzisegred_group_sizze_221099;
    int64_t *mainzisegred_group_sizze_222814;
    int64_t *mainzisegred_group_sizze_222884;
    int64_t *mainzisegred_group_sizze_223748;
    int64_t *mainzisegred_group_sizze_223845;
    int64_t *mainzisegred_group_sizze_224922;
    int64_t *mainzisegred_group_sizze_225051;
    int64_t *mainzisegred_group_sizze_228157;
    int64_t *mainzisegred_num_groups_211166;
    int64_t *mainzisegred_num_groups_211268;
    int64_t *mainzisegred_num_groups_213052;
    int64_t *mainzisegred_num_groups_213185;
    int64_t *mainzisegred_num_groups_215435;
    int64_t *mainzisegred_num_groups_215604;
    int64_t *mainzisegred_num_groups_218700;
    int64_t *mainzisegred_num_groups_218831;
    int64_t *mainzisegred_num_groups_218962;
    int64_t *mainzisegred_num_groups_219285;
    int64_t *mainzisegred_num_groups_219352;
    int64_t *mainzisegred_num_groups_220010;
    int64_t *mainzisegred_num_groups_220104;
    int64_t *mainzisegred_num_groups_220975;
    int64_t *mainzisegred_num_groups_221101;
    int64_t *mainzisegred_num_groups_222816;
    int64_t *mainzisegred_num_groups_222886;
    int64_t *mainzisegred_num_groups_223750;
    int64_t *mainzisegred_num_groups_223847;
    int64_t *mainzisegred_num_groups_224924;
    int64_t *mainzisegred_num_groups_225053;
    int64_t *mainzisegred_num_groups_228159;
    int64_t *mainzisegscan_group_sizze_206951;
    int64_t *mainzisegscan_group_sizze_207071;
    int64_t *mainzisegscan_group_sizze_207509;
    int64_t *mainzisegscan_group_sizze_218731;
    int64_t *mainzisegscan_group_sizze_218862;
    int64_t *mainzisegscan_group_sizze_218993;
    int64_t *mainzisegscan_group_sizze_227715;
    int64_t *mainzisegscan_num_groups_206953;
    int64_t *mainzisegscan_num_groups_207073;
    int64_t *mainzisegscan_num_groups_207511;
    int64_t *mainzisegscan_num_groups_218733;
    int64_t *mainzisegscan_num_groups_218864;
    int64_t *mainzisegscan_num_groups_218995;
    int64_t *mainzisegscan_num_groups_227717;
    int64_t *mainzisuff_intra_par_0;
    int64_t *mainzisuff_intra_par_1;
    int64_t *mainzisuff_intra_par_13;
    int64_t *mainzisuff_intra_par_17;
    int64_t *mainzisuff_intra_par_2;
    int64_t *mainzisuff_intra_par_3;
    int64_t *mainzisuff_intra_par_34;
    int64_t *mainzisuff_intra_par_36;
    int64_t *mainzisuff_intra_par_37;
    int64_t *mainzisuff_intra_par_4;
    int64_t *mainzisuff_intra_par_5;
    int64_t *mainzisuff_intra_par_6;
    int64_t *mainzisuff_intra_par_9;
    int64_t *mainzisuff_outer_par_10;
    int64_t *mainzisuff_outer_par_11;
    int64_t *mainzisuff_outer_par_12;
    int64_t *mainzisuff_outer_par_14;
    int64_t *mainzisuff_outer_par_15;
    int64_t *mainzisuff_outer_par_16;
    int64_t *mainzisuff_outer_par_18;
    int64_t *mainzisuff_outer_par_19;
    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_27;
    int64_t *mainzisuff_outer_par_28;
    int64_t *mainzisuff_outer_par_29;
    int64_t *mainzisuff_outer_par_30;
    int64_t *mainzisuff_outer_par_31;
    int64_t *mainzisuff_outer_par_32;
    int64_t *mainzisuff_outer_par_33;
    int64_t *mainzisuff_outer_par_35;
    int64_t *mainzisuff_outer_par_38;
    int64_t *mainzisuff_outer_par_7;
    int64_t *mainzisuff_outer_par_8;
};
struct futhark_context_config {
    int in_use;
    struct opencl_config opencl;
    int64_t tuning_params[198];
    int num_build_opts;
    const char **build_opts;
};
struct futhark_context_config *futhark_context_config_new(void)
{
    struct futhark_context_config *cfg =
                                  (struct futhark_context_config *) malloc(sizeof(struct futhark_context_config));
    
    if (cfg == NULL)
        return NULL;
    cfg->in_use = 0;
    cfg->num_build_opts = 0;
    cfg->build_opts = (const char **) malloc(sizeof(const char *));
    cfg->build_opts[0] = NULL;
    cfg->tuning_params[0] = 0;
    cfg->tuning_params[1] = 0;
    cfg->tuning_params[2] = 0;
    cfg->tuning_params[3] = 0;
    cfg->tuning_params[4] = 0;
    cfg->tuning_params[5] = 0;
    cfg->tuning_params[6] = 0;
    cfg->tuning_params[7] = 0;
    cfg->tuning_params[8] = 0;
    cfg->tuning_params[9] = 0;
    cfg->tuning_params[10] = 0;
    cfg->tuning_params[11] = 0;
    cfg->tuning_params[12] = 0;
    cfg->tuning_params[13] = 0;
    cfg->tuning_params[14] = 0;
    cfg->tuning_params[15] = 0;
    cfg->tuning_params[16] = 0;
    cfg->tuning_params[17] = 0;
    cfg->tuning_params[18] = 0;
    cfg->tuning_params[19] = 0;
    cfg->tuning_params[20] = 0;
    cfg->tuning_params[21] = 0;
    cfg->tuning_params[22] = 0;
    cfg->tuning_params[23] = 0;
    cfg->tuning_params[24] = 0;
    cfg->tuning_params[25] = 0;
    cfg->tuning_params[26] = 0;
    cfg->tuning_params[27] = 0;
    cfg->tuning_params[28] = 0;
    cfg->tuning_params[29] = 0;
    cfg->tuning_params[30] = 0;
    cfg->tuning_params[31] = 0;
    cfg->tuning_params[32] = 0;
    cfg->tuning_params[33] = 0;
    cfg->tuning_params[34] = 0;
    cfg->tuning_params[35] = 0;
    cfg->tuning_params[36] = 0;
    cfg->tuning_params[37] = 0;
    cfg->tuning_params[38] = 0;
    cfg->tuning_params[39] = 0;
    cfg->tuning_params[40] = 0;
    cfg->tuning_params[41] = 0;
    cfg->tuning_params[42] = 0;
    cfg->tuning_params[43] = 0;
    cfg->tuning_params[44] = 0;
    cfg->tuning_params[45] = 0;
    cfg->tuning_params[46] = 0;
    cfg->tuning_params[47] = 0;
    cfg->tuning_params[48] = 0;
    cfg->tuning_params[49] = 0;
    cfg->tuning_params[50] = 0;
    cfg->tuning_params[51] = 0;
    cfg->tuning_params[52] = 0;
    cfg->tuning_params[53] = 0;
    cfg->tuning_params[54] = 0;
    cfg->tuning_params[55] = 0;
    cfg->tuning_params[56] = 0;
    cfg->tuning_params[57] = 0;
    cfg->tuning_params[58] = 0;
    cfg->tuning_params[59] = 0;
    cfg->tuning_params[60] = 0;
    cfg->tuning_params[61] = 0;
    cfg->tuning_params[62] = 0;
    cfg->tuning_params[63] = 0;
    cfg->tuning_params[64] = 0;
    cfg->tuning_params[65] = 0;
    cfg->tuning_params[66] = 0;
    cfg->tuning_params[67] = 0;
    cfg->tuning_params[68] = 0;
    cfg->tuning_params[69] = 0;
    cfg->tuning_params[70] = 0;
    cfg->tuning_params[71] = 0;
    cfg->tuning_params[72] = 0;
    cfg->tuning_params[73] = 0;
    cfg->tuning_params[74] = 0;
    cfg->tuning_params[75] = 0;
    cfg->tuning_params[76] = 0;
    cfg->tuning_params[77] = 0;
    cfg->tuning_params[78] = 0;
    cfg->tuning_params[79] = 0;
    cfg->tuning_params[80] = 0;
    cfg->tuning_params[81] = 0;
    cfg->tuning_params[82] = 0;
    cfg->tuning_params[83] = 0;
    cfg->tuning_params[84] = 0;
    cfg->tuning_params[85] = 0;
    cfg->tuning_params[86] = 0;
    cfg->tuning_params[87] = 0;
    cfg->tuning_params[88] = 0;
    cfg->tuning_params[89] = 0;
    cfg->tuning_params[90] = 0;
    cfg->tuning_params[91] = 0;
    cfg->tuning_params[92] = 0;
    cfg->tuning_params[93] = 0;
    cfg->tuning_params[94] = 0;
    cfg->tuning_params[95] = 0;
    cfg->tuning_params[96] = 0;
    cfg->tuning_params[97] = 0;
    cfg->tuning_params[98] = 0;
    cfg->tuning_params[99] = 0;
    cfg->tuning_params[100] = 0;
    cfg->tuning_params[101] = 0;
    cfg->tuning_params[102] = 0;
    cfg->tuning_params[103] = 0;
    cfg->tuning_params[104] = 0;
    cfg->tuning_params[105] = 0;
    cfg->tuning_params[106] = 0;
    cfg->tuning_params[107] = 0;
    cfg->tuning_params[108] = 0;
    cfg->tuning_params[109] = 0;
    cfg->tuning_params[110] = 0;
    cfg->tuning_params[111] = 0;
    cfg->tuning_params[112] = 0;
    cfg->tuning_params[113] = 0;
    cfg->tuning_params[114] = 0;
    cfg->tuning_params[115] = 0;
    cfg->tuning_params[116] = 0;
    cfg->tuning_params[117] = 0;
    cfg->tuning_params[118] = 0;
    cfg->tuning_params[119] = 0;
    cfg->tuning_params[120] = 0;
    cfg->tuning_params[121] = 0;
    cfg->tuning_params[122] = 0;
    cfg->tuning_params[123] = 0;
    cfg->tuning_params[124] = 0;
    cfg->tuning_params[125] = 0;
    cfg->tuning_params[126] = 0;
    cfg->tuning_params[127] = 0;
    cfg->tuning_params[128] = 0;
    cfg->tuning_params[129] = 0;
    cfg->tuning_params[130] = 0;
    cfg->tuning_params[131] = 0;
    cfg->tuning_params[132] = 0;
    cfg->tuning_params[133] = 0;
    cfg->tuning_params[134] = 0;
    cfg->tuning_params[135] = 0;
    cfg->tuning_params[136] = 0;
    cfg->tuning_params[137] = 0;
    cfg->tuning_params[138] = 0;
    cfg->tuning_params[139] = 0;
    cfg->tuning_params[140] = 0;
    cfg->tuning_params[141] = 0;
    cfg->tuning_params[142] = 0;
    cfg->tuning_params[143] = 0;
    cfg->tuning_params[144] = 0;
    cfg->tuning_params[145] = 0;
    cfg->tuning_params[146] = 0;
    cfg->tuning_params[147] = 0;
    cfg->tuning_params[148] = 0;
    cfg->tuning_params[149] = 0;
    cfg->tuning_params[150] = 0;
    cfg->tuning_params[151] = 0;
    cfg->tuning_params[152] = 0;
    cfg->tuning_params[153] = 0;
    cfg->tuning_params[154] = 0;
    cfg->tuning_params[155] = 0;
    cfg->tuning_params[156] = 0;
    cfg->tuning_params[157] = 0;
    cfg->tuning_params[158] = 0;
    cfg->tuning_params[159] = 32;
    cfg->tuning_params[160] = 32;
    cfg->tuning_params[161] = 32;
    cfg->tuning_params[162] = 32;
    cfg->tuning_params[163] = 32;
    cfg->tuning_params[164] = 32;
    cfg->tuning_params[165] = 32;
    cfg->tuning_params[166] = 32;
    cfg->tuning_params[167] = 32;
    cfg->tuning_params[168] = 32;
    cfg->tuning_params[169] = 32;
    cfg->tuning_params[170] = 32;
    cfg->tuning_params[171] = 32;
    cfg->tuning_params[172] = 0;
    cfg->tuning_params[173] = 0;
    cfg->tuning_params[174] = 0;
    cfg->tuning_params[175] = 0;
    cfg->tuning_params[176] = 0;
    cfg->tuning_params[177] = 0;
    cfg->tuning_params[178] = 0;
    cfg->tuning_params[179] = 0;
    cfg->tuning_params[180] = 0;
    cfg->tuning_params[181] = 0;
    cfg->tuning_params[182] = 0;
    cfg->tuning_params[183] = 0;
    cfg->tuning_params[184] = 0;
    cfg->tuning_params[185] = 0;
    cfg->tuning_params[186] = 0;
    cfg->tuning_params[187] = 0;
    cfg->tuning_params[188] = 0;
    cfg->tuning_params[189] = 0;
    cfg->tuning_params[190] = 0;
    cfg->tuning_params[191] = 0;
    cfg->tuning_params[192] = 0;
    cfg->tuning_params[193] = 0;
    cfg->tuning_params[194] = 0;
    cfg->tuning_params[195] = 0;
    cfg->tuning_params[196] = 0;
    cfg->tuning_params[197] = 0;
    opencl_config_init(&cfg->opencl, 198, tuning_param_names, tuning_param_vars,
                       cfg->tuning_params, tuning_param_classes);
    return cfg;
}
void futhark_context_config_free(struct futhark_context_config *cfg)
{
    assert(!cfg->in_use);
    free(cfg->build_opts);
    free(cfg);
}
void futhark_context_config_add_build_option(struct futhark_context_config *cfg,
                                             const char *opt)
{
    cfg->build_opts[cfg->num_build_opts] = opt;
    cfg->num_build_opts++;
    cfg->build_opts = (const char **) realloc(cfg->build_opts,
                                              (cfg->num_build_opts + 1) *
                                              sizeof(const char *));
    cfg->build_opts[cfg->num_build_opts] = NULL;
}
void futhark_context_config_set_debugging(struct futhark_context_config *cfg,
                                          int flag)
{
    cfg->opencl.profiling = cfg->opencl.logging = cfg->opencl.debugging = flag;
}
void futhark_context_config_set_profiling(struct futhark_context_config *cfg,
                                          int flag)
{
    cfg->opencl.profiling = flag;
}
void futhark_context_config_set_logging(struct futhark_context_config *cfg,
                                        int flag)
{
    cfg->opencl.logging = flag;
}
void futhark_context_config_set_device(struct futhark_context_config *cfg, const
                                       char *s)
{
    set_preferred_device(&cfg->opencl, s);
}
void futhark_context_config_set_platform(struct futhark_context_config *cfg,
                                         const char *s)
{
    set_preferred_platform(&cfg->opencl, s);
}
void futhark_context_config_select_device_interactively(struct futhark_context_config *cfg)
{
    select_device_interactively(&cfg->opencl);
}
void futhark_context_config_list_devices(struct futhark_context_config *cfg)
{
    (void) cfg;
    list_devices();
}
void futhark_context_config_dump_program_to(struct futhark_context_config *cfg,
                                            const char *path)
{
    cfg->opencl.dump_program_to = path;
}
void futhark_context_config_load_program_from(struct futhark_context_config *cfg,
                                              const char *path)
{
    cfg->opencl.load_program_from = path;
}
void futhark_context_config_dump_binary_to(struct futhark_context_config *cfg,
                                           const char *path)
{
    cfg->opencl.dump_binary_to = path;
}
void futhark_context_config_load_binary_from(struct futhark_context_config *cfg,
                                             const char *path)
{
    cfg->opencl.load_binary_from = path;
}
void futhark_context_config_set_default_group_size(struct futhark_context_config *cfg,
                                                   int size)
{
    cfg->opencl.default_group_size = size;
    cfg->opencl.default_group_size_changed = 1;
}
void futhark_context_config_set_default_num_groups(struct futhark_context_config *cfg,
                                                   int num)
{
    cfg->opencl.default_num_groups = num;
}
void futhark_context_config_set_default_tile_size(struct futhark_context_config *cfg,
                                                  int size)
{
    cfg->opencl.default_tile_size = size;
    cfg->opencl.default_tile_size_changed = 1;
}
void futhark_context_config_set_default_reg_tile_size(struct futhark_context_config *cfg,
                                                      int size)
{
    cfg->opencl.default_reg_tile_size = size;
}
void futhark_context_config_set_default_threshold(struct futhark_context_config *cfg,
                                                  int size)
{
    cfg->opencl.default_threshold = size;
}
int futhark_context_config_set_tuning_param(struct futhark_context_config *cfg,
                                            const char *param_name,
                                            size_t new_value)
{
    for (int i = 0; i < 198; i++) {
        if (strcmp(param_name, tuning_param_names[i]) == 0) {
            cfg->tuning_params[i] = new_value;
            return 0;
        }
    }
    if (strcmp(param_name, "default_group_size") == 0) {
        cfg->opencl.default_group_size = new_value;
        return 0;
    }
    if (strcmp(param_name, "default_num_groups") == 0) {
        cfg->opencl.default_num_groups = new_value;
        return 0;
    }
    if (strcmp(param_name, "default_threshold") == 0) {
        cfg->opencl.default_threshold = new_value;
        return 0;
    }
    if (strcmp(param_name, "default_tile_size") == 0) {
        cfg->opencl.default_tile_size = new_value;
        return 0;
    }
    if (strcmp(param_name, "default_reg_tile_size") == 0) {
        cfg->opencl.default_reg_tile_size = new_value;
        return 0;
    }
    return 1;
}
struct futhark_context {
    struct futhark_context_config *cfg;
    int detail_memory;
    int debugging;
    int profiling;
    int profiling_paused;
    int logging;
    lock_t lock;
    char *error;
    FILE *log;
    int64_t peak_mem_usage_device;
    int64_t cur_mem_usage_device;
    int64_t peak_mem_usage_default;
    int64_t cur_mem_usage_default;
    struct {
        int dummy;
    } constants;
    struct memblock_device mainzicounter_mem_233168;
    struct memblock_device mainzicounter_mem_233256;
    struct memblock_device mainzicounter_mem_233517;
    struct memblock_device mainzicounter_mem_233625;
    struct memblock_device mainzicounter_mem_233930;
    struct memblock_device mainzicounter_mem_234050;
    struct memblock_device mainzicounter_mem_234245;
    struct memblock_device mainzicounter_mem_234388;
    struct memblock_device mainzicounter_mem_234531;
    struct memblock_device mainzicounter_mem_234710;
    struct memblock_device mainzicounter_mem_234792;
    struct memblock_device mainzicounter_mem_234934;
    struct memblock_device mainzicounter_mem_235036;
    struct memblock_device mainzicounter_mem_235204;
    struct memblock_device mainzicounter_mem_235318;
    struct memblock_device mainzicounter_mem_235560;
    struct memblock_device mainzicounter_mem_235642;
    struct memblock_device mainzicounter_mem_235807;
    struct memblock_device mainzicounter_mem_235909;
    struct memblock_device mainzicounter_mem_236100;
    struct memblock_device mainzicounter_mem_236214;
    struct memblock_device mainzicounter_mem_236725;
    int total_runs;
    long total_runtime;
    cl_kernel builtinzhreplicate_f64zireplicate_232951;
    cl_kernel builtinzhreplicate_i64zireplicate_232534;
    cl_kernel gpu_map_transpose_f64;
    cl_kernel gpu_map_transpose_f64_low_height;
    cl_kernel gpu_map_transpose_f64_low_width;
    cl_kernel gpu_map_transpose_f64_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_232552;
    cl_kernel mainzicopy_232711;
    cl_kernel mainzicopy_234634;
    cl_kernel mainzicopy_234833;
    cl_kernel mainzicopy_235083;
    cl_kernel mainzicopy_235461;
    cl_kernel mainzicopy_235683;
    cl_kernel mainzicopy_235956;
    cl_kernel mainziscan_stage1_206957;
    cl_kernel mainziscan_stage1_207097;
    cl_kernel mainziscan_stage1_207649;
    cl_kernel mainziscan_stage1_218773;
    cl_kernel mainziscan_stage1_218904;
    cl_kernel mainziscan_stage1_219035;
    cl_kernel mainziscan_stage1_228005;
    cl_kernel mainziscan_stage2_206957;
    cl_kernel mainziscan_stage2_207097;
    cl_kernel mainziscan_stage2_207649;
    cl_kernel mainziscan_stage2_218773;
    cl_kernel mainziscan_stage2_218904;
    cl_kernel mainziscan_stage2_219035;
    cl_kernel mainziscan_stage2_228005;
    cl_kernel mainziscan_stage3_206957;
    cl_kernel mainziscan_stage3_207097;
    cl_kernel mainziscan_stage3_207649;
    cl_kernel mainziscan_stage3_218773;
    cl_kernel mainziscan_stage3_218904;
    cl_kernel mainziscan_stage3_219035;
    cl_kernel mainziscan_stage3_228005;
    cl_kernel mainzisegmap_206959;
    cl_kernel mainzisegmap_207135;
    cl_kernel mainzisegmap_207260;
    cl_kernel mainzisegmap_207695;
    cl_kernel mainzisegmap_208908;
    cl_kernel mainzisegmap_208922;
    cl_kernel mainzisegmap_208946;
    cl_kernel mainzisegmap_209556;
    cl_kernel mainzisegmap_209568;
    cl_kernel mainzisegmap_209589;
    cl_kernel mainzisegmap_210182;
    cl_kernel mainzisegmap_210194;
    cl_kernel mainzisegmap_210215;
    cl_kernel mainzisegmap_210357;
    cl_kernel mainzisegmap_210502;
    cl_kernel mainzisegmap_210632;
    cl_kernel mainzisegmap_211772;
    cl_kernel mainzisegmap_211980;
    cl_kernel mainzisegmap_212069;
    cl_kernel mainzisegmap_212141;
    cl_kernel mainzisegmap_212355;
    cl_kernel mainzisegmap_213809;
    cl_kernel mainzisegmap_214084;
    cl_kernel mainzisegmap_214201;
    cl_kernel mainzisegmap_214285;
    cl_kernel mainzisegmap_214560;
    cl_kernel mainzisegmap_216352;
    cl_kernel mainzisegmap_216697;
    cl_kernel mainzisegmap_216846;
    cl_kernel mainzisegmap_216942;
    cl_kernel mainzisegmap_218503;
    cl_kernel mainzisegmap_218652;
    cl_kernel mainzisegmap_218688;
    cl_kernel mainzisegmap_218819;
    cl_kernel mainzisegmap_218950;
    cl_kernel mainzisegmap_219139;
    cl_kernel mainzisegmap_219524;
    cl_kernel mainzisegmap_219641;
    cl_kernel mainzisegmap_219802;
    cl_kernel mainzisegmap_220323;
    cl_kernel mainzisegmap_220480;
    cl_kernel mainzisegmap_220699;
    cl_kernel mainzisegmap_221368;
    cl_kernel mainzisegmap_221569;
    cl_kernel mainzisegmap_222439;
    cl_kernel mainzisegmap_222534;
    cl_kernel mainzisegmap_222641;
    cl_kernel mainzisegmap_223157;
    cl_kernel mainzisegmap_223174;
    cl_kernel mainzisegmap_223202;
    cl_kernel mainzisegmap_223326;
    cl_kernel mainzisegmap_223513;
    cl_kernel mainzisegmap_224163;
    cl_kernel mainzisegmap_224180;
    cl_kernel mainzisegmap_224210;
    cl_kernel mainzisegmap_224374;
    cl_kernel mainzisegmap_224619;
    cl_kernel mainzisegmap_225417;
    cl_kernel mainzisegmap_225434;
    cl_kernel mainzisegmap_225464;
    cl_kernel mainzisegmap_225672;
    cl_kernel mainzisegmap_225963;
    cl_kernel mainzisegmap_225980;
    cl_kernel mainzisegmap_226275;
    cl_kernel mainzisegmap_226292;
    cl_kernel mainzisegmap_226679;
    cl_kernel mainzisegmap_226696;
    cl_kernel mainzisegmap_226984;
    cl_kernel mainzisegmap_227201;
    cl_kernel mainzisegmap_227222;
    cl_kernel mainzisegmap_227351;
    cl_kernel mainzisegmap_228076;
    cl_kernel mainzisegmap_228131;
    cl_kernel mainzisegmap_228193;
    cl_kernel mainzisegmap_228279;
    cl_kernel mainzisegmap_228302;
    cl_kernel mainzisegmap_intragroup_206983;
    cl_kernel mainzisegmap_intragroup_207338;
    cl_kernel mainzisegmap_intragroup_207614;
    cl_kernel mainzisegmap_intragroup_207867;
    cl_kernel mainzisegmap_intragroup_208771;
    cl_kernel mainzisegmap_intragroup_209172;
    cl_kernel mainzisegmap_intragroup_209798;
    cl_kernel mainzisegmap_intragroup_211858;
    cl_kernel mainzisegmap_intragroup_213926;
    cl_kernel mainzisegmap_intragroup_216501;
    cl_kernel mainzisegmap_intragroup_217273;
    cl_kernel mainzisegmap_intragroup_217594;
    cl_kernel mainzisegmap_intragroup_218045;
    cl_kernel mainzisegmap_intragroup_221759;
    cl_kernel mainzisegmap_intragroup_221926;
    cl_kernel mainzisegmap_intragroup_222183;
    cl_kernel mainzisegmap_intragroup_226007;
    cl_kernel mainzisegmap_intragroup_226320;
    cl_kernel mainzisegmap_intragroup_226724;
    cl_kernel mainzisegmap_intragroup_227074;
    cl_kernel mainzisegmap_intragroup_227449;
    cl_kernel mainzisegmap_intragroup_227905;
    cl_kernel mainzisegred_large_212093;
    cl_kernel mainzisegred_large_212167;
    cl_kernel mainzisegred_large_214227;
    cl_kernel mainzisegred_large_214321;
    cl_kernel mainzisegred_large_216874;
    cl_kernel mainzisegred_large_216997;
    cl_kernel mainzisegred_large_218721;
    cl_kernel mainzisegred_large_218852;
    cl_kernel mainzisegred_large_218983;
    cl_kernel mainzisegred_large_219605;
    cl_kernel mainzisegred_large_219654;
    cl_kernel mainzisegred_large_220434;
    cl_kernel mainzisegred_large_220503;
    cl_kernel mainzisegred_large_221513;
    cl_kernel mainzisegred_large_221611;
    cl_kernel mainzisegred_large_223287;
    cl_kernel mainzisegred_large_223339;
    cl_kernel mainzisegred_large_224325;
    cl_kernel mainzisegred_large_224397;
    cl_kernel mainzisegred_large_225613;
    cl_kernel mainzisegred_large_225714;
    cl_kernel mainzisegred_large_228180;
    cl_kernel mainzisegred_small_212093;
    cl_kernel mainzisegred_small_212167;
    cl_kernel mainzisegred_small_214227;
    cl_kernel mainzisegred_small_214321;
    cl_kernel mainzisegred_small_216874;
    cl_kernel mainzisegred_small_216997;
    cl_kernel mainzisegred_small_218721;
    cl_kernel mainzisegred_small_218852;
    cl_kernel mainzisegred_small_218983;
    cl_kernel mainzisegred_small_219605;
    cl_kernel mainzisegred_small_219654;
    cl_kernel mainzisegred_small_220434;
    cl_kernel mainzisegred_small_220503;
    cl_kernel mainzisegred_small_221513;
    cl_kernel mainzisegred_small_221611;
    cl_kernel mainzisegred_small_223287;
    cl_kernel mainzisegred_small_223339;
    cl_kernel mainzisegred_small_224325;
    cl_kernel mainzisegred_small_224397;
    cl_kernel mainzisegred_small_225613;
    cl_kernel mainzisegred_small_225714;
    cl_kernel mainzisegred_small_228180;
    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_f64zireplicate_232951_total_runtime;
    int builtinzhreplicate_f64zireplicate_232951_runs;
    int64_t builtinzhreplicate_i64zireplicate_232534_total_runtime;
    int builtinzhreplicate_i64zireplicate_232534_runs;
    int64_t gpu_map_transpose_f64_total_runtime;
    int gpu_map_transpose_f64_runs;
    int64_t gpu_map_transpose_f64_low_height_total_runtime;
    int gpu_map_transpose_f64_low_height_runs;
    int64_t gpu_map_transpose_f64_low_width_total_runtime;
    int gpu_map_transpose_f64_low_width_runs;
    int64_t gpu_map_transpose_f64_small_total_runtime;
    int gpu_map_transpose_f64_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_232552_total_runtime;
    int mainzicopy_232552_runs;
    int64_t mainzicopy_232711_total_runtime;
    int mainzicopy_232711_runs;
    int64_t mainzicopy_234634_total_runtime;
    int mainzicopy_234634_runs;
    int64_t mainzicopy_234833_total_runtime;
    int mainzicopy_234833_runs;
    int64_t mainzicopy_235083_total_runtime;
    int mainzicopy_235083_runs;
    int64_t mainzicopy_235461_total_runtime;
    int mainzicopy_235461_runs;
    int64_t mainzicopy_235683_total_runtime;
    int mainzicopy_235683_runs;
    int64_t mainzicopy_235956_total_runtime;
    int mainzicopy_235956_runs;
    int64_t mainziscan_stage1_206957_total_runtime;
    int mainziscan_stage1_206957_runs;
    int64_t mainziscan_stage1_207097_total_runtime;
    int mainziscan_stage1_207097_runs;
    int64_t mainziscan_stage1_207649_total_runtime;
    int mainziscan_stage1_207649_runs;
    int64_t mainziscan_stage1_218773_total_runtime;
    int mainziscan_stage1_218773_runs;
    int64_t mainziscan_stage1_218904_total_runtime;
    int mainziscan_stage1_218904_runs;
    int64_t mainziscan_stage1_219035_total_runtime;
    int mainziscan_stage1_219035_runs;
    int64_t mainziscan_stage1_228005_total_runtime;
    int mainziscan_stage1_228005_runs;
    int64_t mainziscan_stage2_206957_total_runtime;
    int mainziscan_stage2_206957_runs;
    int64_t mainziscan_stage2_207097_total_runtime;
    int mainziscan_stage2_207097_runs;
    int64_t mainziscan_stage2_207649_total_runtime;
    int mainziscan_stage2_207649_runs;
    int64_t mainziscan_stage2_218773_total_runtime;
    int mainziscan_stage2_218773_runs;
    int64_t mainziscan_stage2_218904_total_runtime;
    int mainziscan_stage2_218904_runs;
    int64_t mainziscan_stage2_219035_total_runtime;
    int mainziscan_stage2_219035_runs;
    int64_t mainziscan_stage2_228005_total_runtime;
    int mainziscan_stage2_228005_runs;
    int64_t mainziscan_stage3_206957_total_runtime;
    int mainziscan_stage3_206957_runs;
    int64_t mainziscan_stage3_207097_total_runtime;
    int mainziscan_stage3_207097_runs;
    int64_t mainziscan_stage3_207649_total_runtime;
    int mainziscan_stage3_207649_runs;
    int64_t mainziscan_stage3_218773_total_runtime;
    int mainziscan_stage3_218773_runs;
    int64_t mainziscan_stage3_218904_total_runtime;
    int mainziscan_stage3_218904_runs;
    int64_t mainziscan_stage3_219035_total_runtime;
    int mainziscan_stage3_219035_runs;
    int64_t mainziscan_stage3_228005_total_runtime;
    int mainziscan_stage3_228005_runs;
    int64_t mainzisegmap_206959_total_runtime;
    int mainzisegmap_206959_runs;
    int64_t mainzisegmap_207135_total_runtime;
    int mainzisegmap_207135_runs;
    int64_t mainzisegmap_207260_total_runtime;
    int mainzisegmap_207260_runs;
    int64_t mainzisegmap_207695_total_runtime;
    int mainzisegmap_207695_runs;
    int64_t mainzisegmap_208908_total_runtime;
    int mainzisegmap_208908_runs;
    int64_t mainzisegmap_208922_total_runtime;
    int mainzisegmap_208922_runs;
    int64_t mainzisegmap_208946_total_runtime;
    int mainzisegmap_208946_runs;
    int64_t mainzisegmap_209556_total_runtime;
    int mainzisegmap_209556_runs;
    int64_t mainzisegmap_209568_total_runtime;
    int mainzisegmap_209568_runs;
    int64_t mainzisegmap_209589_total_runtime;
    int mainzisegmap_209589_runs;
    int64_t mainzisegmap_210182_total_runtime;
    int mainzisegmap_210182_runs;
    int64_t mainzisegmap_210194_total_runtime;
    int mainzisegmap_210194_runs;
    int64_t mainzisegmap_210215_total_runtime;
    int mainzisegmap_210215_runs;
    int64_t mainzisegmap_210357_total_runtime;
    int mainzisegmap_210357_runs;
    int64_t mainzisegmap_210502_total_runtime;
    int mainzisegmap_210502_runs;
    int64_t mainzisegmap_210632_total_runtime;
    int mainzisegmap_210632_runs;
    int64_t mainzisegmap_211772_total_runtime;
    int mainzisegmap_211772_runs;
    int64_t mainzisegmap_211980_total_runtime;
    int mainzisegmap_211980_runs;
    int64_t mainzisegmap_212069_total_runtime;
    int mainzisegmap_212069_runs;
    int64_t mainzisegmap_212141_total_runtime;
    int mainzisegmap_212141_runs;
    int64_t mainzisegmap_212355_total_runtime;
    int mainzisegmap_212355_runs;
    int64_t mainzisegmap_213809_total_runtime;
    int mainzisegmap_213809_runs;
    int64_t mainzisegmap_214084_total_runtime;
    int mainzisegmap_214084_runs;
    int64_t mainzisegmap_214201_total_runtime;
    int mainzisegmap_214201_runs;
    int64_t mainzisegmap_214285_total_runtime;
    int mainzisegmap_214285_runs;
    int64_t mainzisegmap_214560_total_runtime;
    int mainzisegmap_214560_runs;
    int64_t mainzisegmap_216352_total_runtime;
    int mainzisegmap_216352_runs;
    int64_t mainzisegmap_216697_total_runtime;
    int mainzisegmap_216697_runs;
    int64_t mainzisegmap_216846_total_runtime;
    int mainzisegmap_216846_runs;
    int64_t mainzisegmap_216942_total_runtime;
    int mainzisegmap_216942_runs;
    int64_t mainzisegmap_218503_total_runtime;
    int mainzisegmap_218503_runs;
    int64_t mainzisegmap_218652_total_runtime;
    int mainzisegmap_218652_runs;
    int64_t mainzisegmap_218688_total_runtime;
    int mainzisegmap_218688_runs;
    int64_t mainzisegmap_218819_total_runtime;
    int mainzisegmap_218819_runs;
    int64_t mainzisegmap_218950_total_runtime;
    int mainzisegmap_218950_runs;
    int64_t mainzisegmap_219139_total_runtime;
    int mainzisegmap_219139_runs;
    int64_t mainzisegmap_219524_total_runtime;
    int mainzisegmap_219524_runs;
    int64_t mainzisegmap_219641_total_runtime;
    int mainzisegmap_219641_runs;
    int64_t mainzisegmap_219802_total_runtime;
    int mainzisegmap_219802_runs;
    int64_t mainzisegmap_220323_total_runtime;
    int mainzisegmap_220323_runs;
    int64_t mainzisegmap_220480_total_runtime;
    int mainzisegmap_220480_runs;
    int64_t mainzisegmap_220699_total_runtime;
    int mainzisegmap_220699_runs;
    int64_t mainzisegmap_221368_total_runtime;
    int mainzisegmap_221368_runs;
    int64_t mainzisegmap_221569_total_runtime;
    int mainzisegmap_221569_runs;
    int64_t mainzisegmap_222439_total_runtime;
    int mainzisegmap_222439_runs;
    int64_t mainzisegmap_222534_total_runtime;
    int mainzisegmap_222534_runs;
    int64_t mainzisegmap_222641_total_runtime;
    int mainzisegmap_222641_runs;
    int64_t mainzisegmap_223157_total_runtime;
    int mainzisegmap_223157_runs;
    int64_t mainzisegmap_223174_total_runtime;
    int mainzisegmap_223174_runs;
    int64_t mainzisegmap_223202_total_runtime;
    int mainzisegmap_223202_runs;
    int64_t mainzisegmap_223326_total_runtime;
    int mainzisegmap_223326_runs;
    int64_t mainzisegmap_223513_total_runtime;
    int mainzisegmap_223513_runs;
    int64_t mainzisegmap_224163_total_runtime;
    int mainzisegmap_224163_runs;
    int64_t mainzisegmap_224180_total_runtime;
    int mainzisegmap_224180_runs;
    int64_t mainzisegmap_224210_total_runtime;
    int mainzisegmap_224210_runs;
    int64_t mainzisegmap_224374_total_runtime;
    int mainzisegmap_224374_runs;
    int64_t mainzisegmap_224619_total_runtime;
    int mainzisegmap_224619_runs;
    int64_t mainzisegmap_225417_total_runtime;
    int mainzisegmap_225417_runs;
    int64_t mainzisegmap_225434_total_runtime;
    int mainzisegmap_225434_runs;
    int64_t mainzisegmap_225464_total_runtime;
    int mainzisegmap_225464_runs;
    int64_t mainzisegmap_225672_total_runtime;
    int mainzisegmap_225672_runs;
    int64_t mainzisegmap_225963_total_runtime;
    int mainzisegmap_225963_runs;
    int64_t mainzisegmap_225980_total_runtime;
    int mainzisegmap_225980_runs;
    int64_t mainzisegmap_226275_total_runtime;
    int mainzisegmap_226275_runs;
    int64_t mainzisegmap_226292_total_runtime;
    int mainzisegmap_226292_runs;
    int64_t mainzisegmap_226679_total_runtime;
    int mainzisegmap_226679_runs;
    int64_t mainzisegmap_226696_total_runtime;
    int mainzisegmap_226696_runs;
    int64_t mainzisegmap_226984_total_runtime;
    int mainzisegmap_226984_runs;
    int64_t mainzisegmap_227201_total_runtime;
    int mainzisegmap_227201_runs;
    int64_t mainzisegmap_227222_total_runtime;
    int mainzisegmap_227222_runs;
    int64_t mainzisegmap_227351_total_runtime;
    int mainzisegmap_227351_runs;
    int64_t mainzisegmap_228076_total_runtime;
    int mainzisegmap_228076_runs;
    int64_t mainzisegmap_228131_total_runtime;
    int mainzisegmap_228131_runs;
    int64_t mainzisegmap_228193_total_runtime;
    int mainzisegmap_228193_runs;
    int64_t mainzisegmap_228279_total_runtime;
    int mainzisegmap_228279_runs;
    int64_t mainzisegmap_228302_total_runtime;
    int mainzisegmap_228302_runs;
    int64_t mainzisegmap_intragroup_206983_total_runtime;
    int mainzisegmap_intragroup_206983_runs;
    int64_t mainzisegmap_intragroup_207338_total_runtime;
    int mainzisegmap_intragroup_207338_runs;
    int64_t mainzisegmap_intragroup_207614_total_runtime;
    int mainzisegmap_intragroup_207614_runs;
    int64_t mainzisegmap_intragroup_207867_total_runtime;
    int mainzisegmap_intragroup_207867_runs;
    int64_t mainzisegmap_intragroup_208771_total_runtime;
    int mainzisegmap_intragroup_208771_runs;
    int64_t mainzisegmap_intragroup_209172_total_runtime;
    int mainzisegmap_intragroup_209172_runs;
    int64_t mainzisegmap_intragroup_209798_total_runtime;
    int mainzisegmap_intragroup_209798_runs;
    int64_t mainzisegmap_intragroup_211858_total_runtime;
    int mainzisegmap_intragroup_211858_runs;
    int64_t mainzisegmap_intragroup_213926_total_runtime;
    int mainzisegmap_intragroup_213926_runs;
    int64_t mainzisegmap_intragroup_216501_total_runtime;
    int mainzisegmap_intragroup_216501_runs;
    int64_t mainzisegmap_intragroup_217273_total_runtime;
    int mainzisegmap_intragroup_217273_runs;
    int64_t mainzisegmap_intragroup_217594_total_runtime;
    int mainzisegmap_intragroup_217594_runs;
    int64_t mainzisegmap_intragroup_218045_total_runtime;
    int mainzisegmap_intragroup_218045_runs;
    int64_t mainzisegmap_intragroup_221759_total_runtime;
    int mainzisegmap_intragroup_221759_runs;
    int64_t mainzisegmap_intragroup_221926_total_runtime;
    int mainzisegmap_intragroup_221926_runs;
    int64_t mainzisegmap_intragroup_222183_total_runtime;
    int mainzisegmap_intragroup_222183_runs;
    int64_t mainzisegmap_intragroup_226007_total_runtime;
    int mainzisegmap_intragroup_226007_runs;
    int64_t mainzisegmap_intragroup_226320_total_runtime;
    int mainzisegmap_intragroup_226320_runs;
    int64_t mainzisegmap_intragroup_226724_total_runtime;
    int mainzisegmap_intragroup_226724_runs;
    int64_t mainzisegmap_intragroup_227074_total_runtime;
    int mainzisegmap_intragroup_227074_runs;
    int64_t mainzisegmap_intragroup_227449_total_runtime;
    int mainzisegmap_intragroup_227449_runs;
    int64_t mainzisegmap_intragroup_227905_total_runtime;
    int mainzisegmap_intragroup_227905_runs;
    int64_t mainzisegred_large_212093_total_runtime;
    int mainzisegred_large_212093_runs;
    int64_t mainzisegred_large_212167_total_runtime;
    int mainzisegred_large_212167_runs;
    int64_t mainzisegred_large_214227_total_runtime;
    int mainzisegred_large_214227_runs;
    int64_t mainzisegred_large_214321_total_runtime;
    int mainzisegred_large_214321_runs;
    int64_t mainzisegred_large_216874_total_runtime;
    int mainzisegred_large_216874_runs;
    int64_t mainzisegred_large_216997_total_runtime;
    int mainzisegred_large_216997_runs;
    int64_t mainzisegred_large_218721_total_runtime;
    int mainzisegred_large_218721_runs;
    int64_t mainzisegred_large_218852_total_runtime;
    int mainzisegred_large_218852_runs;
    int64_t mainzisegred_large_218983_total_runtime;
    int mainzisegred_large_218983_runs;
    int64_t mainzisegred_large_219605_total_runtime;
    int mainzisegred_large_219605_runs;
    int64_t mainzisegred_large_219654_total_runtime;
    int mainzisegred_large_219654_runs;
    int64_t mainzisegred_large_220434_total_runtime;
    int mainzisegred_large_220434_runs;
    int64_t mainzisegred_large_220503_total_runtime;
    int mainzisegred_large_220503_runs;
    int64_t mainzisegred_large_221513_total_runtime;
    int mainzisegred_large_221513_runs;
    int64_t mainzisegred_large_221611_total_runtime;
    int mainzisegred_large_221611_runs;
    int64_t mainzisegred_large_223287_total_runtime;
    int mainzisegred_large_223287_runs;
    int64_t mainzisegred_large_223339_total_runtime;
    int mainzisegred_large_223339_runs;
    int64_t mainzisegred_large_224325_total_runtime;
    int mainzisegred_large_224325_runs;
    int64_t mainzisegred_large_224397_total_runtime;
    int mainzisegred_large_224397_runs;
    int64_t mainzisegred_large_225613_total_runtime;
    int mainzisegred_large_225613_runs;
    int64_t mainzisegred_large_225714_total_runtime;
    int mainzisegred_large_225714_runs;
    int64_t mainzisegred_large_228180_total_runtime;
    int mainzisegred_large_228180_runs;
    int64_t mainzisegred_small_212093_total_runtime;
    int mainzisegred_small_212093_runs;
    int64_t mainzisegred_small_212167_total_runtime;
    int mainzisegred_small_212167_runs;
    int64_t mainzisegred_small_214227_total_runtime;
    int mainzisegred_small_214227_runs;
    int64_t mainzisegred_small_214321_total_runtime;
    int mainzisegred_small_214321_runs;
    int64_t mainzisegred_small_216874_total_runtime;
    int mainzisegred_small_216874_runs;
    int64_t mainzisegred_small_216997_total_runtime;
    int mainzisegred_small_216997_runs;
    int64_t mainzisegred_small_218721_total_runtime;
    int mainzisegred_small_218721_runs;
    int64_t mainzisegred_small_218852_total_runtime;
    int mainzisegred_small_218852_runs;
    int64_t mainzisegred_small_218983_total_runtime;
    int mainzisegred_small_218983_runs;
    int64_t mainzisegred_small_219605_total_runtime;
    int mainzisegred_small_219605_runs;
    int64_t mainzisegred_small_219654_total_runtime;
    int mainzisegred_small_219654_runs;
    int64_t mainzisegred_small_220434_total_runtime;
    int mainzisegred_small_220434_runs;
    int64_t mainzisegred_small_220503_total_runtime;
    int mainzisegred_small_220503_runs;
    int64_t mainzisegred_small_221513_total_runtime;
    int mainzisegred_small_221513_runs;
    int64_t mainzisegred_small_221611_total_runtime;
    int mainzisegred_small_221611_runs;
    int64_t mainzisegred_small_223287_total_runtime;
    int mainzisegred_small_223287_runs;
    int64_t mainzisegred_small_223339_total_runtime;
    int mainzisegred_small_223339_runs;
    int64_t mainzisegred_small_224325_total_runtime;
    int mainzisegred_small_224325_runs;
    int64_t mainzisegred_small_224397_total_runtime;
    int mainzisegred_small_224397_runs;
    int64_t mainzisegred_small_225613_total_runtime;
    int mainzisegred_small_225613_runs;
    int64_t mainzisegred_small_225714_total_runtime;
    int mainzisegred_small_225714_runs;
    int64_t mainzisegred_small_228180_total_runtime;
    int mainzisegred_small_228180_runs;
    cl_mem global_failure;
    cl_mem global_failure_args;
    struct opencl_context opencl;
    struct tuning_params tuning_params;
    cl_int failure_is_an_option;
};
void post_opencl_setup(struct opencl_context *ctx,
                       struct opencl_device_option *option)
{
    if ((ctx->lockstep_width == 0 && strstr(option->platform_name,
                                            "NVIDIA CUDA") != NULL) &&
        (option->device_type & CL_DEVICE_TYPE_GPU) == CL_DEVICE_TYPE_GPU) {
        ctx->lockstep_width = 32;
    }
    if ((ctx->lockstep_width == 0 && strstr(option->platform_name,
                                            "AMD Accelerated Parallel Processing") !=
         NULL) && (option->device_type & CL_DEVICE_TYPE_GPU) ==
        CL_DEVICE_TYPE_GPU) {
        ctx->lockstep_width = 32;
    }
    if ((ctx->lockstep_width == 0 && strstr(option->platform_name, "") !=
         NULL) && (option->device_type & CL_DEVICE_TYPE_GPU) ==
        CL_DEVICE_TYPE_GPU) {
        ctx->lockstep_width = 1;
    }
    if ((ctx->cfg.default_num_groups == 0 && strstr(option->platform_name,
                                                    "") != NULL) &&
        (option->device_type & CL_DEVICE_TYPE_GPU) == CL_DEVICE_TYPE_GPU) {
        size_t MAX_COMPUTE_UNITS_val = 0;
        
        clGetDeviceInfo(ctx->device, CL_DEVICE_MAX_COMPUTE_UNITS,
                        sizeof(MAX_COMPUTE_UNITS_val), &MAX_COMPUTE_UNITS_val,
                        NULL);
        ctx->cfg.default_num_groups = 4 * MAX_COMPUTE_UNITS_val;
    }
    if ((ctx->cfg.default_group_size == 0 && strstr(option->platform_name,
                                                    "") != NULL) &&
        (option->device_type & CL_DEVICE_TYPE_GPU) == CL_DEVICE_TYPE_GPU) {
        ctx->cfg.default_group_size = 256;
    }
    if ((ctx->cfg.default_tile_size == 0 && strstr(option->platform_name, "") !=
         NULL) && (option->device_type & CL_DEVICE_TYPE_GPU) ==
        CL_DEVICE_TYPE_GPU) {
        ctx->cfg.default_tile_size = 32;
    }
    if ((ctx->cfg.default_reg_tile_size == 0 && strstr(option->platform_name,
                                                       "") != NULL) &&
        (option->device_type & CL_DEVICE_TYPE_GPU) == CL_DEVICE_TYPE_GPU) {
        ctx->cfg.default_reg_tile_size = 2;
    }
    if ((ctx->cfg.default_threshold == 0 && strstr(option->platform_name, "") !=
         NULL) && (option->device_type & CL_DEVICE_TYPE_GPU) ==
        CL_DEVICE_TYPE_GPU) {
        ctx->cfg.default_threshold = 32768;
    }
    if ((ctx->lockstep_width == 0 && strstr(option->platform_name, "") !=
         NULL) && (option->device_type & CL_DEVICE_TYPE_CPU) ==
        CL_DEVICE_TYPE_CPU) {
        ctx->lockstep_width = 1;
    }
    if ((ctx->cfg.default_num_groups == 0 && strstr(option->platform_name,
                                                    "") != NULL) &&
        (option->device_type & CL_DEVICE_TYPE_CPU) == CL_DEVICE_TYPE_CPU) {
        size_t MAX_COMPUTE_UNITS_val = 0;
        
        clGetDeviceInfo(ctx->device, CL_DEVICE_MAX_COMPUTE_UNITS,
                        sizeof(MAX_COMPUTE_UNITS_val), &MAX_COMPUTE_UNITS_val,
                        NULL);
        ctx->cfg.default_num_groups = MAX_COMPUTE_UNITS_val;
    }
    if ((ctx->cfg.default_group_size == 0 && strstr(option->platform_name,
                                                    "") != NULL) &&
        (option->device_type & CL_DEVICE_TYPE_CPU) == CL_DEVICE_TYPE_CPU) {
        ctx->cfg.default_group_size = 32;
    }
    if ((ctx->cfg.default_tile_size == 0 && strstr(option->platform_name, "") !=
         NULL) && (option->device_type & CL_DEVICE_TYPE_CPU) ==
        CL_DEVICE_TYPE_CPU) {
        ctx->cfg.default_tile_size = 4;
    }
    if ((ctx->cfg.default_reg_tile_size == 0 && strstr(option->platform_name,
                                                       "") != NULL) &&
        (option->device_type & CL_DEVICE_TYPE_CPU) == CL_DEVICE_TYPE_CPU) {
        ctx->cfg.default_reg_tile_size = 1;
    }
    if ((ctx->cfg.default_threshold == 0 && strstr(option->platform_name, "") !=
         NULL) && (option->device_type & CL_DEVICE_TYPE_CPU) ==
        CL_DEVICE_TYPE_CPU) {
        size_t MAX_COMPUTE_UNITS_val = 0;
        
        clGetDeviceInfo(ctx->device, CL_DEVICE_MAX_COMPUTE_UNITS,
                        sizeof(MAX_COMPUTE_UNITS_val), &MAX_COMPUTE_UNITS_val,
                        NULL);
        ctx->cfg.default_threshold = MAX_COMPUTE_UNITS_val;
    }
}
static void init_context_early(struct futhark_context_config *cfg,
                               struct futhark_context *ctx)
{
    ctx->opencl.cfg = cfg->opencl;
    ctx->detail_memory = cfg->opencl.debugging;
    ctx->debugging = cfg->opencl.debugging;
    ctx->profiling = cfg->opencl.profiling;
    ctx->profiling_paused = 0;
    ctx->logging = cfg->opencl.logging;
    ctx->error = NULL;
    ctx->log = stderr;
    ctx->opencl.profiling_records_capacity = 200;
    ctx->opencl.profiling_records_used = 0;
    ctx->opencl.profiling_records =
        malloc(ctx->opencl.profiling_records_capacity *
        sizeof(struct profiling_record));
    create_lock(&ctx->lock);
    ctx->failure_is_an_option = 0;
    ctx->peak_mem_usage_device = 0;
    ctx->cur_mem_usage_device = 0;
    ctx->peak_mem_usage_default = 0;
    ctx->cur_mem_usage_default = 0;
    ctx->total_runs = 0;
    ctx->total_runtime = 0;
    ctx->copy_dev_to_dev_total_runtime = 0;
    ctx->copy_dev_to_dev_runs = 0;
    ctx->copy_dev_to_host_total_runtime = 0;
    ctx->copy_dev_to_host_runs = 0;
    ctx->copy_host_to_dev_total_runtime = 0;
    ctx->copy_host_to_dev_runs = 0;
    ctx->copy_scalar_to_dev_total_runtime = 0;
    ctx->copy_scalar_to_dev_runs = 0;
    ctx->copy_scalar_from_dev_total_runtime = 0;
    ctx->copy_scalar_from_dev_runs = 0;
    ctx->builtinzhreplicate_f64zireplicate_232951_total_runtime = 0;
    ctx->builtinzhreplicate_f64zireplicate_232951_runs = 0;
    ctx->builtinzhreplicate_i64zireplicate_232534_total_runtime = 0;
    ctx->builtinzhreplicate_i64zireplicate_232534_runs = 0;
    ctx->gpu_map_transpose_f64_total_runtime = 0;
    ctx->gpu_map_transpose_f64_runs = 0;
    ctx->gpu_map_transpose_f64_low_height_total_runtime = 0;
    ctx->gpu_map_transpose_f64_low_height_runs = 0;
    ctx->gpu_map_transpose_f64_low_width_total_runtime = 0;
    ctx->gpu_map_transpose_f64_low_width_runs = 0;
    ctx->gpu_map_transpose_f64_small_total_runtime = 0;
    ctx->gpu_map_transpose_f64_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_232552_total_runtime = 0;
    ctx->mainzicopy_232552_runs = 0;
    ctx->mainzicopy_232711_total_runtime = 0;
    ctx->mainzicopy_232711_runs = 0;
    ctx->mainzicopy_234634_total_runtime = 0;
    ctx->mainzicopy_234634_runs = 0;
    ctx->mainzicopy_234833_total_runtime = 0;
    ctx->mainzicopy_234833_runs = 0;
    ctx->mainzicopy_235083_total_runtime = 0;
    ctx->mainzicopy_235083_runs = 0;
    ctx->mainzicopy_235461_total_runtime = 0;
    ctx->mainzicopy_235461_runs = 0;
    ctx->mainzicopy_235683_total_runtime = 0;
    ctx->mainzicopy_235683_runs = 0;
    ctx->mainzicopy_235956_total_runtime = 0;
    ctx->mainzicopy_235956_runs = 0;
    ctx->mainziscan_stage1_206957_total_runtime = 0;
    ctx->mainziscan_stage1_206957_runs = 0;
    ctx->mainziscan_stage1_207097_total_runtime = 0;
    ctx->mainziscan_stage1_207097_runs = 0;
    ctx->mainziscan_stage1_207649_total_runtime = 0;
    ctx->mainziscan_stage1_207649_runs = 0;
    ctx->mainziscan_stage1_218773_total_runtime = 0;
    ctx->mainziscan_stage1_218773_runs = 0;
    ctx->mainziscan_stage1_218904_total_runtime = 0;
    ctx->mainziscan_stage1_218904_runs = 0;
    ctx->mainziscan_stage1_219035_total_runtime = 0;
    ctx->mainziscan_stage1_219035_runs = 0;
    ctx->mainziscan_stage1_228005_total_runtime = 0;
    ctx->mainziscan_stage1_228005_runs = 0;
    ctx->mainziscan_stage2_206957_total_runtime = 0;
    ctx->mainziscan_stage2_206957_runs = 0;
    ctx->mainziscan_stage2_207097_total_runtime = 0;
    ctx->mainziscan_stage2_207097_runs = 0;
    ctx->mainziscan_stage2_207649_total_runtime = 0;
    ctx->mainziscan_stage2_207649_runs = 0;
    ctx->mainziscan_stage2_218773_total_runtime = 0;
    ctx->mainziscan_stage2_218773_runs = 0;
    ctx->mainziscan_stage2_218904_total_runtime = 0;
    ctx->mainziscan_stage2_218904_runs = 0;
    ctx->mainziscan_stage2_219035_total_runtime = 0;
    ctx->mainziscan_stage2_219035_runs = 0;
    ctx->mainziscan_stage2_228005_total_runtime = 0;
    ctx->mainziscan_stage2_228005_runs = 0;
    ctx->mainziscan_stage3_206957_total_runtime = 0;
    ctx->mainziscan_stage3_206957_runs = 0;
    ctx->mainziscan_stage3_207097_total_runtime = 0;
    ctx->mainziscan_stage3_207097_runs = 0;
    ctx->mainziscan_stage3_207649_total_runtime = 0;
    ctx->mainziscan_stage3_207649_runs = 0;
    ctx->mainziscan_stage3_218773_total_runtime = 0;
    ctx->mainziscan_stage3_218773_runs = 0;
    ctx->mainziscan_stage3_218904_total_runtime = 0;
    ctx->mainziscan_stage3_218904_runs = 0;
    ctx->mainziscan_stage3_219035_total_runtime = 0;
    ctx->mainziscan_stage3_219035_runs = 0;
    ctx->mainziscan_stage3_228005_total_runtime = 0;
    ctx->mainziscan_stage3_228005_runs = 0;
    ctx->mainzisegmap_206959_total_runtime = 0;
    ctx->mainzisegmap_206959_runs = 0;
    ctx->mainzisegmap_207135_total_runtime = 0;
    ctx->mainzisegmap_207135_runs = 0;
    ctx->mainzisegmap_207260_total_runtime = 0;
    ctx->mainzisegmap_207260_runs = 0;
    ctx->mainzisegmap_207695_total_runtime = 0;
    ctx->mainzisegmap_207695_runs = 0;
    ctx->mainzisegmap_208908_total_runtime = 0;
    ctx->mainzisegmap_208908_runs = 0;
    ctx->mainzisegmap_208922_total_runtime = 0;
    ctx->mainzisegmap_208922_runs = 0;
    ctx->mainzisegmap_208946_total_runtime = 0;
    ctx->mainzisegmap_208946_runs = 0;
    ctx->mainzisegmap_209556_total_runtime = 0;
    ctx->mainzisegmap_209556_runs = 0;
    ctx->mainzisegmap_209568_total_runtime = 0;
    ctx->mainzisegmap_209568_runs = 0;
    ctx->mainzisegmap_209589_total_runtime = 0;
    ctx->mainzisegmap_209589_runs = 0;
    ctx->mainzisegmap_210182_total_runtime = 0;
    ctx->mainzisegmap_210182_runs = 0;
    ctx->mainzisegmap_210194_total_runtime = 0;
    ctx->mainzisegmap_210194_runs = 0;
    ctx->mainzisegmap_210215_total_runtime = 0;
    ctx->mainzisegmap_210215_runs = 0;
    ctx->mainzisegmap_210357_total_runtime = 0;
    ctx->mainzisegmap_210357_runs = 0;
    ctx->mainzisegmap_210502_total_runtime = 0;
    ctx->mainzisegmap_210502_runs = 0;
    ctx->mainzisegmap_210632_total_runtime = 0;
    ctx->mainzisegmap_210632_runs = 0;
    ctx->mainzisegmap_211772_total_runtime = 0;
    ctx->mainzisegmap_211772_runs = 0;
    ctx->mainzisegmap_211980_total_runtime = 0;
    ctx->mainzisegmap_211980_runs = 0;
    ctx->mainzisegmap_212069_total_runtime = 0;
    ctx->mainzisegmap_212069_runs = 0;
    ctx->mainzisegmap_212141_total_runtime = 0;
    ctx->mainzisegmap_212141_runs = 0;
    ctx->mainzisegmap_212355_total_runtime = 0;
    ctx->mainzisegmap_212355_runs = 0;
    ctx->mainzisegmap_213809_total_runtime = 0;
    ctx->mainzisegmap_213809_runs = 0;
    ctx->mainzisegmap_214084_total_runtime = 0;
    ctx->mainzisegmap_214084_runs = 0;
    ctx->mainzisegmap_214201_total_runtime = 0;
    ctx->mainzisegmap_214201_runs = 0;
    ctx->mainzisegmap_214285_total_runtime = 0;
    ctx->mainzisegmap_214285_runs = 0;
    ctx->mainzisegmap_214560_total_runtime = 0;
    ctx->mainzisegmap_214560_runs = 0;
    ctx->mainzisegmap_216352_total_runtime = 0;
    ctx->mainzisegmap_216352_runs = 0;
    ctx->mainzisegmap_216697_total_runtime = 0;
    ctx->mainzisegmap_216697_runs = 0;
    ctx->mainzisegmap_216846_total_runtime = 0;
    ctx->mainzisegmap_216846_runs = 0;
    ctx->mainzisegmap_216942_total_runtime = 0;
    ctx->mainzisegmap_216942_runs = 0;
    ctx->mainzisegmap_218503_total_runtime = 0;
    ctx->mainzisegmap_218503_runs = 0;
    ctx->mainzisegmap_218652_total_runtime = 0;
    ctx->mainzisegmap_218652_runs = 0;
    ctx->mainzisegmap_218688_total_runtime = 0;
    ctx->mainzisegmap_218688_runs = 0;
    ctx->mainzisegmap_218819_total_runtime = 0;
    ctx->mainzisegmap_218819_runs = 0;
    ctx->mainzisegmap_218950_total_runtime = 0;
    ctx->mainzisegmap_218950_runs = 0;
    ctx->mainzisegmap_219139_total_runtime = 0;
    ctx->mainzisegmap_219139_runs = 0;
    ctx->mainzisegmap_219524_total_runtime = 0;
    ctx->mainzisegmap_219524_runs = 0;
    ctx->mainzisegmap_219641_total_runtime = 0;
    ctx->mainzisegmap_219641_runs = 0;
    ctx->mainzisegmap_219802_total_runtime = 0;
    ctx->mainzisegmap_219802_runs = 0;
    ctx->mainzisegmap_220323_total_runtime = 0;
    ctx->mainzisegmap_220323_runs = 0;
    ctx->mainzisegmap_220480_total_runtime = 0;
    ctx->mainzisegmap_220480_runs = 0;
    ctx->mainzisegmap_220699_total_runtime = 0;
    ctx->mainzisegmap_220699_runs = 0;
    ctx->mainzisegmap_221368_total_runtime = 0;
    ctx->mainzisegmap_221368_runs = 0;
    ctx->mainzisegmap_221569_total_runtime = 0;
    ctx->mainzisegmap_221569_runs = 0;
    ctx->mainzisegmap_222439_total_runtime = 0;
    ctx->mainzisegmap_222439_runs = 0;
    ctx->mainzisegmap_222534_total_runtime = 0;
    ctx->mainzisegmap_222534_runs = 0;
    ctx->mainzisegmap_222641_total_runtime = 0;
    ctx->mainzisegmap_222641_runs = 0;
    ctx->mainzisegmap_223157_total_runtime = 0;
    ctx->mainzisegmap_223157_runs = 0;
    ctx->mainzisegmap_223174_total_runtime = 0;
    ctx->mainzisegmap_223174_runs = 0;
    ctx->mainzisegmap_223202_total_runtime = 0;
    ctx->mainzisegmap_223202_runs = 0;
    ctx->mainzisegmap_223326_total_runtime = 0;
    ctx->mainzisegmap_223326_runs = 0;
    ctx->mainzisegmap_223513_total_runtime = 0;
    ctx->mainzisegmap_223513_runs = 0;
    ctx->mainzisegmap_224163_total_runtime = 0;
    ctx->mainzisegmap_224163_runs = 0;
    ctx->mainzisegmap_224180_total_runtime = 0;
    ctx->mainzisegmap_224180_runs = 0;
    ctx->mainzisegmap_224210_total_runtime = 0;
    ctx->mainzisegmap_224210_runs = 0;
    ctx->mainzisegmap_224374_total_runtime = 0;
    ctx->mainzisegmap_224374_runs = 0;
    ctx->mainzisegmap_224619_total_runtime = 0;
    ctx->mainzisegmap_224619_runs = 0;
    ctx->mainzisegmap_225417_total_runtime = 0;
    ctx->mainzisegmap_225417_runs = 0;
    ctx->mainzisegmap_225434_total_runtime = 0;
    ctx->mainzisegmap_225434_runs = 0;
    ctx->mainzisegmap_225464_total_runtime = 0;
    ctx->mainzisegmap_225464_runs = 0;
    ctx->mainzisegmap_225672_total_runtime = 0;
    ctx->mainzisegmap_225672_runs = 0;
    ctx->mainzisegmap_225963_total_runtime = 0;
    ctx->mainzisegmap_225963_runs = 0;
    ctx->mainzisegmap_225980_total_runtime = 0;
    ctx->mainzisegmap_225980_runs = 0;
    ctx->mainzisegmap_226275_total_runtime = 0;
    ctx->mainzisegmap_226275_runs = 0;
    ctx->mainzisegmap_226292_total_runtime = 0;
    ctx->mainzisegmap_226292_runs = 0;
    ctx->mainzisegmap_226679_total_runtime = 0;
    ctx->mainzisegmap_226679_runs = 0;
    ctx->mainzisegmap_226696_total_runtime = 0;
    ctx->mainzisegmap_226696_runs = 0;
    ctx->mainzisegmap_226984_total_runtime = 0;
    ctx->mainzisegmap_226984_runs = 0;
    ctx->mainzisegmap_227201_total_runtime = 0;
    ctx->mainzisegmap_227201_runs = 0;
    ctx->mainzisegmap_227222_total_runtime = 0;
    ctx->mainzisegmap_227222_runs = 0;
    ctx->mainzisegmap_227351_total_runtime = 0;
    ctx->mainzisegmap_227351_runs = 0;
    ctx->mainzisegmap_228076_total_runtime = 0;
    ctx->mainzisegmap_228076_runs = 0;
    ctx->mainzisegmap_228131_total_runtime = 0;
    ctx->mainzisegmap_228131_runs = 0;
    ctx->mainzisegmap_228193_total_runtime = 0;
    ctx->mainzisegmap_228193_runs = 0;
    ctx->mainzisegmap_228279_total_runtime = 0;
    ctx->mainzisegmap_228279_runs = 0;
    ctx->mainzisegmap_228302_total_runtime = 0;
    ctx->mainzisegmap_228302_runs = 0;
    ctx->mainzisegmap_intragroup_206983_total_runtime = 0;
    ctx->mainzisegmap_intragroup_206983_runs = 0;
    ctx->mainzisegmap_intragroup_207338_total_runtime = 0;
    ctx->mainzisegmap_intragroup_207338_runs = 0;
    ctx->mainzisegmap_intragroup_207614_total_runtime = 0;
    ctx->mainzisegmap_intragroup_207614_runs = 0;
    ctx->mainzisegmap_intragroup_207867_total_runtime = 0;
    ctx->mainzisegmap_intragroup_207867_runs = 0;
    ctx->mainzisegmap_intragroup_208771_total_runtime = 0;
    ctx->mainzisegmap_intragroup_208771_runs = 0;
    ctx->mainzisegmap_intragroup_209172_total_runtime = 0;
    ctx->mainzisegmap_intragroup_209172_runs = 0;
    ctx->mainzisegmap_intragroup_209798_total_runtime = 0;
    ctx->mainzisegmap_intragroup_209798_runs = 0;
    ctx->mainzisegmap_intragroup_211858_total_runtime = 0;
    ctx->mainzisegmap_intragroup_211858_runs = 0;
    ctx->mainzisegmap_intragroup_213926_total_runtime = 0;
    ctx->mainzisegmap_intragroup_213926_runs = 0;
    ctx->mainzisegmap_intragroup_216501_total_runtime = 0;
    ctx->mainzisegmap_intragroup_216501_runs = 0;
    ctx->mainzisegmap_intragroup_217273_total_runtime = 0;
    ctx->mainzisegmap_intragroup_217273_runs = 0;
    ctx->mainzisegmap_intragroup_217594_total_runtime = 0;
    ctx->mainzisegmap_intragroup_217594_runs = 0;
    ctx->mainzisegmap_intragroup_218045_total_runtime = 0;
    ctx->mainzisegmap_intragroup_218045_runs = 0;
    ctx->mainzisegmap_intragroup_221759_total_runtime = 0;
    ctx->mainzisegmap_intragroup_221759_runs = 0;
    ctx->mainzisegmap_intragroup_221926_total_runtime = 0;
    ctx->mainzisegmap_intragroup_221926_runs = 0;
    ctx->mainzisegmap_intragroup_222183_total_runtime = 0;
    ctx->mainzisegmap_intragroup_222183_runs = 0;
    ctx->mainzisegmap_intragroup_226007_total_runtime = 0;
    ctx->mainzisegmap_intragroup_226007_runs = 0;
    ctx->mainzisegmap_intragroup_226320_total_runtime = 0;
    ctx->mainzisegmap_intragroup_226320_runs = 0;
    ctx->mainzisegmap_intragroup_226724_total_runtime = 0;
    ctx->mainzisegmap_intragroup_226724_runs = 0;
    ctx->mainzisegmap_intragroup_227074_total_runtime = 0;
    ctx->mainzisegmap_intragroup_227074_runs = 0;
    ctx->mainzisegmap_intragroup_227449_total_runtime = 0;
    ctx->mainzisegmap_intragroup_227449_runs = 0;
    ctx->mainzisegmap_intragroup_227905_total_runtime = 0;
    ctx->mainzisegmap_intragroup_227905_runs = 0;
    ctx->mainzisegred_large_212093_total_runtime = 0;
    ctx->mainzisegred_large_212093_runs = 0;
    ctx->mainzisegred_large_212167_total_runtime = 0;
    ctx->mainzisegred_large_212167_runs = 0;
    ctx->mainzisegred_large_214227_total_runtime = 0;
    ctx->mainzisegred_large_214227_runs = 0;
    ctx->mainzisegred_large_214321_total_runtime = 0;
    ctx->mainzisegred_large_214321_runs = 0;
    ctx->mainzisegred_large_216874_total_runtime = 0;
    ctx->mainzisegred_large_216874_runs = 0;
    ctx->mainzisegred_large_216997_total_runtime = 0;
    ctx->mainzisegred_large_216997_runs = 0;
    ctx->mainzisegred_large_218721_total_runtime = 0;
    ctx->mainzisegred_large_218721_runs = 0;
    ctx->mainzisegred_large_218852_total_runtime = 0;
    ctx->mainzisegred_large_218852_runs = 0;
    ctx->mainzisegred_large_218983_total_runtime = 0;
    ctx->mainzisegred_large_218983_runs = 0;
    ctx->mainzisegred_large_219605_total_runtime = 0;
    ctx->mainzisegred_large_219605_runs = 0;
    ctx->mainzisegred_large_219654_total_runtime = 0;
    ctx->mainzisegred_large_219654_runs = 0;
    ctx->mainzisegred_large_220434_total_runtime = 0;
    ctx->mainzisegred_large_220434_runs = 0;
    ctx->mainzisegred_large_220503_total_runtime = 0;
    ctx->mainzisegred_large_220503_runs = 0;
    ctx->mainzisegred_large_221513_total_runtime = 0;
    ctx->mainzisegred_large_221513_runs = 0;
    ctx->mainzisegred_large_221611_total_runtime = 0;
    ctx->mainzisegred_large_221611_runs = 0;
    ctx->mainzisegred_large_223287_total_runtime = 0;
    ctx->mainzisegred_large_223287_runs = 0;
    ctx->mainzisegred_large_223339_total_runtime = 0;
    ctx->mainzisegred_large_223339_runs = 0;
    ctx->mainzisegred_large_224325_total_runtime = 0;
    ctx->mainzisegred_large_224325_runs = 0;
    ctx->mainzisegred_large_224397_total_runtime = 0;
    ctx->mainzisegred_large_224397_runs = 0;
    ctx->mainzisegred_large_225613_total_runtime = 0;
    ctx->mainzisegred_large_225613_runs = 0;
    ctx->mainzisegred_large_225714_total_runtime = 0;
    ctx->mainzisegred_large_225714_runs = 0;
    ctx->mainzisegred_large_228180_total_runtime = 0;
    ctx->mainzisegred_large_228180_runs = 0;
    ctx->mainzisegred_small_212093_total_runtime = 0;
    ctx->mainzisegred_small_212093_runs = 0;
    ctx->mainzisegred_small_212167_total_runtime = 0;
    ctx->mainzisegred_small_212167_runs = 0;
    ctx->mainzisegred_small_214227_total_runtime = 0;
    ctx->mainzisegred_small_214227_runs = 0;
    ctx->mainzisegred_small_214321_total_runtime = 0;
    ctx->mainzisegred_small_214321_runs = 0;
    ctx->mainzisegred_small_216874_total_runtime = 0;
    ctx->mainzisegred_small_216874_runs = 0;
    ctx->mainzisegred_small_216997_total_runtime = 0;
    ctx->mainzisegred_small_216997_runs = 0;
    ctx->mainzisegred_small_218721_total_runtime = 0;
    ctx->mainzisegred_small_218721_runs = 0;
    ctx->mainzisegred_small_218852_total_runtime = 0;
    ctx->mainzisegred_small_218852_runs = 0;
    ctx->mainzisegred_small_218983_total_runtime = 0;
    ctx->mainzisegred_small_218983_runs = 0;
    ctx->mainzisegred_small_219605_total_runtime = 0;
    ctx->mainzisegred_small_219605_runs = 0;
    ctx->mainzisegred_small_219654_total_runtime = 0;
    ctx->mainzisegred_small_219654_runs = 0;
    ctx->mainzisegred_small_220434_total_runtime = 0;
    ctx->mainzisegred_small_220434_runs = 0;
    ctx->mainzisegred_small_220503_total_runtime = 0;
    ctx->mainzisegred_small_220503_runs = 0;
    ctx->mainzisegred_small_221513_total_runtime = 0;
    ctx->mainzisegred_small_221513_runs = 0;
    ctx->mainzisegred_small_221611_total_runtime = 0;
    ctx->mainzisegred_small_221611_runs = 0;
    ctx->mainzisegred_small_223287_total_runtime = 0;
    ctx->mainzisegred_small_223287_runs = 0;
    ctx->mainzisegred_small_223339_total_runtime = 0;
    ctx->mainzisegred_small_223339_runs = 0;
    ctx->mainzisegred_small_224325_total_runtime = 0;
    ctx->mainzisegred_small_224325_runs = 0;
    ctx->mainzisegred_small_224397_total_runtime = 0;
    ctx->mainzisegred_small_224397_runs = 0;
    ctx->mainzisegred_small_225613_total_runtime = 0;
    ctx->mainzisegred_small_225613_runs = 0;
    ctx->mainzisegred_small_225714_total_runtime = 0;
    ctx->mainzisegred_small_225714_runs = 0;
    ctx->mainzisegred_small_228180_total_runtime = 0;
    ctx->mainzisegred_small_228180_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) * (4 + 1), NULL,
                                              &error);
    OPENCL_SUCCEED_OR_RETURN(error);
    {
        ctx->builtinzhreplicate_f64zireplicate_232951 = clCreateKernel(prog,
                                                                       "builtinzhreplicate_f64zireplicate_232951",
                                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "builtin#replicate_f64.replicate_232951");
    }
    {
        ctx->builtinzhreplicate_i64zireplicate_232534 = clCreateKernel(prog,
                                                                       "builtinzhreplicate_i64zireplicate_232534",
                                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "builtin#replicate_i64.replicate_232534");
    }
    {
        ctx->gpu_map_transpose_f64 = clCreateKernel(prog,
                                                    "gpu_map_transpose_f64",
                                                    &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "gpu_map_transpose_f64");
    }
    {
        ctx->gpu_map_transpose_f64_low_height = clCreateKernel(prog,
                                                               "gpu_map_transpose_f64_low_height",
                                                               &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "gpu_map_transpose_f64_low_height");
    }
    {
        ctx->gpu_map_transpose_f64_low_width = clCreateKernel(prog,
                                                              "gpu_map_transpose_f64_low_width",
                                                              &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "gpu_map_transpose_f64_low_width");
    }
    {
        ctx->gpu_map_transpose_f64_small = clCreateKernel(prog,
                                                          "gpu_map_transpose_f64_small",
                                                          &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "gpu_map_transpose_f64_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_232552 = clCreateKernel(prog, "mainzicopy_232552",
                                                &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.copy_232552");
    }
    {
        ctx->mainzicopy_232711 = clCreateKernel(prog, "mainzicopy_232711",
                                                &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.copy_232711");
    }
    {
        ctx->mainzicopy_234634 = clCreateKernel(prog, "mainzicopy_234634",
                                                &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.copy_234634");
    }
    {
        ctx->mainzicopy_234833 = clCreateKernel(prog, "mainzicopy_234833",
                                                &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.copy_234833");
    }
    {
        ctx->mainzicopy_235083 = clCreateKernel(prog, "mainzicopy_235083",
                                                &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.copy_235083");
    }
    {
        ctx->mainzicopy_235461 = clCreateKernel(prog, "mainzicopy_235461",
                                                &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.copy_235461");
    }
    {
        ctx->mainzicopy_235683 = clCreateKernel(prog, "mainzicopy_235683",
                                                &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.copy_235683");
    }
    {
        ctx->mainzicopy_235956 = clCreateKernel(prog, "mainzicopy_235956",
                                                &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.copy_235956");
    }
    {
        ctx->mainziscan_stage1_206957 = clCreateKernel(prog,
                                                       "mainziscan_stage1_206957",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_206957, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_206957, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage1_206957");
    }
    {
        ctx->mainziscan_stage1_207097 = clCreateKernel(prog,
                                                       "mainziscan_stage1_207097",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_207097, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage1_207097");
    }
    {
        ctx->mainziscan_stage1_207649 = clCreateKernel(prog,
                                                       "mainziscan_stage1_207649",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_207649, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage1_207649");
    }
    {
        ctx->mainziscan_stage1_218773 = clCreateKernel(prog,
                                                       "mainziscan_stage1_218773",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_218773, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_218773, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage1_218773");
    }
    {
        ctx->mainziscan_stage1_218904 = clCreateKernel(prog,
                                                       "mainziscan_stage1_218904",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_218904, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_218904, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage1_218904");
    }
    {
        ctx->mainziscan_stage1_219035 = clCreateKernel(prog,
                                                       "mainziscan_stage1_219035",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_219035, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_219035, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage1_219035");
    }
    {
        ctx->mainziscan_stage1_228005 = clCreateKernel(prog,
                                                       "mainziscan_stage1_228005",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_228005, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage1_228005");
    }
    {
        ctx->mainziscan_stage2_206957 = clCreateKernel(prog,
                                                       "mainziscan_stage2_206957",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage2_206957, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage2_206957");
    }
    {
        ctx->mainziscan_stage2_207097 = clCreateKernel(prog,
                                                       "mainziscan_stage2_207097",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage2_207097, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage2_207097");
    }
    {
        ctx->mainziscan_stage2_207649 = clCreateKernel(prog,
                                                       "mainziscan_stage2_207649",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage2_207649, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage2_207649");
    }
    {
        ctx->mainziscan_stage2_218773 = clCreateKernel(prog,
                                                       "mainziscan_stage2_218773",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage2_218773, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage2_218773");
    }
    {
        ctx->mainziscan_stage2_218904 = clCreateKernel(prog,
                                                       "mainziscan_stage2_218904",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage2_218904, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage2_218904");
    }
    {
        ctx->mainziscan_stage2_219035 = clCreateKernel(prog,
                                                       "mainziscan_stage2_219035",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage2_219035, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage2_219035");
    }
    {
        ctx->mainziscan_stage2_228005 = clCreateKernel(prog,
                                                       "mainziscan_stage2_228005",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage2_228005, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage2_228005");
    }
    {
        ctx->mainziscan_stage3_206957 = clCreateKernel(prog,
                                                       "mainziscan_stage3_206957",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage3_206957, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage3_206957");
    }
    {
        ctx->mainziscan_stage3_207097 = clCreateKernel(prog,
                                                       "mainziscan_stage3_207097",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage3_207097, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage3_207097");
    }
    {
        ctx->mainziscan_stage3_207649 = clCreateKernel(prog,
                                                       "mainziscan_stage3_207649",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage3_207649, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage3_207649");
    }
    {
        ctx->mainziscan_stage3_218773 = clCreateKernel(prog,
                                                       "mainziscan_stage3_218773",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage3_218773, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage3_218773");
    }
    {
        ctx->mainziscan_stage3_218904 = clCreateKernel(prog,
                                                       "mainziscan_stage3_218904",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage3_218904, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage3_218904");
    }
    {
        ctx->mainziscan_stage3_219035 = clCreateKernel(prog,
                                                       "mainziscan_stage3_219035",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage3_219035, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage3_219035");
    }
    {
        ctx->mainziscan_stage3_228005 = clCreateKernel(prog,
                                                       "mainziscan_stage3_228005",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage3_228005, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage3_228005");
    }
    {
        ctx->mainzisegmap_206959 = clCreateKernel(prog, "mainzisegmap_206959",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_206959, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_206959");
    }
    {
        ctx->mainzisegmap_207135 = clCreateKernel(prog, "mainzisegmap_207135",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_207135, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_207135");
    }
    {
        ctx->mainzisegmap_207260 = clCreateKernel(prog, "mainzisegmap_207260",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_207260, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_207260, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_207260");
    }
    {
        ctx->mainzisegmap_207695 = clCreateKernel(prog, "mainzisegmap_207695",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_207695, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_207695");
    }
    {
        ctx->mainzisegmap_208908 = clCreateKernel(prog, "mainzisegmap_208908",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_208908, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_208908");
    }
    {
        ctx->mainzisegmap_208922 = clCreateKernel(prog, "mainzisegmap_208922",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_208922, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_208922");
    }
    {
        ctx->mainzisegmap_208946 = clCreateKernel(prog, "mainzisegmap_208946",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_208946, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_208946, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_208946");
    }
    {
        ctx->mainzisegmap_209556 = clCreateKernel(prog, "mainzisegmap_209556",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_209556, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_209556");
    }
    {
        ctx->mainzisegmap_209568 = clCreateKernel(prog, "mainzisegmap_209568",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_209568, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_209568");
    }
    {
        ctx->mainzisegmap_209589 = clCreateKernel(prog, "mainzisegmap_209589",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_209589, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_209589, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_209589");
    }
    {
        ctx->mainzisegmap_210182 = clCreateKernel(prog, "mainzisegmap_210182",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_210182, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_210182");
    }
    {
        ctx->mainzisegmap_210194 = clCreateKernel(prog, "mainzisegmap_210194",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_210194, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_210194");
    }
    {
        ctx->mainzisegmap_210215 = clCreateKernel(prog, "mainzisegmap_210215",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_210215, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_210215, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_210215");
    }
    {
        ctx->mainzisegmap_210357 = clCreateKernel(prog, "mainzisegmap_210357",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_210357, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_210357");
    }
    {
        ctx->mainzisegmap_210502 = clCreateKernel(prog, "mainzisegmap_210502",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_210502, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_210502, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_210502");
    }
    {
        ctx->mainzisegmap_210632 = clCreateKernel(prog, "mainzisegmap_210632",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_210632, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_210632");
    }
    {
        ctx->mainzisegmap_211772 = clCreateKernel(prog, "mainzisegmap_211772",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_211772, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_211772");
    }
    {
        ctx->mainzisegmap_211980 = clCreateKernel(prog, "mainzisegmap_211980",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_211980, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_211980");
    }
    {
        ctx->mainzisegmap_212069 = clCreateKernel(prog, "mainzisegmap_212069",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_212069, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_212069");
    }
    {
        ctx->mainzisegmap_212141 = clCreateKernel(prog, "mainzisegmap_212141",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_212141, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_212141");
    }
    {
        ctx->mainzisegmap_212355 = clCreateKernel(prog, "mainzisegmap_212355",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_212355, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_212355");
    }
    {
        ctx->mainzisegmap_213809 = clCreateKernel(prog, "mainzisegmap_213809",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_213809, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_213809");
    }
    {
        ctx->mainzisegmap_214084 = clCreateKernel(prog, "mainzisegmap_214084",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_214084, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_214084");
    }
    {
        ctx->mainzisegmap_214201 = clCreateKernel(prog, "mainzisegmap_214201",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_214201, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_214201");
    }
    {
        ctx->mainzisegmap_214285 = clCreateKernel(prog, "mainzisegmap_214285",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_214285, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_214285");
    }
    {
        ctx->mainzisegmap_214560 = clCreateKernel(prog, "mainzisegmap_214560",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_214560, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_214560");
    }
    {
        ctx->mainzisegmap_216352 = clCreateKernel(prog, "mainzisegmap_216352",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_216352, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_216352");
    }
    {
        ctx->mainzisegmap_216697 = clCreateKernel(prog, "mainzisegmap_216697",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_216697, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_216697");
    }
    {
        ctx->mainzisegmap_216846 = clCreateKernel(prog, "mainzisegmap_216846",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_216846, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_216846");
    }
    {
        ctx->mainzisegmap_216942 = clCreateKernel(prog, "mainzisegmap_216942",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_216942, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_216942");
    }
    {
        ctx->mainzisegmap_218503 = clCreateKernel(prog, "mainzisegmap_218503",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_218503, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_218503, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_218503");
    }
    {
        ctx->mainzisegmap_218652 = clCreateKernel(prog, "mainzisegmap_218652",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_218652, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_218652, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_218652");
    }
    {
        ctx->mainzisegmap_218688 = clCreateKernel(prog, "mainzisegmap_218688",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_218688, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_218688");
    }
    {
        ctx->mainzisegmap_218819 = clCreateKernel(prog, "mainzisegmap_218819",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_218819, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_218819");
    }
    {
        ctx->mainzisegmap_218950 = clCreateKernel(prog, "mainzisegmap_218950",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_218950, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_218950");
    }
    {
        ctx->mainzisegmap_219139 = clCreateKernel(prog, "mainzisegmap_219139",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_219139, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_219139");
    }
    {
        ctx->mainzisegmap_219524 = clCreateKernel(prog, "mainzisegmap_219524",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_219524, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_219524");
    }
    {
        ctx->mainzisegmap_219641 = clCreateKernel(prog, "mainzisegmap_219641",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_219641, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_219641");
    }
    {
        ctx->mainzisegmap_219802 = clCreateKernel(prog, "mainzisegmap_219802",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_219802, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_219802");
    }
    {
        ctx->mainzisegmap_220323 = clCreateKernel(prog, "mainzisegmap_220323",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_220323, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_220323");
    }
    {
        ctx->mainzisegmap_220480 = clCreateKernel(prog, "mainzisegmap_220480",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_220480, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_220480");
    }
    {
        ctx->mainzisegmap_220699 = clCreateKernel(prog, "mainzisegmap_220699",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_220699, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_220699");
    }
    {
        ctx->mainzisegmap_221368 = clCreateKernel(prog, "mainzisegmap_221368",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_221368, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_221368");
    }
    {
        ctx->mainzisegmap_221569 = clCreateKernel(prog, "mainzisegmap_221569",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_221569, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_221569");
    }
    {
        ctx->mainzisegmap_222439 = clCreateKernel(prog, "mainzisegmap_222439",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_222439, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_222439, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_222439");
    }
    {
        ctx->mainzisegmap_222534 = clCreateKernel(prog, "mainzisegmap_222534",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_222534, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_222534");
    }
    {
        ctx->mainzisegmap_222641 = clCreateKernel(prog, "mainzisegmap_222641",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_222641, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_222641, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_222641");
    }
    {
        ctx->mainzisegmap_223157 = clCreateKernel(prog, "mainzisegmap_223157",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_223157, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_223157");
    }
    {
        ctx->mainzisegmap_223174 = clCreateKernel(prog, "mainzisegmap_223174",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_223174, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_223174, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_223174");
    }
    {
        ctx->mainzisegmap_223202 = clCreateKernel(prog, "mainzisegmap_223202",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_223202, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_223202");
    }
    {
        ctx->mainzisegmap_223326 = clCreateKernel(prog, "mainzisegmap_223326",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_223326, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_223326");
    }
    {
        ctx->mainzisegmap_223513 = clCreateKernel(prog, "mainzisegmap_223513",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_223513, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_223513, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_223513");
    }
    {
        ctx->mainzisegmap_224163 = clCreateKernel(prog, "mainzisegmap_224163",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_224163, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_224163");
    }
    {
        ctx->mainzisegmap_224180 = clCreateKernel(prog, "mainzisegmap_224180",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_224180, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_224180, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_224180");
    }
    {
        ctx->mainzisegmap_224210 = clCreateKernel(prog, "mainzisegmap_224210",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_224210, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_224210");
    }
    {
        ctx->mainzisegmap_224374 = clCreateKernel(prog, "mainzisegmap_224374",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_224374, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_224374");
    }
    {
        ctx->mainzisegmap_224619 = clCreateKernel(prog, "mainzisegmap_224619",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_224619, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_224619, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_224619");
    }
    {
        ctx->mainzisegmap_225417 = clCreateKernel(prog, "mainzisegmap_225417",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_225417, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_225417");
    }
    {
        ctx->mainzisegmap_225434 = clCreateKernel(prog, "mainzisegmap_225434",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_225434, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_225434, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_225434");
    }
    {
        ctx->mainzisegmap_225464 = clCreateKernel(prog, "mainzisegmap_225464",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_225464, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_225464");
    }
    {
        ctx->mainzisegmap_225672 = clCreateKernel(prog, "mainzisegmap_225672",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_225672, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_225672");
    }
    {
        ctx->mainzisegmap_225963 = clCreateKernel(prog, "mainzisegmap_225963",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_225963, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_225963");
    }
    {
        ctx->mainzisegmap_225980 = clCreateKernel(prog, "mainzisegmap_225980",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_225980, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_225980, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_225980");
    }
    {
        ctx->mainzisegmap_226275 = clCreateKernel(prog, "mainzisegmap_226275",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_226275, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_226275");
    }
    {
        ctx->mainzisegmap_226292 = clCreateKernel(prog, "mainzisegmap_226292",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_226292, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_226292, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_226292");
    }
    {
        ctx->mainzisegmap_226679 = clCreateKernel(prog, "mainzisegmap_226679",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_226679, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_226679");
    }
    {
        ctx->mainzisegmap_226696 = clCreateKernel(prog, "mainzisegmap_226696",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_226696, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_226696, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_226696");
    }
    {
        ctx->mainzisegmap_226984 = clCreateKernel(prog, "mainzisegmap_226984",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_226984, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_226984, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_226984");
    }
    {
        ctx->mainzisegmap_227201 = clCreateKernel(prog, "mainzisegmap_227201",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_227201, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_227201");
    }
    {
        ctx->mainzisegmap_227222 = clCreateKernel(prog, "mainzisegmap_227222",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_227222, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_227222, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_227222");
    }
    {
        ctx->mainzisegmap_227351 = clCreateKernel(prog, "mainzisegmap_227351",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_227351, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_227351");
    }
    {
        ctx->mainzisegmap_228076 = clCreateKernel(prog, "mainzisegmap_228076",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_228076, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_228076");
    }
    {
        ctx->mainzisegmap_228131 = clCreateKernel(prog, "mainzisegmap_228131",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_228131, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_228131");
    }
    {
        ctx->mainzisegmap_228193 = clCreateKernel(prog, "mainzisegmap_228193",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_228193, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_228193");
    }
    {
        ctx->mainzisegmap_228279 = clCreateKernel(prog, "mainzisegmap_228279",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_228279, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_228279");
    }
    {
        ctx->mainzisegmap_228302 = clCreateKernel(prog, "mainzisegmap_228302",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_228302, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_228302");
    }
    {
        ctx->mainzisegmap_intragroup_206983 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_206983",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_206983,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_206983");
    }
    {
        ctx->mainzisegmap_intragroup_207338 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_207338",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_207338,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_207338");
    }
    {
        ctx->mainzisegmap_intragroup_207614 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_207614",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_207614,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_207614");
    }
    {
        ctx->mainzisegmap_intragroup_207867 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_207867",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_207867,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_207867,
                                            2, sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_207867");
    }
    {
        ctx->mainzisegmap_intragroup_208771 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_208771",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_208771,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_208771,
                                            2, sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_208771");
    }
    {
        ctx->mainzisegmap_intragroup_209172 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_209172",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_209172,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_209172,
                                            2, sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_209172");
    }
    {
        ctx->mainzisegmap_intragroup_209798 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_209798",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_209798,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_209798,
                                            2, sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_209798");
    }
    {
        ctx->mainzisegmap_intragroup_211858 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_211858",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_211858,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_211858");
    }
    {
        ctx->mainzisegmap_intragroup_213926 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_213926",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_213926");
    }
    {
        ctx->mainzisegmap_intragroup_216501 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_216501",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_216501");
    }
    {
        ctx->mainzisegmap_intragroup_217273 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_217273",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_217273,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_217273");
    }
    {
        ctx->mainzisegmap_intragroup_217594 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_217594",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_217594,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_217594");
    }
    {
        ctx->mainzisegmap_intragroup_218045 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_218045",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_218045,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_218045");
    }
    {
        ctx->mainzisegmap_intragroup_221759 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_221759",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_221759,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_221759");
    }
    {
        ctx->mainzisegmap_intragroup_221926 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_221926",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_221926,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_221926");
    }
    {
        ctx->mainzisegmap_intragroup_222183 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_222183",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_222183,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_222183");
    }
    {
        ctx->mainzisegmap_intragroup_226007 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_226007",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_226007,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_226007");
    }
    {
        ctx->mainzisegmap_intragroup_226320 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_226320",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_226320,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_226320");
    }
    {
        ctx->mainzisegmap_intragroup_226724 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_226724",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_226724,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_226724");
    }
    {
        ctx->mainzisegmap_intragroup_227074 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_227074",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_227074,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_227074,
                                            2, sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_227074");
    }
    {
        ctx->mainzisegmap_intragroup_227449 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_227449",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_227449,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_227449");
    }
    {
        ctx->mainzisegmap_intragroup_227905 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_227905",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_227905,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_227905");
    }
    {
        ctx->mainzisegred_large_212093 = clCreateKernel(prog,
                                                        "mainzisegred_large_212093",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_212093, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_212093");
    }
    {
        ctx->mainzisegred_large_212167 = clCreateKernel(prog,
                                                        "mainzisegred_large_212167",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_212167, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_212167");
    }
    {
        ctx->mainzisegred_large_214227 = clCreateKernel(prog,
                                                        "mainzisegred_large_214227",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_214227, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_214227");
    }
    {
        ctx->mainzisegred_large_214321 = clCreateKernel(prog,
                                                        "mainzisegred_large_214321",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_214321, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_214321");
    }
    {
        ctx->mainzisegred_large_216874 = clCreateKernel(prog,
                                                        "mainzisegred_large_216874",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_216874, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_216874");
    }
    {
        ctx->mainzisegred_large_216997 = clCreateKernel(prog,
                                                        "mainzisegred_large_216997",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_216997, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_216997");
    }
    {
        ctx->mainzisegred_large_218721 = clCreateKernel(prog,
                                                        "mainzisegred_large_218721",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_218721, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_218721");
    }
    {
        ctx->mainzisegred_large_218852 = clCreateKernel(prog,
                                                        "mainzisegred_large_218852",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_218852, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_218852");
    }
    {
        ctx->mainzisegred_large_218983 = clCreateKernel(prog,
                                                        "mainzisegred_large_218983",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_218983, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_218983");
    }
    {
        ctx->mainzisegred_large_219605 = clCreateKernel(prog,
                                                        "mainzisegred_large_219605",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_219605, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_219605");
    }
    {
        ctx->mainzisegred_large_219654 = clCreateKernel(prog,
                                                        "mainzisegred_large_219654",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_219654, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_219654");
    }
    {
        ctx->mainzisegred_large_220434 = clCreateKernel(prog,
                                                        "mainzisegred_large_220434",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_220434, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_220434");
    }
    {
        ctx->mainzisegred_large_220503 = clCreateKernel(prog,
                                                        "mainzisegred_large_220503",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_220503, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_220503");
    }
    {
        ctx->mainzisegred_large_221513 = clCreateKernel(prog,
                                                        "mainzisegred_large_221513",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_221513, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_221513");
    }
    {
        ctx->mainzisegred_large_221611 = clCreateKernel(prog,
                                                        "mainzisegred_large_221611",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_221611, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_221611");
    }
    {
        ctx->mainzisegred_large_223287 = clCreateKernel(prog,
                                                        "mainzisegred_large_223287",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_223287, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_223287");
    }
    {
        ctx->mainzisegred_large_223339 = clCreateKernel(prog,
                                                        "mainzisegred_large_223339",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_223339, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_223339");
    }
    {
        ctx->mainzisegred_large_224325 = clCreateKernel(prog,
                                                        "mainzisegred_large_224325",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_224325, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_224325");
    }
    {
        ctx->mainzisegred_large_224397 = clCreateKernel(prog,
                                                        "mainzisegred_large_224397",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_224397, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_224397");
    }
    {
        ctx->mainzisegred_large_225613 = clCreateKernel(prog,
                                                        "mainzisegred_large_225613",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_225613, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_225613");
    }
    {
        ctx->mainzisegred_large_225714 = clCreateKernel(prog,
                                                        "mainzisegred_large_225714",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_225714, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_225714");
    }
    {
        ctx->mainzisegred_large_228180 = clCreateKernel(prog,
                                                        "mainzisegred_large_228180",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_228180, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_228180");
    }
    {
        ctx->mainzisegred_small_212093 = clCreateKernel(prog,
                                                        "mainzisegred_small_212093",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_212093, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_212093");
    }
    {
        ctx->mainzisegred_small_212167 = clCreateKernel(prog,
                                                        "mainzisegred_small_212167",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_212167, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_212167");
    }
    {
        ctx->mainzisegred_small_214227 = clCreateKernel(prog,
                                                        "mainzisegred_small_214227",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_214227, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_214227");
    }
    {
        ctx->mainzisegred_small_214321 = clCreateKernel(prog,
                                                        "mainzisegred_small_214321",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_214321, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_214321");
    }
    {
        ctx->mainzisegred_small_216874 = clCreateKernel(prog,
                                                        "mainzisegred_small_216874",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_216874, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_216874");
    }
    {
        ctx->mainzisegred_small_216997 = clCreateKernel(prog,
                                                        "mainzisegred_small_216997",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_216997, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_216997");
    }
    {
        ctx->mainzisegred_small_218721 = clCreateKernel(prog,
                                                        "mainzisegred_small_218721",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_218721, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_218721");
    }
    {
        ctx->mainzisegred_small_218852 = clCreateKernel(prog,
                                                        "mainzisegred_small_218852",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_218852, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_218852");
    }
    {
        ctx->mainzisegred_small_218983 = clCreateKernel(prog,
                                                        "mainzisegred_small_218983",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_218983, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_218983");
    }
    {
        ctx->mainzisegred_small_219605 = clCreateKernel(prog,
                                                        "mainzisegred_small_219605",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_219605, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_219605");
    }
    {
        ctx->mainzisegred_small_219654 = clCreateKernel(prog,
                                                        "mainzisegred_small_219654",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_219654, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_219654");
    }
    {
        ctx->mainzisegred_small_220434 = clCreateKernel(prog,
                                                        "mainzisegred_small_220434",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_220434, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_220434");
    }
    {
        ctx->mainzisegred_small_220503 = clCreateKernel(prog,
                                                        "mainzisegred_small_220503",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_220503, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_220503");
    }
    {
        ctx->mainzisegred_small_221513 = clCreateKernel(prog,
                                                        "mainzisegred_small_221513",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_221513, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_221513");
    }
    {
        ctx->mainzisegred_small_221611 = clCreateKernel(prog,
                                                        "mainzisegred_small_221611",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_221611, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_221611");
    }
    {
        ctx->mainzisegred_small_223287 = clCreateKernel(prog,
                                                        "mainzisegred_small_223287",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_223287, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_223287");
    }
    {
        ctx->mainzisegred_small_223339 = clCreateKernel(prog,
                                                        "mainzisegred_small_223339",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_223339, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_223339");
    }
    {
        ctx->mainzisegred_small_224325 = clCreateKernel(prog,
                                                        "mainzisegred_small_224325",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_224325, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_224325");
    }
    {
        ctx->mainzisegred_small_224397 = clCreateKernel(prog,
                                                        "mainzisegred_small_224397",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_224397, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_224397");
    }
    {
        ctx->mainzisegred_small_225613 = clCreateKernel(prog,
                                                        "mainzisegred_small_225613",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_225613, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_225613");
    }
    {
        ctx->mainzisegred_small_225714 = clCreateKernel(prog,
                                                        "mainzisegred_small_225714",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_225714, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_225714");
    }
    {
        ctx->mainzisegred_small_228180 = clCreateKernel(prog,
                                                        "mainzisegred_small_228180",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_228180, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_228180");
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_233168.references = NULL;
        ctx->mainzicounter_mem_233168.size = 0;
        ctx->mainzicounter_mem_233168.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_233168.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237046,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_233256.references = NULL;
        ctx->mainzicounter_mem_233256.size = 0;
        ctx->mainzicounter_mem_233256.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_233256.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237062,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_233517.references = NULL;
        ctx->mainzicounter_mem_233517.size = 0;
        ctx->mainzicounter_mem_233517.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_233517.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237098,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_233625.references = NULL;
        ctx->mainzicounter_mem_233625.size = 0;
        ctx->mainzicounter_mem_233625.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_233625.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237114,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_233930.references = NULL;
        ctx->mainzicounter_mem_233930.size = 0;
        ctx->mainzicounter_mem_233930.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_233930.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237150,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_234050.references = NULL;
        ctx->mainzicounter_mem_234050.size = 0;
        ctx->mainzicounter_mem_234050.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_234050.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237166,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_234245.references = NULL;
        ctx->mainzicounter_mem_234245.size = 0;
        ctx->mainzicounter_mem_234245.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_234245.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237207,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_234388.references = NULL;
        ctx->mainzicounter_mem_234388.size = 0;
        ctx->mainzicounter_mem_234388.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_234388.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237238,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_234531.references = NULL;
        ctx->mainzicounter_mem_234531.size = 0;
        ctx->mainzicounter_mem_234531.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_234531.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237269,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_234710.references = NULL;
        ctx->mainzicounter_mem_234710.size = 0;
        ctx->mainzicounter_mem_234710.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_234710.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237310,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_234792.references = NULL;
        ctx->mainzicounter_mem_234792.size = 0;
        ctx->mainzicounter_mem_234792.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_234792.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237326,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_234934.references = NULL;
        ctx->mainzicounter_mem_234934.size = 0;
        ctx->mainzicounter_mem_234934.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_234934.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237352,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_235036.references = NULL;
        ctx->mainzicounter_mem_235036.size = 0;
        ctx->mainzicounter_mem_235036.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_235036.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237368,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_235204.references = NULL;
        ctx->mainzicounter_mem_235204.size = 0;
        ctx->mainzicounter_mem_235204.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_235204.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237394,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_235318.references = NULL;
        ctx->mainzicounter_mem_235318.size = 0;
        ctx->mainzicounter_mem_235318.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_235318.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237410,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_235560.references = NULL;
        ctx->mainzicounter_mem_235560.size = 0;
        ctx->mainzicounter_mem_235560.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_235560.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237471,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_235642.references = NULL;
        ctx->mainzicounter_mem_235642.size = 0;
        ctx->mainzicounter_mem_235642.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_235642.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237487,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_235807.references = NULL;
        ctx->mainzicounter_mem_235807.size = 0;
        ctx->mainzicounter_mem_235807.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_235807.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237523,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_235909.references = NULL;
        ctx->mainzicounter_mem_235909.size = 0;
        ctx->mainzicounter_mem_235909.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_235909.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237539,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_236100.references = NULL;
        ctx->mainzicounter_mem_236100.size = 0;
        ctx->mainzicounter_mem_236100.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_236100.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237575,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_236214.references = NULL;
        ctx->mainzicounter_mem_236214.size = 0;
        ctx->mainzicounter_mem_236214.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_236214.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237591,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_236725.references = NULL;
        ctx->mainzicounter_mem_236725.size = 0;
        ctx->mainzicounter_mem_236725.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_236725.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237707,
                                                          0, NULL, NULL));
    }
    ctx->tuning_params.builtinzhreplicate_f64zigroup_sizze_232954 =
        &cfg->tuning_params[0];
    ctx->tuning_params.builtinzhreplicate_i64zigroup_sizze_232537 =
        &cfg->tuning_params[1];
    ctx->tuning_params.mainzigroup_sizze_232555 = &cfg->tuning_params[2];
    ctx->tuning_params.mainzigroup_sizze_232714 = &cfg->tuning_params[3];
    ctx->tuning_params.mainzigroup_sizze_234637 = &cfg->tuning_params[4];
    ctx->tuning_params.mainzigroup_sizze_234836 = &cfg->tuning_params[5];
    ctx->tuning_params.mainzigroup_sizze_235086 = &cfg->tuning_params[6];
    ctx->tuning_params.mainzigroup_sizze_235464 = &cfg->tuning_params[7];
    ctx->tuning_params.mainzigroup_sizze_235686 = &cfg->tuning_params[8];
    ctx->tuning_params.mainzigroup_sizze_235959 = &cfg->tuning_params[9];
    ctx->tuning_params.mainzisegmap_group_sizze_206961 =
        &cfg->tuning_params[10];
    ctx->tuning_params.mainzisegmap_group_sizze_207015 =
        &cfg->tuning_params[11];
    ctx->tuning_params.mainzisegmap_group_sizze_207172 =
        &cfg->tuning_params[12];
    ctx->tuning_params.mainzisegmap_group_sizze_207440 =
        &cfg->tuning_params[13];
    ctx->tuning_params.mainzisegmap_group_sizze_208295 =
        &cfg->tuning_params[14];
    ctx->tuning_params.mainzisegmap_group_sizze_208534 =
        &cfg->tuning_params[15];
    ctx->tuning_params.mainzisegmap_group_sizze_208565 =
        &cfg->tuning_params[16];
    ctx->tuning_params.mainzisegmap_group_sizze_209297 =
        &cfg->tuning_params[17];
    ctx->tuning_params.mainzisegmap_group_sizze_209501 =
        &cfg->tuning_params[18];
    ctx->tuning_params.mainzisegmap_group_sizze_209527 =
        &cfg->tuning_params[19];
    ctx->tuning_params.mainzisegmap_group_sizze_209923 =
        &cfg->tuning_params[20];
    ctx->tuning_params.mainzisegmap_group_sizze_210127 =
        &cfg->tuning_params[21];
    ctx->tuning_params.mainzisegmap_group_sizze_210153 =
        &cfg->tuning_params[22];
    ctx->tuning_params.mainzisegmap_group_sizze_210326 =
        &cfg->tuning_params[23];
    ctx->tuning_params.mainzisegmap_group_sizze_210389 =
        &cfg->tuning_params[24];
    ctx->tuning_params.mainzisegmap_group_sizze_210531 =
        &cfg->tuning_params[25];
    ctx->tuning_params.mainzisegmap_group_sizze_210726 =
        &cfg->tuning_params[26];
    ctx->tuning_params.mainzisegmap_group_sizze_211061 =
        &cfg->tuning_params[27];
    ctx->tuning_params.mainzisegmap_group_sizze_211236 =
        &cfg->tuning_params[28];
    ctx->tuning_params.mainzisegmap_group_sizze_211322 =
        &cfg->tuning_params[29];
    ctx->tuning_params.mainzisegmap_group_sizze_212223 =
        &cfg->tuning_params[30];
    ctx->tuning_params.mainzisegmap_group_sizze_212479 =
        &cfg->tuning_params[31];
    ctx->tuning_params.mainzisegmap_group_sizze_212912 =
        &cfg->tuning_params[32];
    ctx->tuning_params.mainzisegmap_group_sizze_213144 =
        &cfg->tuning_params[33];
    ctx->tuning_params.mainzisegmap_group_sizze_213247 =
        &cfg->tuning_params[34];
    ctx->tuning_params.mainzisegmap_group_sizze_214396 =
        &cfg->tuning_params[35];
    ctx->tuning_params.mainzisegmap_group_sizze_214716 =
        &cfg->tuning_params[36];
    ctx->tuning_params.mainzisegmap_group_sizze_215257 =
        &cfg->tuning_params[37];
    ctx->tuning_params.mainzisegmap_group_sizze_215544 =
        &cfg->tuning_params[38];
    ctx->tuning_params.mainzisegmap_group_sizze_215674 =
        &cfg->tuning_params[39];
    ctx->tuning_params.mainzisegmap_group_sizze_218205 =
        &cfg->tuning_params[40];
    ctx->tuning_params.mainzisegmap_group_sizze_218601 =
        &cfg->tuning_params[41];
    ctx->tuning_params.mainzisegmap_group_sizze_218672 =
        &cfg->tuning_params[42];
    ctx->tuning_params.mainzisegmap_group_sizze_218803 =
        &cfg->tuning_params[43];
    ctx->tuning_params.mainzisegmap_group_sizze_218934 =
        &cfg->tuning_params[44];
    ctx->tuning_params.mainzisegmap_group_sizze_219065 =
        &cfg->tuning_params[45];
    ctx->tuning_params.mainzisegmap_group_sizze_219206 =
        &cfg->tuning_params[46];
    ctx->tuning_params.mainzisegmap_group_sizze_219337 =
        &cfg->tuning_params[47];
    ctx->tuning_params.mainzisegmap_group_sizze_219698 =
        &cfg->tuning_params[48];
    ctx->tuning_params.mainzisegmap_group_sizze_219898 =
        &cfg->tuning_params[49];
    ctx->tuning_params.mainzisegmap_group_sizze_220080 =
        &cfg->tuning_params[50];
    ctx->tuning_params.mainzisegmap_group_sizze_220563 =
        &cfg->tuning_params[51];
    ctx->tuning_params.mainzisegmap_group_sizze_220827 =
        &cfg->tuning_params[52];
    ctx->tuning_params.mainzisegmap_group_sizze_221058 =
        &cfg->tuning_params[53];
    ctx->tuning_params.mainzisegmap_group_sizze_222316 =
        &cfg->tuning_params[54];
    ctx->tuning_params.mainzisegmap_group_sizze_222503 =
        &cfg->tuning_params[55];
    ctx->tuning_params.mainzisegmap_group_sizze_222544 =
        &cfg->tuning_params[56];
    ctx->tuning_params.mainzisegmap_group_sizze_222733 =
        &cfg->tuning_params[57];
    ctx->tuning_params.mainzisegmap_group_sizze_222871 =
        &cfg->tuning_params[58];
    ctx->tuning_params.mainzisegmap_group_sizze_223070 =
        &cfg->tuning_params[59];
    ctx->tuning_params.mainzisegmap_group_sizze_223126 =
        &cfg->tuning_params[60];
    ctx->tuning_params.mainzisegmap_group_sizze_223386 =
        &cfg->tuning_params[61];
    ctx->tuning_params.mainzisegmap_group_sizze_223634 =
        &cfg->tuning_params[62];
    ctx->tuning_params.mainzisegmap_group_sizze_223823 =
        &cfg->tuning_params[63];
    ctx->tuning_params.mainzisegmap_group_sizze_224076 =
        &cfg->tuning_params[64];
    ctx->tuning_params.mainzisegmap_group_sizze_224132 =
        &cfg->tuning_params[65];
    ctx->tuning_params.mainzisegmap_group_sizze_224460 =
        &cfg->tuning_params[66];
    ctx->tuning_params.mainzisegmap_group_sizze_224772 =
        &cfg->tuning_params[67];
    ctx->tuning_params.mainzisegmap_group_sizze_225010 =
        &cfg->tuning_params[68];
    ctx->tuning_params.mainzisegmap_group_sizze_225330 =
        &cfg->tuning_params[69];
    ctx->tuning_params.mainzisegmap_group_sizze_225386 =
        &cfg->tuning_params[70];
    ctx->tuning_params.mainzisegmap_group_sizze_225876 =
        &cfg->tuning_params[71];
    ctx->tuning_params.mainzisegmap_group_sizze_225932 =
        &cfg->tuning_params[72];
    ctx->tuning_params.mainzisegmap_group_sizze_226188 =
        &cfg->tuning_params[73];
    ctx->tuning_params.mainzisegmap_group_sizze_226244 =
        &cfg->tuning_params[74];
    ctx->tuning_params.mainzisegmap_group_sizze_226592 =
        &cfg->tuning_params[75];
    ctx->tuning_params.mainzisegmap_group_sizze_226648 =
        &cfg->tuning_params[76];
    ctx->tuning_params.mainzisegmap_group_sizze_226861 =
        &cfg->tuning_params[77];
    ctx->tuning_params.mainzisegmap_group_sizze_227117 =
        &cfg->tuning_params[78];
    ctx->tuning_params.mainzisegmap_group_sizze_227160 =
        &cfg->tuning_params[79];
    ctx->tuning_params.mainzisegmap_group_sizze_227248 =
        &cfg->tuning_params[80];
    ctx->tuning_params.mainzisegmap_group_sizze_227667 =
        &cfg->tuning_params[81];
    ctx->tuning_params.mainzisegmap_group_sizze_228110 =
        &cfg->tuning_params[82];
    ctx->tuning_params.mainzisegmap_group_sizze_228145 =
        &cfg->tuning_params[83];
    ctx->tuning_params.mainzisegmap_group_sizze_228214 =
        &cfg->tuning_params[84];
    ctx->tuning_params.mainzisegmap_group_sizze_228304 =
        &cfg->tuning_params[85];
    ctx->tuning_params.mainzisegmap_num_groups_206963 = &cfg->tuning_params[86];
    ctx->tuning_params.mainzisegmap_num_groups_210533 = &cfg->tuning_params[87];
    ctx->tuning_params.mainzisegmap_num_groups_210728 = &cfg->tuning_params[88];
    ctx->tuning_params.mainzisegmap_num_groups_212225 = &cfg->tuning_params[89];
    ctx->tuning_params.mainzisegmap_num_groups_212481 = &cfg->tuning_params[90];
    ctx->tuning_params.mainzisegmap_num_groups_214398 = &cfg->tuning_params[91];
    ctx->tuning_params.mainzisegmap_num_groups_214718 = &cfg->tuning_params[92];
    ctx->tuning_params.mainzisegmap_num_groups_219067 = &cfg->tuning_params[93];
    ctx->tuning_params.mainzisegmap_num_groups_219700 = &cfg->tuning_params[94];
    ctx->tuning_params.mainzisegmap_num_groups_220565 = &cfg->tuning_params[95];
    ctx->tuning_params.mainzisegmap_num_groups_222546 = &cfg->tuning_params[96];
    ctx->tuning_params.mainzisegmap_num_groups_223388 = &cfg->tuning_params[97];
    ctx->tuning_params.mainzisegmap_num_groups_224462 = &cfg->tuning_params[98];
    ctx->tuning_params.mainzisegmap_num_groups_227250 = &cfg->tuning_params[99];
    ctx->tuning_params.mainzisegmap_num_groups_228306 =
        &cfg->tuning_params[100];
    ctx->tuning_params.mainzisegred_group_sizze_211164 =
        &cfg->tuning_params[101];
    ctx->tuning_params.mainzisegred_group_sizze_211266 =
        &cfg->tuning_params[102];
    ctx->tuning_params.mainzisegred_group_sizze_213050 =
        &cfg->tuning_params[103];
    ctx->tuning_params.mainzisegred_group_sizze_213183 =
        &cfg->tuning_params[104];
    ctx->tuning_params.mainzisegred_group_sizze_215433 =
        &cfg->tuning_params[105];
    ctx->tuning_params.mainzisegred_group_sizze_215602 =
        &cfg->tuning_params[106];
    ctx->tuning_params.mainzisegred_group_sizze_218698 =
        &cfg->tuning_params[107];
    ctx->tuning_params.mainzisegred_group_sizze_218829 =
        &cfg->tuning_params[108];
    ctx->tuning_params.mainzisegred_group_sizze_218960 =
        &cfg->tuning_params[109];
    ctx->tuning_params.mainzisegred_group_sizze_219283 =
        &cfg->tuning_params[110];
    ctx->tuning_params.mainzisegred_group_sizze_219350 =
        &cfg->tuning_params[111];
    ctx->tuning_params.mainzisegred_group_sizze_220008 =
        &cfg->tuning_params[112];
    ctx->tuning_params.mainzisegred_group_sizze_220102 =
        &cfg->tuning_params[113];
    ctx->tuning_params.mainzisegred_group_sizze_220973 =
        &cfg->tuning_params[114];
    ctx->tuning_params.mainzisegred_group_sizze_221099 =
        &cfg->tuning_params[115];
    ctx->tuning_params.mainzisegred_group_sizze_222814 =
        &cfg->tuning_params[116];
    ctx->tuning_params.mainzisegred_group_sizze_222884 =
        &cfg->tuning_params[117];
    ctx->tuning_params.mainzisegred_group_sizze_223748 =
        &cfg->tuning_params[118];
    ctx->tuning_params.mainzisegred_group_sizze_223845 =
        &cfg->tuning_params[119];
    ctx->tuning_params.mainzisegred_group_sizze_224922 =
        &cfg->tuning_params[120];
    ctx->tuning_params.mainzisegred_group_sizze_225051 =
        &cfg->tuning_params[121];
    ctx->tuning_params.mainzisegred_group_sizze_228157 =
        &cfg->tuning_params[122];
    ctx->tuning_params.mainzisegred_num_groups_211166 =
        &cfg->tuning_params[123];
    ctx->tuning_params.mainzisegred_num_groups_211268 =
        &cfg->tuning_params[124];
    ctx->tuning_params.mainzisegred_num_groups_213052 =
        &cfg->tuning_params[125];
    ctx->tuning_params.mainzisegred_num_groups_213185 =
        &cfg->tuning_params[126];
    ctx->tuning_params.mainzisegred_num_groups_215435 =
        &cfg->tuning_params[127];
    ctx->tuning_params.mainzisegred_num_groups_215604 =
        &cfg->tuning_params[128];
    ctx->tuning_params.mainzisegred_num_groups_218700 =
        &cfg->tuning_params[129];
    ctx->tuning_params.mainzisegred_num_groups_218831 =
        &cfg->tuning_params[130];
    ctx->tuning_params.mainzisegred_num_groups_218962 =
        &cfg->tuning_params[131];
    ctx->tuning_params.mainzisegred_num_groups_219285 =
        &cfg->tuning_params[132];
    ctx->tuning_params.mainzisegred_num_groups_219352 =
        &cfg->tuning_params[133];
    ctx->tuning_params.mainzisegred_num_groups_220010 =
        &cfg->tuning_params[134];
    ctx->tuning_params.mainzisegred_num_groups_220104 =
        &cfg->tuning_params[135];
    ctx->tuning_params.mainzisegred_num_groups_220975 =
        &cfg->tuning_params[136];
    ctx->tuning_params.mainzisegred_num_groups_221101 =
        &cfg->tuning_params[137];
    ctx->tuning_params.mainzisegred_num_groups_222816 =
        &cfg->tuning_params[138];
    ctx->tuning_params.mainzisegred_num_groups_222886 =
        &cfg->tuning_params[139];
    ctx->tuning_params.mainzisegred_num_groups_223750 =
        &cfg->tuning_params[140];
    ctx->tuning_params.mainzisegred_num_groups_223847 =
        &cfg->tuning_params[141];
    ctx->tuning_params.mainzisegred_num_groups_224924 =
        &cfg->tuning_params[142];
    ctx->tuning_params.mainzisegred_num_groups_225053 =
        &cfg->tuning_params[143];
    ctx->tuning_params.mainzisegred_num_groups_228159 =
        &cfg->tuning_params[144];
    ctx->tuning_params.mainzisegscan_group_sizze_206951 =
        &cfg->tuning_params[145];
    ctx->tuning_params.mainzisegscan_group_sizze_207071 =
        &cfg->tuning_params[146];
    ctx->tuning_params.mainzisegscan_group_sizze_207509 =
        &cfg->tuning_params[147];
    ctx->tuning_params.mainzisegscan_group_sizze_218731 =
        &cfg->tuning_params[148];
    ctx->tuning_params.mainzisegscan_group_sizze_218862 =
        &cfg->tuning_params[149];
    ctx->tuning_params.mainzisegscan_group_sizze_218993 =
        &cfg->tuning_params[150];
    ctx->tuning_params.mainzisegscan_group_sizze_227715 =
        &cfg->tuning_params[151];
    ctx->tuning_params.mainzisegscan_num_groups_206953 =
        &cfg->tuning_params[152];
    ctx->tuning_params.mainzisegscan_num_groups_207073 =
        &cfg->tuning_params[153];
    ctx->tuning_params.mainzisegscan_num_groups_207511 =
        &cfg->tuning_params[154];
    ctx->tuning_params.mainzisegscan_num_groups_218733 =
        &cfg->tuning_params[155];
    ctx->tuning_params.mainzisegscan_num_groups_218864 =
        &cfg->tuning_params[156];
    ctx->tuning_params.mainzisegscan_num_groups_218995 =
        &cfg->tuning_params[157];
    ctx->tuning_params.mainzisegscan_num_groups_227717 =
        &cfg->tuning_params[158];
    ctx->tuning_params.mainzisuff_intra_par_0 = &cfg->tuning_params[159];
    ctx->tuning_params.mainzisuff_intra_par_1 = &cfg->tuning_params[160];
    ctx->tuning_params.mainzisuff_intra_par_13 = &cfg->tuning_params[161];
    ctx->tuning_params.mainzisuff_intra_par_17 = &cfg->tuning_params[162];
    ctx->tuning_params.mainzisuff_intra_par_2 = &cfg->tuning_params[163];
    ctx->tuning_params.mainzisuff_intra_par_3 = &cfg->tuning_params[164];
    ctx->tuning_params.mainzisuff_intra_par_34 = &cfg->tuning_params[165];
    ctx->tuning_params.mainzisuff_intra_par_36 = &cfg->tuning_params[166];
    ctx->tuning_params.mainzisuff_intra_par_37 = &cfg->tuning_params[167];
    ctx->tuning_params.mainzisuff_intra_par_4 = &cfg->tuning_params[168];
    ctx->tuning_params.mainzisuff_intra_par_5 = &cfg->tuning_params[169];
    ctx->tuning_params.mainzisuff_intra_par_6 = &cfg->tuning_params[170];
    ctx->tuning_params.mainzisuff_intra_par_9 = &cfg->tuning_params[171];
    ctx->tuning_params.mainzisuff_outer_par_10 = &cfg->tuning_params[172];
    ctx->tuning_params.mainzisuff_outer_par_11 = &cfg->tuning_params[173];
    ctx->tuning_params.mainzisuff_outer_par_12 = &cfg->tuning_params[174];
    ctx->tuning_params.mainzisuff_outer_par_14 = &cfg->tuning_params[175];
    ctx->tuning_params.mainzisuff_outer_par_15 = &cfg->tuning_params[176];
    ctx->tuning_params.mainzisuff_outer_par_16 = &cfg->tuning_params[177];
    ctx->tuning_params.mainzisuff_outer_par_18 = &cfg->tuning_params[178];
    ctx->tuning_params.mainzisuff_outer_par_19 = &cfg->tuning_params[179];
    ctx->tuning_params.mainzisuff_outer_par_20 = &cfg->tuning_params[180];
    ctx->tuning_params.mainzisuff_outer_par_21 = &cfg->tuning_params[181];
    ctx->tuning_params.mainzisuff_outer_par_22 = &cfg->tuning_params[182];
    ctx->tuning_params.mainzisuff_outer_par_23 = &cfg->tuning_params[183];
    ctx->tuning_params.mainzisuff_outer_par_24 = &cfg->tuning_params[184];
    ctx->tuning_params.mainzisuff_outer_par_25 = &cfg->tuning_params[185];
    ctx->tuning_params.mainzisuff_outer_par_26 = &cfg->tuning_params[186];
    ctx->tuning_params.mainzisuff_outer_par_27 = &cfg->tuning_params[187];
    ctx->tuning_params.mainzisuff_outer_par_28 = &cfg->tuning_params[188];
    ctx->tuning_params.mainzisuff_outer_par_29 = &cfg->tuning_params[189];
    ctx->tuning_params.mainzisuff_outer_par_30 = &cfg->tuning_params[190];
    ctx->tuning_params.mainzisuff_outer_par_31 = &cfg->tuning_params[191];
    ctx->tuning_params.mainzisuff_outer_par_32 = &cfg->tuning_params[192];
    ctx->tuning_params.mainzisuff_outer_par_33 = &cfg->tuning_params[193];
    ctx->tuning_params.mainzisuff_outer_par_35 = &cfg->tuning_params[194];
    ctx->tuning_params.mainzisuff_outer_par_38 = &cfg->tuning_params[195];
    ctx->tuning_params.mainzisuff_outer_par_7 = &cfg->tuning_params[196];
    ctx->tuning_params.mainzisuff_outer_par_8 = &cfg->tuning_params[197];
    init_constants(ctx);
    // Clear the free list of any deallocations that occurred while initialising constants.
    OPENCL_SUCCEED_OR_RETURN(opencl_free_all(&ctx->opencl));
    // The program will be properly freed after all the kernels have also been freed.
    OPENCL_SUCCEED_OR_RETURN(clReleaseProgram(prog));
    return futhark_context_sync(ctx);
}
struct futhark_context *futhark_context_new(struct futhark_context_config *cfg)
{
    assert(!cfg->in_use);
    
    struct futhark_context *ctx =
                           (struct futhark_context *) malloc(sizeof(struct futhark_context));
    
    if (ctx == NULL)
        return NULL;
    ctx->cfg = cfg;
    ctx->cfg->in_use = 1;
    
    int required_types = 0;
    
    required_types |= OPENCL_F64;
    init_context_early(cfg, ctx);
    
    cl_program prog = setup_opencl(&ctx->opencl, opencl_program, required_types,
                                   cfg->build_opts);
    
    init_context_late(cfg, ctx, prog);
    return ctx;
}
struct futhark_context *futhark_context_new_with_command_queue(struct futhark_context_config *cfg,
                                                               cl_command_queue queue)
{
    assert(!cfg->in_use);
    
    struct futhark_context *ctx =
                           (struct futhark_context *) malloc(sizeof(struct futhark_context));
    
    if (ctx == NULL)
        return NULL;
    ctx->cfg = cfg;
    ctx->cfg->in_use = 1;
    
    int required_types = 0;
    
    required_types |= OPENCL_F64;
    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_f64zireplicate_232951));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->builtinzhreplicate_i64zireplicate_232534));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->gpu_map_transpose_f64));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->gpu_map_transpose_f64_low_height));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->gpu_map_transpose_f64_low_width));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->gpu_map_transpose_f64_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_232552));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzicopy_232711));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzicopy_234634));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzicopy_234833));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzicopy_235083));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzicopy_235461));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzicopy_235683));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzicopy_235956));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage1_206957));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage1_207097));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage1_207649));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage1_218773));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage1_218904));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage1_219035));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage1_228005));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage2_206957));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage2_207097));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage2_207649));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage2_218773));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage2_218904));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage2_219035));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage2_228005));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage3_206957));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage3_207097));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage3_207649));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage3_218773));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage3_218904));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage3_219035));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage3_228005));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_206959));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_207135));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_207260));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_207695));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_208908));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_208922));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_208946));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_209556));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_209568));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_209589));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_210182));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_210194));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_210215));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_210357));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_210502));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_210632));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_211772));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_211980));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_212069));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_212141));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_212355));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_213809));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_214084));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_214201));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_214285));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_214560));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_216352));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_216697));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_216846));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_216942));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_218503));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_218652));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_218688));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_218819));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_218950));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_219139));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_219524));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_219641));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_219802));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_220323));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_220480));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_220699));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_221368));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_221569));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_222439));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_222534));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_222641));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_223157));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_223174));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_223202));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_223326));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_223513));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_224163));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_224180));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_224210));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_224374));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_224619));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_225417));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_225434));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_225464));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_225672));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_225963));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_225980));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_226275));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_226292));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_226679));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_226696));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_226984));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_227201));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_227222));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_227351));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_228076));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_228131));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_228193));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_228279));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_228302));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_206983));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_207338));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_207614));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_207867));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_208771));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_209172));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_209798));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_211858));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_213926));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_216501));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_217273));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_217594));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_218045));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_221759));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_221926));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_222183));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_226007));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_226320));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_226724));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_227074));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_227449));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_227905));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_212093));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_212167));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_214227));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_214321));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_216874));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_216997));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_218721));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_218852));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_218983));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_219605));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_219654));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_220434));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_220503));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_221513));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_221611));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_223287));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_223339));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_224325));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_224397));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_225613));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_225714));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_228180));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_212093));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_212167));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_214227));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_214321));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_216874));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_216997));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_218721));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_218852));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_218983));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_219605));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_219654));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_220434));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_220503));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_221513));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_221611));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_223287));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_223339));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_224325));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_224397));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_225613));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_225714));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_228180));
    teardown_opencl(&ctx->opencl);
    ctx->cfg->in_use = 0;
    free(ctx);
}
int futhark_context_sync(struct futhark_context *ctx)
{
    cl_int failure_idx = -1;
    
    if (ctx->failure_is_an_option) {
        OPENCL_SUCCEED_OR_RETURN(clEnqueueReadBuffer(ctx->opencl.queue,
                                                     ctx->global_failure,
                                                     CL_FALSE, 0,
                                                     sizeof(cl_int),
                                                     &failure_idx, 0, NULL,
                                                     ctx->profiling_paused ||
                                                     !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                               &ctx->copy_scalar_from_dev_runs,
                                                                                               &ctx->copy_scalar_from_dev_total_runtime)));
        ctx->failure_is_an_option = 0;
    }
    OPENCL_SUCCEED_OR_RETURN(clFinish(ctx->opencl.queue));
    if (failure_idx >= 0) {
        cl_int no_failure = -1;
        
        OPENCL_SUCCEED_OR_RETURN(clEnqueueWriteBuffer(ctx->opencl.queue,
                                                      ctx->global_failure,
                                                      CL_TRUE, 0,
                                                      sizeof(cl_int),
                                                      &no_failure, 0, NULL,
                                                      NULL));
        
        int64_t args[4 + 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  stl.fut:406:66-71\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:404:36-407:52\n   #5  /prelude/soacs.fut:59:3-10\n   #6  /prelude/array.fut:195:3-17\n   #7  utils.fut:6:3-16\n   #8  stl.fut:403:29-408:37\n   #9  stl.fut:402:22-409:28\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 1:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:124:33-40\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:119:20-125:36\n   #5  /prelude/soacs.fut:59:3-10\n   #6  /prelude/array.fut:195:3-17\n   #7  utils.fut:6:3-16\n   #8  stl.fut:117:12-126:20\n   #9  stl.fut:116:5-127:11\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 2:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:450:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:517:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 3:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:517:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 4:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:461:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:517:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 5:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:485:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:518:16-54\n   #5  stl.fut:142:20-80\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:141:12-143:40\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:140:5-144:36\n   #12 stl.fut:415:61-429:75\n   #13 stl.fut:455:3-469:34\n   #14 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 6:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:518:16-54\n   #5  stl.fut:142:20-80\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:141:12-143:40\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:140:5-144:36\n   #12 stl.fut:415:61-429:75\n   #13 stl.fut:455:3-469:34\n   #14 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 7:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:450:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:517:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 8:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:517:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 9:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:461:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:517:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 10:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:485:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:518:16-54\n   #5  stl.fut:142:20-80\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:141:12-143:40\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:140:5-144:36\n   #12 stl.fut:415:61-429:75\n   #13 stl.fut:455:3-469:34\n   #14 stl.fut:439:1-469:34\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:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:518:16-54\n   #5  stl.fut:142:20-80\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:141:12-143:40\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:140:5-144:36\n   #12 stl.fut:415:61-429:75\n   #13 stl.fut:455:3-469:34\n   #14 stl.fut:439:1-469:34\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:450:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:517:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\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:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:517:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\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:461:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:517:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 15:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:485:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:518:16-54\n   #5  stl.fut:142:20-80\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:141:12-143:40\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:140:5-144:36\n   #12 stl.fut:415:61-429:75\n   #13 stl.fut:455:3-469:34\n   #14 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 16:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:518:16-54\n   #5  stl.fut:142:20-80\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:141:12-143:40\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:140:5-144:36\n   #12 stl.fut:415:61-429:75\n   #13 stl.fut:455:3-469:34\n   #14 stl.fut:439:1-469:34\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:450:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:150:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:148:5-151:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\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:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:150:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:148:5-151:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\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:461:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:150:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:148:5-151:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\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:485:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:504:16-51\n   #5  stl.fut:150:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:148:5-151:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 21:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:504:16-51\n   #5  stl.fut:150:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:148:5-151:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 22:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:450:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:150:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:148:5-151:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\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:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:150:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:148:5-151:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\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:461:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:150:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:148:5-151:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\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:485:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:504:16-51\n   #5  stl.fut:150:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:148:5-151:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\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:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:504:16-51\n   #5  stl.fut:150:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:148:5-151:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 27:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:450:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:157:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:155:5-158:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 28:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:157:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:155:5-158:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\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:461:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:157:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:155:5-158:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\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:485:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:504:16-51\n   #5  stl.fut:157:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:155:5-158:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\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:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:504:16-51\n   #5  stl.fut:157:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:155:5-158:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\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:450:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:157:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:155:5-158:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 33:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:157:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:155:5-158:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 34:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:461:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:157:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:155:5-158:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\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:485:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:504:16-51\n   #5  stl.fut:157:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:155:5-158:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\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:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:504:16-51\n   #5  stl.fut:157:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:155:5-158:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 37:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:193:42-57\n   #1  stl.fut:188:28-194:44\n   #2  /prelude/soacs.fut:67:19-23\n   #3  /prelude/soacs.fut:67:3-37\n   #4  stl.fut:186:21-195:50\n   #5  /prelude/soacs.fut:75:22-28\n   #6  /prelude/soacs.fut:75:3-45\n   #7  stl.fut:184:13-196:57\n   #8  stl.fut:415:61-429:75\n   #9  stl.fut:455:3-469:34\n   #10 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 38:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  /prelude/array.fut:21:29-32\n   #1  loess.fut:559:12-20\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:557:3-566:9\n   #6  stl.fut:220:31-96\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:219:23-221:48\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:218:15-222:44\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 39:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  /prelude/array.fut:26:29-34\n   #1  loess.fut:561:12-20\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:557:3-566:9\n   #6  stl.fut:220:31-96\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:219:23-221:48\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:218:15-222:44\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 40:
            {
                ctx->error =
                    msgprintf("division by zero\n-> #0  loess.fut:563:22-35\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:557:3-566:9\n   #5  stl.fut:220:31-96\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:219:23-221:48\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:218:15-222:44\n   #12 stl.fut:415:61-429:75\n   #13 stl.fut:455:3-469:34\n   #14 stl.fut:439:1-469:34\n");
                break;
            }
            
          case 41:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:536:27-33\n   #1  loess.fut:565:15-52\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:557:3-566:9\n   #6  stl.fut:220:31-96\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:219:23-221:48\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:218:15-222:44\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\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:537:27-37\n   #1  loess.fut:565:15-52\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:557:3-566:9\n   #6  stl.fut:220:31-96\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:219:23-221:48\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:218:15-222:44\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 43:
            {
                ctx->error =
                    msgprintf("Index [%lld, %lld] out of bounds for array of shape [%lld][%lld].\n-> #0  stl.fut:226:39-67\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:226:28-74\n   #5  stl.fut:225:21-227:39\n   #6  stl.fut:415:61-429:75\n   #7  stl.fut:455:3-469:34\n   #8  stl.fut:439:1-469:34\n",
                              args[0], args[1], args[2], args[3]);
                break;
            }
            
          case 44:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:32:23-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  stl.fut:38:3-36\n   #9  stl.fut:231:23-47\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 45:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:32:40-47\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  stl.fut:38:3-36\n   #9  stl.fut:231:23-47\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 46:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:32:23-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  /prelude/functional.fut:9:42-44\n   #9  stl.fut:38:3-64\n   #10 stl.fut:231:23-47\n   #11 stl.fut:415:61-429:75\n   #12 stl.fut:455:3-469:34\n   #13 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 47:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:32:40-47\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  /prelude/functional.fut:9:42-44\n   #9  stl.fut:38:3-64\n   #10 stl.fut:231:23-47\n   #11 stl.fut:415:61-429:75\n   #12 stl.fut:455:3-469:34\n   #13 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 48:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:32:23-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  /prelude/functional.fut:9:42-44\n   #9  stl.fut:38:3-84\n   #10 stl.fut:231:23-47\n   #11 stl.fut:415:61-429:75\n   #12 stl.fut:455:3-469:34\n   #13 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 49:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:32:40-47\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  /prelude/functional.fut:9:42-44\n   #9  stl.fut:38:3-84\n   #10 stl.fut:231:23-47\n   #11 stl.fut:415:61-429:75\n   #12 stl.fut:455:3-469:34\n   #13 stl.fut:439:1-469:34\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:536:27-33\n   #1  loess.fut:549:13-50\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:546:3-550:9\n   #6  stl.fut:252:23-75\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:250:15-253:43\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 51:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:537:27-37\n   #1  loess.fut:549:13-50\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:546:3-550:9\n   #6  stl.fut:252:23-75\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:250:15-253:43\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 52:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 53:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 54:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 55:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\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:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\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:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\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:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\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:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\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:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 61:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 62:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 63:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 64:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 65:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 66:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 67:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 68:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 69:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 70:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:536:27-33\n   #1  loess.fut:549:13-50\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:546:3-550:9\n   #6  stl.fut:304:23-75\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:303:15-305:43\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 71:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:537:27-37\n   #1  loess.fut:549:13-50\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:546:3-550:9\n   #6  stl.fut:304:23-75\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:303:15-305:43\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 72:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:334:21-49\n   #3  /prelude/soacs.fut:67:19-23\n   #4  /prelude/soacs.fut:67:3-37\n   #5  stl.fut:332:13-335:35\n   #6  stl.fut:415:61-429:75\n   #7  stl.fut:455:3-469:34\n   #8  stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
            
          case 73:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:334:21-49\n   #3  /prelude/soacs.fut:67:19-23\n   #4  /prelude/soacs.fut:67:3-37\n   #5  stl.fut:332:13-335:35\n   #6  stl.fut:415:61-429:75\n   #7  stl.fut:455:3-469:34\n   #8  stl.fut:439:1-469:34\n",
                              args[0], args[1]);
                break;
            }
        }
        return 1;
    }
    return 0;
}
cl_command_queue futhark_context_get_command_queue(struct futhark_context *ctx)
{
    return ctx->opencl.queue;
}
static int memblock_unref_device(struct futhark_context *ctx,
                                 struct memblock_device *block, const
                                 char *desc)
{
    if (block->references != NULL) {
        *block->references -= 1;
        if (ctx->detail_memory)
            fprintf(ctx->log,
                    "Unreferencing block %s (allocated as %s) in %s: %d references remaining.\n",
                    desc, block->desc, "space 'device'", *block->references);
        if (*block->references == 0) {
            ctx->cur_mem_usage_device -= block->size;
            OPENCL_SUCCEED_OR_RETURN(opencl_free(&ctx->opencl, block->mem,
                                                 desc));
            free(block->references);
            if (ctx->detail_memory)
                fprintf(ctx->log,
                        "%lld bytes freed (now allocated: %lld bytes)\n",
                        (long long) block->size,
                        (long long) ctx->cur_mem_usage_device);
        }
        block->references = NULL;
    }
    return 0;
}
static int memblock_alloc_device(struct futhark_context *ctx,
                                 struct memblock_device *block, int64_t size,
                                 const char *desc)
{
    if (size < 0)
        futhark_panic(1,
                      "Negative allocation of %lld bytes attempted for %s in %s.\n",
                      (long long) size, desc, "space 'device'",
                      ctx->cur_mem_usage_device);
    
    int ret = memblock_unref_device(ctx, block, desc);
    
    ctx->cur_mem_usage_device += size;
    if (ctx->detail_memory)
        fprintf(ctx->log,
                "Allocating %lld bytes for %s in %s (then allocated: %lld bytes)",
                (long long) size, desc, "space 'device'",
                (long long) ctx->cur_mem_usage_device);
    if (ctx->cur_mem_usage_device > ctx->peak_mem_usage_device) {
        ctx->peak_mem_usage_device = ctx->cur_mem_usage_device;
        if (ctx->detail_memory)
            fprintf(ctx->log, " (new peak).\n");
    } else if (ctx->detail_memory)
        fprintf(ctx->log, ".\n");
    OPENCL_SUCCEED_OR_RETURN(opencl_alloc(&ctx->opencl, (size_t) size, desc,
                                          &block->mem));
    block->references = (int *) malloc(sizeof(int));
    *block->references = 1;
    block->size = size;
    block->desc = desc;
    return ret;
}
static int memblock_set_device(struct futhark_context *ctx,
                               struct memblock_device *lhs,
                               struct memblock_device *rhs, const
                               char *lhs_desc)
{
    int ret = memblock_unref_device(ctx, lhs, lhs_desc);
    
    if (rhs->references != NULL)
        (*rhs->references)++;
    *lhs = *rhs;
    return ret;
}
static int memblock_unref(struct futhark_context *ctx, struct memblock *block,
                          const char *desc)
{
    if (block->references != NULL) {
        *block->references -= 1;
        if (ctx->detail_memory)
            fprintf(ctx->log,
                    "Unreferencing block %s (allocated as %s) in %s: %d references remaining.\n",
                    desc, block->desc, "default space", *block->references);
        if (*block->references == 0) {
            ctx->cur_mem_usage_default -= block->size;
            free(block->mem);
            free(block->references);
            if (ctx->detail_memory)
                fprintf(ctx->log,
                        "%lld bytes freed (now allocated: %lld bytes)\n",
                        (long long) block->size,
                        (long long) ctx->cur_mem_usage_default);
        }
        block->references = NULL;
    }
    return 0;
}
static int memblock_alloc(struct futhark_context *ctx, struct memblock *block,
                          int64_t size, const char *desc)
{
    if (size < 0)
        futhark_panic(1,
                      "Negative allocation of %lld bytes attempted for %s in %s.\n",
                      (long long) size, desc, "default space",
                      ctx->cur_mem_usage_default);
    
    int ret = memblock_unref(ctx, block, desc);
    
    ctx->cur_mem_usage_default += size;
    if (ctx->detail_memory)
        fprintf(ctx->log,
                "Allocating %lld bytes for %s in %s (then allocated: %lld bytes)",
                (long long) size, desc, "default space",
                (long long) ctx->cur_mem_usage_default);
    if (ctx->cur_mem_usage_default > ctx->peak_mem_usage_default) {
        ctx->peak_mem_usage_default = ctx->cur_mem_usage_default;
        if (ctx->detail_memory)
            fprintf(ctx->log, " (new peak).\n");
    } else if (ctx->detail_memory)
        fprintf(ctx->log, ".\n");
    block->mem = (unsigned char *) malloc((size_t) size);
    block->references = (int *) malloc(sizeof(int));
    *block->references = 1;
    block->size = size;
    block->desc = desc;
    return ret;
}
static int memblock_set(struct futhark_context *ctx, struct memblock *lhs,
                        struct memblock *rhs, const char *lhs_desc)
{
    int ret = memblock_unref(ctx, lhs, lhs_desc);
    
    if (rhs->references != NULL)
        (*rhs->references)++;
    *lhs = *rhs;
    return ret;
}
int futhark_get_tuning_param_count(void)
{
    return sizeof(tuning_param_names) / sizeof(tuning_param_names[0]);
}
const char *futhark_get_tuning_param_name(int i)
{
    return tuning_param_names[i];
}
const char *futhark_get_tuning_param_class(int i)
{
    return tuning_param_classes[i];
}
char *futhark_context_report(struct futhark_context *ctx)
{
    if (futhark_context_sync(ctx) != 0)
        return NULL;
    
    struct str_builder builder;
    
    str_builder_init(&builder);
    if (ctx->detail_memory || ctx->profiling || ctx->logging) {
        str_builder(&builder,
                    "Peak memory usage for space 'device': %lld bytes.\n",
                    (long long) ctx->peak_mem_usage_device);
        { }
    }
    if (ctx->profiling) {
        OPENCL_SUCCEED_FATAL(opencl_tally_profiling_records(&ctx->opencl));
        str_builder(&builder,
                    "copy_dev_to_dev                        ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->copy_dev_to_dev_runs,
                    (long) ctx->copy_dev_to_dev_total_runtime /
                    (ctx->copy_dev_to_dev_runs !=
                     0 ? ctx->copy_dev_to_dev_runs : 1),
                    (long) ctx->copy_dev_to_dev_total_runtime);
        ctx->total_runtime += ctx->copy_dev_to_dev_total_runtime;
        ctx->total_runs += ctx->copy_dev_to_dev_runs;
        str_builder(&builder,
                    "copy_dev_to_host                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->copy_dev_to_host_runs,
                    (long) ctx->copy_dev_to_host_total_runtime /
                    (ctx->copy_dev_to_host_runs !=
                     0 ? ctx->copy_dev_to_host_runs : 1),
                    (long) ctx->copy_dev_to_host_total_runtime);
        ctx->total_runtime += ctx->copy_dev_to_host_total_runtime;
        ctx->total_runs += ctx->copy_dev_to_host_runs;
        str_builder(&builder,
                    "copy_host_to_dev                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->copy_host_to_dev_runs,
                    (long) ctx->copy_host_to_dev_total_runtime /
                    (ctx->copy_host_to_dev_runs !=
                     0 ? ctx->copy_host_to_dev_runs : 1),
                    (long) ctx->copy_host_to_dev_total_runtime);
        ctx->total_runtime += ctx->copy_host_to_dev_total_runtime;
        ctx->total_runs += ctx->copy_host_to_dev_runs;
        str_builder(&builder,
                    "copy_scalar_to_dev                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->copy_scalar_to_dev_runs,
                    (long) ctx->copy_scalar_to_dev_total_runtime /
                    (ctx->copy_scalar_to_dev_runs !=
                     0 ? ctx->copy_scalar_to_dev_runs : 1),
                    (long) ctx->copy_scalar_to_dev_total_runtime);
        ctx->total_runtime += ctx->copy_scalar_to_dev_total_runtime;
        ctx->total_runs += ctx->copy_scalar_to_dev_runs;
        str_builder(&builder,
                    "copy_scalar_from_dev                   ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->copy_scalar_from_dev_runs,
                    (long) ctx->copy_scalar_from_dev_total_runtime /
                    (ctx->copy_scalar_from_dev_runs !=
                     0 ? ctx->copy_scalar_from_dev_runs : 1),
                    (long) ctx->copy_scalar_from_dev_total_runtime);
        ctx->total_runtime += ctx->copy_scalar_from_dev_total_runtime;
        ctx->total_runs += ctx->copy_scalar_from_dev_runs;
        str_builder(&builder,
                    "builtin#replicate_f64.replicate_232951 ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->builtinzhreplicate_f64zireplicate_232951_runs,
                    (long) ctx->builtinzhreplicate_f64zireplicate_232951_total_runtime /
                    (ctx->builtinzhreplicate_f64zireplicate_232951_runs !=
                     0 ? ctx->builtinzhreplicate_f64zireplicate_232951_runs : 1),
                    (long) ctx->builtinzhreplicate_f64zireplicate_232951_total_runtime);
        ctx->total_runtime +=
            ctx->builtinzhreplicate_f64zireplicate_232951_total_runtime;
        ctx->total_runs += ctx->builtinzhreplicate_f64zireplicate_232951_runs;
        str_builder(&builder,
                    "builtin#replicate_i64.replicate_232534 ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->builtinzhreplicate_i64zireplicate_232534_runs,
                    (long) ctx->builtinzhreplicate_i64zireplicate_232534_total_runtime /
                    (ctx->builtinzhreplicate_i64zireplicate_232534_runs !=
                     0 ? ctx->builtinzhreplicate_i64zireplicate_232534_runs : 1),
                    (long) ctx->builtinzhreplicate_i64zireplicate_232534_total_runtime);
        ctx->total_runtime +=
            ctx->builtinzhreplicate_i64zireplicate_232534_total_runtime;
        ctx->total_runs += ctx->builtinzhreplicate_i64zireplicate_232534_runs;
        str_builder(&builder,
                    "gpu_map_transpose_f64                  ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->gpu_map_transpose_f64_runs,
                    (long) ctx->gpu_map_transpose_f64_total_runtime /
                    (ctx->gpu_map_transpose_f64_runs !=
                     0 ? ctx->gpu_map_transpose_f64_runs : 1),
                    (long) ctx->gpu_map_transpose_f64_total_runtime);
        ctx->total_runtime += ctx->gpu_map_transpose_f64_total_runtime;
        ctx->total_runs += ctx->gpu_map_transpose_f64_runs;
        str_builder(&builder,
                    "gpu_map_transpose_f64_low_height       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->gpu_map_transpose_f64_low_height_runs,
                    (long) ctx->gpu_map_transpose_f64_low_height_total_runtime /
                    (ctx->gpu_map_transpose_f64_low_height_runs !=
                     0 ? ctx->gpu_map_transpose_f64_low_height_runs : 1),
                    (long) ctx->gpu_map_transpose_f64_low_height_total_runtime);
        ctx->total_runtime +=
            ctx->gpu_map_transpose_f64_low_height_total_runtime;
        ctx->total_runs += ctx->gpu_map_transpose_f64_low_height_runs;
        str_builder(&builder,
                    "gpu_map_transpose_f64_low_width        ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->gpu_map_transpose_f64_low_width_runs,
                    (long) ctx->gpu_map_transpose_f64_low_width_total_runtime /
                    (ctx->gpu_map_transpose_f64_low_width_runs !=
                     0 ? ctx->gpu_map_transpose_f64_low_width_runs : 1),
                    (long) ctx->gpu_map_transpose_f64_low_width_total_runtime);
        ctx->total_runtime +=
            ctx->gpu_map_transpose_f64_low_width_total_runtime;
        ctx->total_runs += ctx->gpu_map_transpose_f64_low_width_runs;
        str_builder(&builder,
                    "gpu_map_transpose_f64_small            ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->gpu_map_transpose_f64_small_runs,
                    (long) ctx->gpu_map_transpose_f64_small_total_runtime /
                    (ctx->gpu_map_transpose_f64_small_runs !=
                     0 ? ctx->gpu_map_transpose_f64_small_runs : 1),
                    (long) ctx->gpu_map_transpose_f64_small_total_runtime);
        ctx->total_runtime += ctx->gpu_map_transpose_f64_small_total_runtime;
        ctx->total_runs += ctx->gpu_map_transpose_f64_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_232552                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_232552_runs,
                    (long) ctx->mainzicopy_232552_total_runtime /
                    (ctx->mainzicopy_232552_runs !=
                     0 ? ctx->mainzicopy_232552_runs : 1),
                    (long) ctx->mainzicopy_232552_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_232552_total_runtime;
        ctx->total_runs += ctx->mainzicopy_232552_runs;
        str_builder(&builder,
                    "main.copy_232711                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_232711_runs,
                    (long) ctx->mainzicopy_232711_total_runtime /
                    (ctx->mainzicopy_232711_runs !=
                     0 ? ctx->mainzicopy_232711_runs : 1),
                    (long) ctx->mainzicopy_232711_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_232711_total_runtime;
        ctx->total_runs += ctx->mainzicopy_232711_runs;
        str_builder(&builder,
                    "main.copy_234634                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_234634_runs,
                    (long) ctx->mainzicopy_234634_total_runtime /
                    (ctx->mainzicopy_234634_runs !=
                     0 ? ctx->mainzicopy_234634_runs : 1),
                    (long) ctx->mainzicopy_234634_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_234634_total_runtime;
        ctx->total_runs += ctx->mainzicopy_234634_runs;
        str_builder(&builder,
                    "main.copy_234833                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_234833_runs,
                    (long) ctx->mainzicopy_234833_total_runtime /
                    (ctx->mainzicopy_234833_runs !=
                     0 ? ctx->mainzicopy_234833_runs : 1),
                    (long) ctx->mainzicopy_234833_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_234833_total_runtime;
        ctx->total_runs += ctx->mainzicopy_234833_runs;
        str_builder(&builder,
                    "main.copy_235083                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_235083_runs,
                    (long) ctx->mainzicopy_235083_total_runtime /
                    (ctx->mainzicopy_235083_runs !=
                     0 ? ctx->mainzicopy_235083_runs : 1),
                    (long) ctx->mainzicopy_235083_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_235083_total_runtime;
        ctx->total_runs += ctx->mainzicopy_235083_runs;
        str_builder(&builder,
                    "main.copy_235461                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_235461_runs,
                    (long) ctx->mainzicopy_235461_total_runtime /
                    (ctx->mainzicopy_235461_runs !=
                     0 ? ctx->mainzicopy_235461_runs : 1),
                    (long) ctx->mainzicopy_235461_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_235461_total_runtime;
        ctx->total_runs += ctx->mainzicopy_235461_runs;
        str_builder(&builder,
                    "main.copy_235683                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_235683_runs,
                    (long) ctx->mainzicopy_235683_total_runtime /
                    (ctx->mainzicopy_235683_runs !=
                     0 ? ctx->mainzicopy_235683_runs : 1),
                    (long) ctx->mainzicopy_235683_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_235683_total_runtime;
        ctx->total_runs += ctx->mainzicopy_235683_runs;
        str_builder(&builder,
                    "main.copy_235956                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_235956_runs,
                    (long) ctx->mainzicopy_235956_total_runtime /
                    (ctx->mainzicopy_235956_runs !=
                     0 ? ctx->mainzicopy_235956_runs : 1),
                    (long) ctx->mainzicopy_235956_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_235956_total_runtime;
        ctx->total_runs += ctx->mainzicopy_235956_runs;
        str_builder(&builder,
                    "main.scan_stage1_206957                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage1_206957_runs,
                    (long) ctx->mainziscan_stage1_206957_total_runtime /
                    (ctx->mainziscan_stage1_206957_runs !=
                     0 ? ctx->mainziscan_stage1_206957_runs : 1),
                    (long) ctx->mainziscan_stage1_206957_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage1_206957_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage1_206957_runs;
        str_builder(&builder,
                    "main.scan_stage1_207097                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage1_207097_runs,
                    (long) ctx->mainziscan_stage1_207097_total_runtime /
                    (ctx->mainziscan_stage1_207097_runs !=
                     0 ? ctx->mainziscan_stage1_207097_runs : 1),
                    (long) ctx->mainziscan_stage1_207097_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage1_207097_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage1_207097_runs;
        str_builder(&builder,
                    "main.scan_stage1_207649                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage1_207649_runs,
                    (long) ctx->mainziscan_stage1_207649_total_runtime /
                    (ctx->mainziscan_stage1_207649_runs !=
                     0 ? ctx->mainziscan_stage1_207649_runs : 1),
                    (long) ctx->mainziscan_stage1_207649_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage1_207649_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage1_207649_runs;
        str_builder(&builder,
                    "main.scan_stage1_218773                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage1_218773_runs,
                    (long) ctx->mainziscan_stage1_218773_total_runtime /
                    (ctx->mainziscan_stage1_218773_runs !=
                     0 ? ctx->mainziscan_stage1_218773_runs : 1),
                    (long) ctx->mainziscan_stage1_218773_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage1_218773_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage1_218773_runs;
        str_builder(&builder,
                    "main.scan_stage1_218904                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage1_218904_runs,
                    (long) ctx->mainziscan_stage1_218904_total_runtime /
                    (ctx->mainziscan_stage1_218904_runs !=
                     0 ? ctx->mainziscan_stage1_218904_runs : 1),
                    (long) ctx->mainziscan_stage1_218904_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage1_218904_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage1_218904_runs;
        str_builder(&builder,
                    "main.scan_stage1_219035                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage1_219035_runs,
                    (long) ctx->mainziscan_stage1_219035_total_runtime /
                    (ctx->mainziscan_stage1_219035_runs !=
                     0 ? ctx->mainziscan_stage1_219035_runs : 1),
                    (long) ctx->mainziscan_stage1_219035_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage1_219035_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage1_219035_runs;
        str_builder(&builder,
                    "main.scan_stage1_228005                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage1_228005_runs,
                    (long) ctx->mainziscan_stage1_228005_total_runtime /
                    (ctx->mainziscan_stage1_228005_runs !=
                     0 ? ctx->mainziscan_stage1_228005_runs : 1),
                    (long) ctx->mainziscan_stage1_228005_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage1_228005_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage1_228005_runs;
        str_builder(&builder,
                    "main.scan_stage2_206957                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage2_206957_runs,
                    (long) ctx->mainziscan_stage2_206957_total_runtime /
                    (ctx->mainziscan_stage2_206957_runs !=
                     0 ? ctx->mainziscan_stage2_206957_runs : 1),
                    (long) ctx->mainziscan_stage2_206957_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage2_206957_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage2_206957_runs;
        str_builder(&builder,
                    "main.scan_stage2_207097                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage2_207097_runs,
                    (long) ctx->mainziscan_stage2_207097_total_runtime /
                    (ctx->mainziscan_stage2_207097_runs !=
                     0 ? ctx->mainziscan_stage2_207097_runs : 1),
                    (long) ctx->mainziscan_stage2_207097_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage2_207097_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage2_207097_runs;
        str_builder(&builder,
                    "main.scan_stage2_207649                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage2_207649_runs,
                    (long) ctx->mainziscan_stage2_207649_total_runtime /
                    (ctx->mainziscan_stage2_207649_runs !=
                     0 ? ctx->mainziscan_stage2_207649_runs : 1),
                    (long) ctx->mainziscan_stage2_207649_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage2_207649_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage2_207649_runs;
        str_builder(&builder,
                    "main.scan_stage2_218773                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage2_218773_runs,
                    (long) ctx->mainziscan_stage2_218773_total_runtime /
                    (ctx->mainziscan_stage2_218773_runs !=
                     0 ? ctx->mainziscan_stage2_218773_runs : 1),
                    (long) ctx->mainziscan_stage2_218773_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage2_218773_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage2_218773_runs;
        str_builder(&builder,
                    "main.scan_stage2_218904                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage2_218904_runs,
                    (long) ctx->mainziscan_stage2_218904_total_runtime /
                    (ctx->mainziscan_stage2_218904_runs !=
                     0 ? ctx->mainziscan_stage2_218904_runs : 1),
                    (long) ctx->mainziscan_stage2_218904_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage2_218904_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage2_218904_runs;
        str_builder(&builder,
                    "main.scan_stage2_219035                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage2_219035_runs,
                    (long) ctx->mainziscan_stage2_219035_total_runtime /
                    (ctx->mainziscan_stage2_219035_runs !=
                     0 ? ctx->mainziscan_stage2_219035_runs : 1),
                    (long) ctx->mainziscan_stage2_219035_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage2_219035_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage2_219035_runs;
        str_builder(&builder,
                    "main.scan_stage2_228005                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage2_228005_runs,
                    (long) ctx->mainziscan_stage2_228005_total_runtime /
                    (ctx->mainziscan_stage2_228005_runs !=
                     0 ? ctx->mainziscan_stage2_228005_runs : 1),
                    (long) ctx->mainziscan_stage2_228005_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage2_228005_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage2_228005_runs;
        str_builder(&builder,
                    "main.scan_stage3_206957                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage3_206957_runs,
                    (long) ctx->mainziscan_stage3_206957_total_runtime /
                    (ctx->mainziscan_stage3_206957_runs !=
                     0 ? ctx->mainziscan_stage3_206957_runs : 1),
                    (long) ctx->mainziscan_stage3_206957_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage3_206957_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage3_206957_runs;
        str_builder(&builder,
                    "main.scan_stage3_207097                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage3_207097_runs,
                    (long) ctx->mainziscan_stage3_207097_total_runtime /
                    (ctx->mainziscan_stage3_207097_runs !=
                     0 ? ctx->mainziscan_stage3_207097_runs : 1),
                    (long) ctx->mainziscan_stage3_207097_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage3_207097_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage3_207097_runs;
        str_builder(&builder,
                    "main.scan_stage3_207649                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage3_207649_runs,
                    (long) ctx->mainziscan_stage3_207649_total_runtime /
                    (ctx->mainziscan_stage3_207649_runs !=
                     0 ? ctx->mainziscan_stage3_207649_runs : 1),
                    (long) ctx->mainziscan_stage3_207649_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage3_207649_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage3_207649_runs;
        str_builder(&builder,
                    "main.scan_stage3_218773                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage3_218773_runs,
                    (long) ctx->mainziscan_stage3_218773_total_runtime /
                    (ctx->mainziscan_stage3_218773_runs !=
                     0 ? ctx->mainziscan_stage3_218773_runs : 1),
                    (long) ctx->mainziscan_stage3_218773_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage3_218773_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage3_218773_runs;
        str_builder(&builder,
                    "main.scan_stage3_218904                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage3_218904_runs,
                    (long) ctx->mainziscan_stage3_218904_total_runtime /
                    (ctx->mainziscan_stage3_218904_runs !=
                     0 ? ctx->mainziscan_stage3_218904_runs : 1),
                    (long) ctx->mainziscan_stage3_218904_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage3_218904_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage3_218904_runs;
        str_builder(&builder,
                    "main.scan_stage3_219035                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage3_219035_runs,
                    (long) ctx->mainziscan_stage3_219035_total_runtime /
                    (ctx->mainziscan_stage3_219035_runs !=
                     0 ? ctx->mainziscan_stage3_219035_runs : 1),
                    (long) ctx->mainziscan_stage3_219035_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage3_219035_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage3_219035_runs;
        str_builder(&builder,
                    "main.scan_stage3_228005                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage3_228005_runs,
                    (long) ctx->mainziscan_stage3_228005_total_runtime /
                    (ctx->mainziscan_stage3_228005_runs !=
                     0 ? ctx->mainziscan_stage3_228005_runs : 1),
                    (long) ctx->mainziscan_stage3_228005_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage3_228005_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage3_228005_runs;
        str_builder(&builder,
                    "main.segmap_206959                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_206959_runs,
                    (long) ctx->mainzisegmap_206959_total_runtime /
                    (ctx->mainzisegmap_206959_runs !=
                     0 ? ctx->mainzisegmap_206959_runs : 1),
                    (long) ctx->mainzisegmap_206959_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_206959_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_206959_runs;
        str_builder(&builder,
                    "main.segmap_207135                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_207135_runs,
                    (long) ctx->mainzisegmap_207135_total_runtime /
                    (ctx->mainzisegmap_207135_runs !=
                     0 ? ctx->mainzisegmap_207135_runs : 1),
                    (long) ctx->mainzisegmap_207135_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_207135_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_207135_runs;
        str_builder(&builder,
                    "main.segmap_207260                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_207260_runs,
                    (long) ctx->mainzisegmap_207260_total_runtime /
                    (ctx->mainzisegmap_207260_runs !=
                     0 ? ctx->mainzisegmap_207260_runs : 1),
                    (long) ctx->mainzisegmap_207260_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_207260_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_207260_runs;
        str_builder(&builder,
                    "main.segmap_207695                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_207695_runs,
                    (long) ctx->mainzisegmap_207695_total_runtime /
                    (ctx->mainzisegmap_207695_runs !=
                     0 ? ctx->mainzisegmap_207695_runs : 1),
                    (long) ctx->mainzisegmap_207695_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_207695_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_207695_runs;
        str_builder(&builder,
                    "main.segmap_208908                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_208908_runs,
                    (long) ctx->mainzisegmap_208908_total_runtime /
                    (ctx->mainzisegmap_208908_runs !=
                     0 ? ctx->mainzisegmap_208908_runs : 1),
                    (long) ctx->mainzisegmap_208908_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_208908_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_208908_runs;
        str_builder(&builder,
                    "main.segmap_208922                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_208922_runs,
                    (long) ctx->mainzisegmap_208922_total_runtime /
                    (ctx->mainzisegmap_208922_runs !=
                     0 ? ctx->mainzisegmap_208922_runs : 1),
                    (long) ctx->mainzisegmap_208922_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_208922_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_208922_runs;
        str_builder(&builder,
                    "main.segmap_208946                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_208946_runs,
                    (long) ctx->mainzisegmap_208946_total_runtime /
                    (ctx->mainzisegmap_208946_runs !=
                     0 ? ctx->mainzisegmap_208946_runs : 1),
                    (long) ctx->mainzisegmap_208946_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_208946_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_208946_runs;
        str_builder(&builder,
                    "main.segmap_209556                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_209556_runs,
                    (long) ctx->mainzisegmap_209556_total_runtime /
                    (ctx->mainzisegmap_209556_runs !=
                     0 ? ctx->mainzisegmap_209556_runs : 1),
                    (long) ctx->mainzisegmap_209556_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_209556_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_209556_runs;
        str_builder(&builder,
                    "main.segmap_209568                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_209568_runs,
                    (long) ctx->mainzisegmap_209568_total_runtime /
                    (ctx->mainzisegmap_209568_runs !=
                     0 ? ctx->mainzisegmap_209568_runs : 1),
                    (long) ctx->mainzisegmap_209568_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_209568_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_209568_runs;
        str_builder(&builder,
                    "main.segmap_209589                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_209589_runs,
                    (long) ctx->mainzisegmap_209589_total_runtime /
                    (ctx->mainzisegmap_209589_runs !=
                     0 ? ctx->mainzisegmap_209589_runs : 1),
                    (long) ctx->mainzisegmap_209589_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_209589_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_209589_runs;
        str_builder(&builder,
                    "main.segmap_210182                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_210182_runs,
                    (long) ctx->mainzisegmap_210182_total_runtime /
                    (ctx->mainzisegmap_210182_runs !=
                     0 ? ctx->mainzisegmap_210182_runs : 1),
                    (long) ctx->mainzisegmap_210182_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_210182_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_210182_runs;
        str_builder(&builder,
                    "main.segmap_210194                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_210194_runs,
                    (long) ctx->mainzisegmap_210194_total_runtime /
                    (ctx->mainzisegmap_210194_runs !=
                     0 ? ctx->mainzisegmap_210194_runs : 1),
                    (long) ctx->mainzisegmap_210194_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_210194_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_210194_runs;
        str_builder(&builder,
                    "main.segmap_210215                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_210215_runs,
                    (long) ctx->mainzisegmap_210215_total_runtime /
                    (ctx->mainzisegmap_210215_runs !=
                     0 ? ctx->mainzisegmap_210215_runs : 1),
                    (long) ctx->mainzisegmap_210215_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_210215_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_210215_runs;
        str_builder(&builder,
                    "main.segmap_210357                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_210357_runs,
                    (long) ctx->mainzisegmap_210357_total_runtime /
                    (ctx->mainzisegmap_210357_runs !=
                     0 ? ctx->mainzisegmap_210357_runs : 1),
                    (long) ctx->mainzisegmap_210357_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_210357_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_210357_runs;
        str_builder(&builder,
                    "main.segmap_210502                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_210502_runs,
                    (long) ctx->mainzisegmap_210502_total_runtime /
                    (ctx->mainzisegmap_210502_runs !=
                     0 ? ctx->mainzisegmap_210502_runs : 1),
                    (long) ctx->mainzisegmap_210502_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_210502_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_210502_runs;
        str_builder(&builder,
                    "main.segmap_210632                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_210632_runs,
                    (long) ctx->mainzisegmap_210632_total_runtime /
                    (ctx->mainzisegmap_210632_runs !=
                     0 ? ctx->mainzisegmap_210632_runs : 1),
                    (long) ctx->mainzisegmap_210632_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_210632_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_210632_runs;
        str_builder(&builder,
                    "main.segmap_211772                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_211772_runs,
                    (long) ctx->mainzisegmap_211772_total_runtime /
                    (ctx->mainzisegmap_211772_runs !=
                     0 ? ctx->mainzisegmap_211772_runs : 1),
                    (long) ctx->mainzisegmap_211772_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_211772_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_211772_runs;
        str_builder(&builder,
                    "main.segmap_211980                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_211980_runs,
                    (long) ctx->mainzisegmap_211980_total_runtime /
                    (ctx->mainzisegmap_211980_runs !=
                     0 ? ctx->mainzisegmap_211980_runs : 1),
                    (long) ctx->mainzisegmap_211980_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_211980_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_211980_runs;
        str_builder(&builder,
                    "main.segmap_212069                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_212069_runs,
                    (long) ctx->mainzisegmap_212069_total_runtime /
                    (ctx->mainzisegmap_212069_runs !=
                     0 ? ctx->mainzisegmap_212069_runs : 1),
                    (long) ctx->mainzisegmap_212069_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_212069_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_212069_runs;
        str_builder(&builder,
                    "main.segmap_212141                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_212141_runs,
                    (long) ctx->mainzisegmap_212141_total_runtime /
                    (ctx->mainzisegmap_212141_runs !=
                     0 ? ctx->mainzisegmap_212141_runs : 1),
                    (long) ctx->mainzisegmap_212141_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_212141_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_212141_runs;
        str_builder(&builder,
                    "main.segmap_212355                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_212355_runs,
                    (long) ctx->mainzisegmap_212355_total_runtime /
                    (ctx->mainzisegmap_212355_runs !=
                     0 ? ctx->mainzisegmap_212355_runs : 1),
                    (long) ctx->mainzisegmap_212355_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_212355_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_212355_runs;
        str_builder(&builder,
                    "main.segmap_213809                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_213809_runs,
                    (long) ctx->mainzisegmap_213809_total_runtime /
                    (ctx->mainzisegmap_213809_runs !=
                     0 ? ctx->mainzisegmap_213809_runs : 1),
                    (long) ctx->mainzisegmap_213809_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_213809_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_213809_runs;
        str_builder(&builder,
                    "main.segmap_214084                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_214084_runs,
                    (long) ctx->mainzisegmap_214084_total_runtime /
                    (ctx->mainzisegmap_214084_runs !=
                     0 ? ctx->mainzisegmap_214084_runs : 1),
                    (long) ctx->mainzisegmap_214084_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_214084_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_214084_runs;
        str_builder(&builder,
                    "main.segmap_214201                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_214201_runs,
                    (long) ctx->mainzisegmap_214201_total_runtime /
                    (ctx->mainzisegmap_214201_runs !=
                     0 ? ctx->mainzisegmap_214201_runs : 1),
                    (long) ctx->mainzisegmap_214201_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_214201_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_214201_runs;
        str_builder(&builder,
                    "main.segmap_214285                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_214285_runs,
                    (long) ctx->mainzisegmap_214285_total_runtime /
                    (ctx->mainzisegmap_214285_runs !=
                     0 ? ctx->mainzisegmap_214285_runs : 1),
                    (long) ctx->mainzisegmap_214285_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_214285_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_214285_runs;
        str_builder(&builder,
                    "main.segmap_214560                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_214560_runs,
                    (long) ctx->mainzisegmap_214560_total_runtime /
                    (ctx->mainzisegmap_214560_runs !=
                     0 ? ctx->mainzisegmap_214560_runs : 1),
                    (long) ctx->mainzisegmap_214560_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_214560_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_214560_runs;
        str_builder(&builder,
                    "main.segmap_216352                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_216352_runs,
                    (long) ctx->mainzisegmap_216352_total_runtime /
                    (ctx->mainzisegmap_216352_runs !=
                     0 ? ctx->mainzisegmap_216352_runs : 1),
                    (long) ctx->mainzisegmap_216352_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_216352_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_216352_runs;
        str_builder(&builder,
                    "main.segmap_216697                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_216697_runs,
                    (long) ctx->mainzisegmap_216697_total_runtime /
                    (ctx->mainzisegmap_216697_runs !=
                     0 ? ctx->mainzisegmap_216697_runs : 1),
                    (long) ctx->mainzisegmap_216697_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_216697_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_216697_runs;
        str_builder(&builder,
                    "main.segmap_216846                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_216846_runs,
                    (long) ctx->mainzisegmap_216846_total_runtime /
                    (ctx->mainzisegmap_216846_runs !=
                     0 ? ctx->mainzisegmap_216846_runs : 1),
                    (long) ctx->mainzisegmap_216846_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_216846_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_216846_runs;
        str_builder(&builder,
                    "main.segmap_216942                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_216942_runs,
                    (long) ctx->mainzisegmap_216942_total_runtime /
                    (ctx->mainzisegmap_216942_runs !=
                     0 ? ctx->mainzisegmap_216942_runs : 1),
                    (long) ctx->mainzisegmap_216942_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_216942_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_216942_runs;
        str_builder(&builder,
                    "main.segmap_218503                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_218503_runs,
                    (long) ctx->mainzisegmap_218503_total_runtime /
                    (ctx->mainzisegmap_218503_runs !=
                     0 ? ctx->mainzisegmap_218503_runs : 1),
                    (long) ctx->mainzisegmap_218503_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_218503_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_218503_runs;
        str_builder(&builder,
                    "main.segmap_218652                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_218652_runs,
                    (long) ctx->mainzisegmap_218652_total_runtime /
                    (ctx->mainzisegmap_218652_runs !=
                     0 ? ctx->mainzisegmap_218652_runs : 1),
                    (long) ctx->mainzisegmap_218652_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_218652_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_218652_runs;
        str_builder(&builder,
                    "main.segmap_218688                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_218688_runs,
                    (long) ctx->mainzisegmap_218688_total_runtime /
                    (ctx->mainzisegmap_218688_runs !=
                     0 ? ctx->mainzisegmap_218688_runs : 1),
                    (long) ctx->mainzisegmap_218688_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_218688_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_218688_runs;
        str_builder(&builder,
                    "main.segmap_218819                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_218819_runs,
                    (long) ctx->mainzisegmap_218819_total_runtime /
                    (ctx->mainzisegmap_218819_runs !=
                     0 ? ctx->mainzisegmap_218819_runs : 1),
                    (long) ctx->mainzisegmap_218819_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_218819_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_218819_runs;
        str_builder(&builder,
                    "main.segmap_218950                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_218950_runs,
                    (long) ctx->mainzisegmap_218950_total_runtime /
                    (ctx->mainzisegmap_218950_runs !=
                     0 ? ctx->mainzisegmap_218950_runs : 1),
                    (long) ctx->mainzisegmap_218950_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_218950_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_218950_runs;
        str_builder(&builder,
                    "main.segmap_219139                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_219139_runs,
                    (long) ctx->mainzisegmap_219139_total_runtime /
                    (ctx->mainzisegmap_219139_runs !=
                     0 ? ctx->mainzisegmap_219139_runs : 1),
                    (long) ctx->mainzisegmap_219139_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_219139_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_219139_runs;
        str_builder(&builder,
                    "main.segmap_219524                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_219524_runs,
                    (long) ctx->mainzisegmap_219524_total_runtime /
                    (ctx->mainzisegmap_219524_runs !=
                     0 ? ctx->mainzisegmap_219524_runs : 1),
                    (long) ctx->mainzisegmap_219524_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_219524_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_219524_runs;
        str_builder(&builder,
                    "main.segmap_219641                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_219641_runs,
                    (long) ctx->mainzisegmap_219641_total_runtime /
                    (ctx->mainzisegmap_219641_runs !=
                     0 ? ctx->mainzisegmap_219641_runs : 1),
                    (long) ctx->mainzisegmap_219641_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_219641_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_219641_runs;
        str_builder(&builder,
                    "main.segmap_219802                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_219802_runs,
                    (long) ctx->mainzisegmap_219802_total_runtime /
                    (ctx->mainzisegmap_219802_runs !=
                     0 ? ctx->mainzisegmap_219802_runs : 1),
                    (long) ctx->mainzisegmap_219802_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_219802_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_219802_runs;
        str_builder(&builder,
                    "main.segmap_220323                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_220323_runs,
                    (long) ctx->mainzisegmap_220323_total_runtime /
                    (ctx->mainzisegmap_220323_runs !=
                     0 ? ctx->mainzisegmap_220323_runs : 1),
                    (long) ctx->mainzisegmap_220323_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_220323_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_220323_runs;
        str_builder(&builder,
                    "main.segmap_220480                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_220480_runs,
                    (long) ctx->mainzisegmap_220480_total_runtime /
                    (ctx->mainzisegmap_220480_runs !=
                     0 ? ctx->mainzisegmap_220480_runs : 1),
                    (long) ctx->mainzisegmap_220480_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_220480_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_220480_runs;
        str_builder(&builder,
                    "main.segmap_220699                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_220699_runs,
                    (long) ctx->mainzisegmap_220699_total_runtime /
                    (ctx->mainzisegmap_220699_runs !=
                     0 ? ctx->mainzisegmap_220699_runs : 1),
                    (long) ctx->mainzisegmap_220699_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_220699_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_220699_runs;
        str_builder(&builder,
                    "main.segmap_221368                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_221368_runs,
                    (long) ctx->mainzisegmap_221368_total_runtime /
                    (ctx->mainzisegmap_221368_runs !=
                     0 ? ctx->mainzisegmap_221368_runs : 1),
                    (long) ctx->mainzisegmap_221368_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_221368_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_221368_runs;
        str_builder(&builder,
                    "main.segmap_221569                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_221569_runs,
                    (long) ctx->mainzisegmap_221569_total_runtime /
                    (ctx->mainzisegmap_221569_runs !=
                     0 ? ctx->mainzisegmap_221569_runs : 1),
                    (long) ctx->mainzisegmap_221569_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_221569_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_221569_runs;
        str_builder(&builder,
                    "main.segmap_222439                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_222439_runs,
                    (long) ctx->mainzisegmap_222439_total_runtime /
                    (ctx->mainzisegmap_222439_runs !=
                     0 ? ctx->mainzisegmap_222439_runs : 1),
                    (long) ctx->mainzisegmap_222439_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_222439_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_222439_runs;
        str_builder(&builder,
                    "main.segmap_222534                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_222534_runs,
                    (long) ctx->mainzisegmap_222534_total_runtime /
                    (ctx->mainzisegmap_222534_runs !=
                     0 ? ctx->mainzisegmap_222534_runs : 1),
                    (long) ctx->mainzisegmap_222534_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_222534_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_222534_runs;
        str_builder(&builder,
                    "main.segmap_222641                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_222641_runs,
                    (long) ctx->mainzisegmap_222641_total_runtime /
                    (ctx->mainzisegmap_222641_runs !=
                     0 ? ctx->mainzisegmap_222641_runs : 1),
                    (long) ctx->mainzisegmap_222641_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_222641_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_222641_runs;
        str_builder(&builder,
                    "main.segmap_223157                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_223157_runs,
                    (long) ctx->mainzisegmap_223157_total_runtime /
                    (ctx->mainzisegmap_223157_runs !=
                     0 ? ctx->mainzisegmap_223157_runs : 1),
                    (long) ctx->mainzisegmap_223157_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_223157_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_223157_runs;
        str_builder(&builder,
                    "main.segmap_223174                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_223174_runs,
                    (long) ctx->mainzisegmap_223174_total_runtime /
                    (ctx->mainzisegmap_223174_runs !=
                     0 ? ctx->mainzisegmap_223174_runs : 1),
                    (long) ctx->mainzisegmap_223174_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_223174_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_223174_runs;
        str_builder(&builder,
                    "main.segmap_223202                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_223202_runs,
                    (long) ctx->mainzisegmap_223202_total_runtime /
                    (ctx->mainzisegmap_223202_runs !=
                     0 ? ctx->mainzisegmap_223202_runs : 1),
                    (long) ctx->mainzisegmap_223202_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_223202_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_223202_runs;
        str_builder(&builder,
                    "main.segmap_223326                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_223326_runs,
                    (long) ctx->mainzisegmap_223326_total_runtime /
                    (ctx->mainzisegmap_223326_runs !=
                     0 ? ctx->mainzisegmap_223326_runs : 1),
                    (long) ctx->mainzisegmap_223326_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_223326_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_223326_runs;
        str_builder(&builder,
                    "main.segmap_223513                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_223513_runs,
                    (long) ctx->mainzisegmap_223513_total_runtime /
                    (ctx->mainzisegmap_223513_runs !=
                     0 ? ctx->mainzisegmap_223513_runs : 1),
                    (long) ctx->mainzisegmap_223513_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_223513_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_223513_runs;
        str_builder(&builder,
                    "main.segmap_224163                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_224163_runs,
                    (long) ctx->mainzisegmap_224163_total_runtime /
                    (ctx->mainzisegmap_224163_runs !=
                     0 ? ctx->mainzisegmap_224163_runs : 1),
                    (long) ctx->mainzisegmap_224163_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_224163_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_224163_runs;
        str_builder(&builder,
                    "main.segmap_224180                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_224180_runs,
                    (long) ctx->mainzisegmap_224180_total_runtime /
                    (ctx->mainzisegmap_224180_runs !=
                     0 ? ctx->mainzisegmap_224180_runs : 1),
                    (long) ctx->mainzisegmap_224180_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_224180_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_224180_runs;
        str_builder(&builder,
                    "main.segmap_224210                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_224210_runs,
                    (long) ctx->mainzisegmap_224210_total_runtime /
                    (ctx->mainzisegmap_224210_runs !=
                     0 ? ctx->mainzisegmap_224210_runs : 1),
                    (long) ctx->mainzisegmap_224210_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_224210_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_224210_runs;
        str_builder(&builder,
                    "main.segmap_224374                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_224374_runs,
                    (long) ctx->mainzisegmap_224374_total_runtime /
                    (ctx->mainzisegmap_224374_runs !=
                     0 ? ctx->mainzisegmap_224374_runs : 1),
                    (long) ctx->mainzisegmap_224374_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_224374_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_224374_runs;
        str_builder(&builder,
                    "main.segmap_224619                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_224619_runs,
                    (long) ctx->mainzisegmap_224619_total_runtime /
                    (ctx->mainzisegmap_224619_runs !=
                     0 ? ctx->mainzisegmap_224619_runs : 1),
                    (long) ctx->mainzisegmap_224619_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_224619_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_224619_runs;
        str_builder(&builder,
                    "main.segmap_225417                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_225417_runs,
                    (long) ctx->mainzisegmap_225417_total_runtime /
                    (ctx->mainzisegmap_225417_runs !=
                     0 ? ctx->mainzisegmap_225417_runs : 1),
                    (long) ctx->mainzisegmap_225417_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_225417_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_225417_runs;
        str_builder(&builder,
                    "main.segmap_225434                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_225434_runs,
                    (long) ctx->mainzisegmap_225434_total_runtime /
                    (ctx->mainzisegmap_225434_runs !=
                     0 ? ctx->mainzisegmap_225434_runs : 1),
                    (long) ctx->mainzisegmap_225434_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_225434_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_225434_runs;
        str_builder(&builder,
                    "main.segmap_225464                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_225464_runs,
                    (long) ctx->mainzisegmap_225464_total_runtime /
                    (ctx->mainzisegmap_225464_runs !=
                     0 ? ctx->mainzisegmap_225464_runs : 1),
                    (long) ctx->mainzisegmap_225464_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_225464_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_225464_runs;
        str_builder(&builder,
                    "main.segmap_225672                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_225672_runs,
                    (long) ctx->mainzisegmap_225672_total_runtime /
                    (ctx->mainzisegmap_225672_runs !=
                     0 ? ctx->mainzisegmap_225672_runs : 1),
                    (long) ctx->mainzisegmap_225672_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_225672_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_225672_runs;
        str_builder(&builder,
                    "main.segmap_225963                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_225963_runs,
                    (long) ctx->mainzisegmap_225963_total_runtime /
                    (ctx->mainzisegmap_225963_runs !=
                     0 ? ctx->mainzisegmap_225963_runs : 1),
                    (long) ctx->mainzisegmap_225963_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_225963_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_225963_runs;
        str_builder(&builder,
                    "main.segmap_225980                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_225980_runs,
                    (long) ctx->mainzisegmap_225980_total_runtime /
                    (ctx->mainzisegmap_225980_runs !=
                     0 ? ctx->mainzisegmap_225980_runs : 1),
                    (long) ctx->mainzisegmap_225980_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_225980_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_225980_runs;
        str_builder(&builder,
                    "main.segmap_226275                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_226275_runs,
                    (long) ctx->mainzisegmap_226275_total_runtime /
                    (ctx->mainzisegmap_226275_runs !=
                     0 ? ctx->mainzisegmap_226275_runs : 1),
                    (long) ctx->mainzisegmap_226275_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_226275_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_226275_runs;
        str_builder(&builder,
                    "main.segmap_226292                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_226292_runs,
                    (long) ctx->mainzisegmap_226292_total_runtime /
                    (ctx->mainzisegmap_226292_runs !=
                     0 ? ctx->mainzisegmap_226292_runs : 1),
                    (long) ctx->mainzisegmap_226292_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_226292_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_226292_runs;
        str_builder(&builder,
                    "main.segmap_226679                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_226679_runs,
                    (long) ctx->mainzisegmap_226679_total_runtime /
                    (ctx->mainzisegmap_226679_runs !=
                     0 ? ctx->mainzisegmap_226679_runs : 1),
                    (long) ctx->mainzisegmap_226679_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_226679_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_226679_runs;
        str_builder(&builder,
                    "main.segmap_226696                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_226696_runs,
                    (long) ctx->mainzisegmap_226696_total_runtime /
                    (ctx->mainzisegmap_226696_runs !=
                     0 ? ctx->mainzisegmap_226696_runs : 1),
                    (long) ctx->mainzisegmap_226696_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_226696_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_226696_runs;
        str_builder(&builder,
                    "main.segmap_226984                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_226984_runs,
                    (long) ctx->mainzisegmap_226984_total_runtime /
                    (ctx->mainzisegmap_226984_runs !=
                     0 ? ctx->mainzisegmap_226984_runs : 1),
                    (long) ctx->mainzisegmap_226984_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_226984_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_226984_runs;
        str_builder(&builder,
                    "main.segmap_227201                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_227201_runs,
                    (long) ctx->mainzisegmap_227201_total_runtime /
                    (ctx->mainzisegmap_227201_runs !=
                     0 ? ctx->mainzisegmap_227201_runs : 1),
                    (long) ctx->mainzisegmap_227201_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_227201_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_227201_runs;
        str_builder(&builder,
                    "main.segmap_227222                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_227222_runs,
                    (long) ctx->mainzisegmap_227222_total_runtime /
                    (ctx->mainzisegmap_227222_runs !=
                     0 ? ctx->mainzisegmap_227222_runs : 1),
                    (long) ctx->mainzisegmap_227222_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_227222_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_227222_runs;
        str_builder(&builder,
                    "main.segmap_227351                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_227351_runs,
                    (long) ctx->mainzisegmap_227351_total_runtime /
                    (ctx->mainzisegmap_227351_runs !=
                     0 ? ctx->mainzisegmap_227351_runs : 1),
                    (long) ctx->mainzisegmap_227351_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_227351_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_227351_runs;
        str_builder(&builder,
                    "main.segmap_228076                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_228076_runs,
                    (long) ctx->mainzisegmap_228076_total_runtime /
                    (ctx->mainzisegmap_228076_runs !=
                     0 ? ctx->mainzisegmap_228076_runs : 1),
                    (long) ctx->mainzisegmap_228076_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_228076_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_228076_runs;
        str_builder(&builder,
                    "main.segmap_228131                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_228131_runs,
                    (long) ctx->mainzisegmap_228131_total_runtime /
                    (ctx->mainzisegmap_228131_runs !=
                     0 ? ctx->mainzisegmap_228131_runs : 1),
                    (long) ctx->mainzisegmap_228131_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_228131_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_228131_runs;
        str_builder(&builder,
                    "main.segmap_228193                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_228193_runs,
                    (long) ctx->mainzisegmap_228193_total_runtime /
                    (ctx->mainzisegmap_228193_runs !=
                     0 ? ctx->mainzisegmap_228193_runs : 1),
                    (long) ctx->mainzisegmap_228193_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_228193_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_228193_runs;
        str_builder(&builder,
                    "main.segmap_228279                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_228279_runs,
                    (long) ctx->mainzisegmap_228279_total_runtime /
                    (ctx->mainzisegmap_228279_runs !=
                     0 ? ctx->mainzisegmap_228279_runs : 1),
                    (long) ctx->mainzisegmap_228279_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_228279_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_228279_runs;
        str_builder(&builder,
                    "main.segmap_228302                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_228302_runs,
                    (long) ctx->mainzisegmap_228302_total_runtime /
                    (ctx->mainzisegmap_228302_runs !=
                     0 ? ctx->mainzisegmap_228302_runs : 1),
                    (long) ctx->mainzisegmap_228302_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_228302_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_228302_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_206983          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_206983_runs,
                    (long) ctx->mainzisegmap_intragroup_206983_total_runtime /
                    (ctx->mainzisegmap_intragroup_206983_runs !=
                     0 ? ctx->mainzisegmap_intragroup_206983_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_206983_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_206983_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_206983_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_207338          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_207338_runs,
                    (long) ctx->mainzisegmap_intragroup_207338_total_runtime /
                    (ctx->mainzisegmap_intragroup_207338_runs !=
                     0 ? ctx->mainzisegmap_intragroup_207338_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_207338_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_207338_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_207338_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_207614          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_207614_runs,
                    (long) ctx->mainzisegmap_intragroup_207614_total_runtime /
                    (ctx->mainzisegmap_intragroup_207614_runs !=
                     0 ? ctx->mainzisegmap_intragroup_207614_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_207614_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_207614_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_207614_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_207867          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_207867_runs,
                    (long) ctx->mainzisegmap_intragroup_207867_total_runtime /
                    (ctx->mainzisegmap_intragroup_207867_runs !=
                     0 ? ctx->mainzisegmap_intragroup_207867_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_207867_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_207867_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_207867_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_208771          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_208771_runs,
                    (long) ctx->mainzisegmap_intragroup_208771_total_runtime /
                    (ctx->mainzisegmap_intragroup_208771_runs !=
                     0 ? ctx->mainzisegmap_intragroup_208771_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_208771_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_208771_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_208771_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_209172          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_209172_runs,
                    (long) ctx->mainzisegmap_intragroup_209172_total_runtime /
                    (ctx->mainzisegmap_intragroup_209172_runs !=
                     0 ? ctx->mainzisegmap_intragroup_209172_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_209172_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_209172_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_209172_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_209798          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_209798_runs,
                    (long) ctx->mainzisegmap_intragroup_209798_total_runtime /
                    (ctx->mainzisegmap_intragroup_209798_runs !=
                     0 ? ctx->mainzisegmap_intragroup_209798_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_209798_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_209798_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_209798_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_211858          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_211858_runs,
                    (long) ctx->mainzisegmap_intragroup_211858_total_runtime /
                    (ctx->mainzisegmap_intragroup_211858_runs !=
                     0 ? ctx->mainzisegmap_intragroup_211858_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_211858_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_211858_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_211858_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_213926          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_213926_runs,
                    (long) ctx->mainzisegmap_intragroup_213926_total_runtime /
                    (ctx->mainzisegmap_intragroup_213926_runs !=
                     0 ? ctx->mainzisegmap_intragroup_213926_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_213926_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_213926_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_213926_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_216501          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_216501_runs,
                    (long) ctx->mainzisegmap_intragroup_216501_total_runtime /
                    (ctx->mainzisegmap_intragroup_216501_runs !=
                     0 ? ctx->mainzisegmap_intragroup_216501_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_216501_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_216501_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_216501_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_217273          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_217273_runs,
                    (long) ctx->mainzisegmap_intragroup_217273_total_runtime /
                    (ctx->mainzisegmap_intragroup_217273_runs !=
                     0 ? ctx->mainzisegmap_intragroup_217273_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_217273_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_217273_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_217273_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_217594          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_217594_runs,
                    (long) ctx->mainzisegmap_intragroup_217594_total_runtime /
                    (ctx->mainzisegmap_intragroup_217594_runs !=
                     0 ? ctx->mainzisegmap_intragroup_217594_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_217594_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_217594_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_217594_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_218045          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_218045_runs,
                    (long) ctx->mainzisegmap_intragroup_218045_total_runtime /
                    (ctx->mainzisegmap_intragroup_218045_runs !=
                     0 ? ctx->mainzisegmap_intragroup_218045_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_218045_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_218045_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_218045_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_221759          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_221759_runs,
                    (long) ctx->mainzisegmap_intragroup_221759_total_runtime /
                    (ctx->mainzisegmap_intragroup_221759_runs !=
                     0 ? ctx->mainzisegmap_intragroup_221759_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_221759_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_221759_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_221759_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_221926          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_221926_runs,
                    (long) ctx->mainzisegmap_intragroup_221926_total_runtime /
                    (ctx->mainzisegmap_intragroup_221926_runs !=
                     0 ? ctx->mainzisegmap_intragroup_221926_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_221926_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_221926_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_221926_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_222183          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_222183_runs,
                    (long) ctx->mainzisegmap_intragroup_222183_total_runtime /
                    (ctx->mainzisegmap_intragroup_222183_runs !=
                     0 ? ctx->mainzisegmap_intragroup_222183_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_222183_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_222183_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_222183_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_226007          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_226007_runs,
                    (long) ctx->mainzisegmap_intragroup_226007_total_runtime /
                    (ctx->mainzisegmap_intragroup_226007_runs !=
                     0 ? ctx->mainzisegmap_intragroup_226007_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_226007_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_226007_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_226007_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_226320          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_226320_runs,
                    (long) ctx->mainzisegmap_intragroup_226320_total_runtime /
                    (ctx->mainzisegmap_intragroup_226320_runs !=
                     0 ? ctx->mainzisegmap_intragroup_226320_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_226320_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_226320_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_226320_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_226724          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_226724_runs,
                    (long) ctx->mainzisegmap_intragroup_226724_total_runtime /
                    (ctx->mainzisegmap_intragroup_226724_runs !=
                     0 ? ctx->mainzisegmap_intragroup_226724_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_226724_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_226724_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_226724_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_227074          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_227074_runs,
                    (long) ctx->mainzisegmap_intragroup_227074_total_runtime /
                    (ctx->mainzisegmap_intragroup_227074_runs !=
                     0 ? ctx->mainzisegmap_intragroup_227074_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_227074_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_227074_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_227074_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_227449          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_227449_runs,
                    (long) ctx->mainzisegmap_intragroup_227449_total_runtime /
                    (ctx->mainzisegmap_intragroup_227449_runs !=
                     0 ? ctx->mainzisegmap_intragroup_227449_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_227449_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_227449_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_227449_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_227905          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_227905_runs,
                    (long) ctx->mainzisegmap_intragroup_227905_total_runtime /
                    (ctx->mainzisegmap_intragroup_227905_runs !=
                     0 ? ctx->mainzisegmap_intragroup_227905_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_227905_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_227905_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_227905_runs;
        str_builder(&builder,
                    "main.segred_large_212093               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_212093_runs,
                    (long) ctx->mainzisegred_large_212093_total_runtime /
                    (ctx->mainzisegred_large_212093_runs !=
                     0 ? ctx->mainzisegred_large_212093_runs : 1),
                    (long) ctx->mainzisegred_large_212093_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_212093_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_212093_runs;
        str_builder(&builder,
                    "main.segred_large_212167               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_212167_runs,
                    (long) ctx->mainzisegred_large_212167_total_runtime /
                    (ctx->mainzisegred_large_212167_runs !=
                     0 ? ctx->mainzisegred_large_212167_runs : 1),
                    (long) ctx->mainzisegred_large_212167_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_212167_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_212167_runs;
        str_builder(&builder,
                    "main.segred_large_214227               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_214227_runs,
                    (long) ctx->mainzisegred_large_214227_total_runtime /
                    (ctx->mainzisegred_large_214227_runs !=
                     0 ? ctx->mainzisegred_large_214227_runs : 1),
                    (long) ctx->mainzisegred_large_214227_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_214227_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_214227_runs;
        str_builder(&builder,
                    "main.segred_large_214321               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_214321_runs,
                    (long) ctx->mainzisegred_large_214321_total_runtime /
                    (ctx->mainzisegred_large_214321_runs !=
                     0 ? ctx->mainzisegred_large_214321_runs : 1),
                    (long) ctx->mainzisegred_large_214321_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_214321_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_214321_runs;
        str_builder(&builder,
                    "main.segred_large_216874               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_216874_runs,
                    (long) ctx->mainzisegred_large_216874_total_runtime /
                    (ctx->mainzisegred_large_216874_runs !=
                     0 ? ctx->mainzisegred_large_216874_runs : 1),
                    (long) ctx->mainzisegred_large_216874_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_216874_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_216874_runs;
        str_builder(&builder,
                    "main.segred_large_216997               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_216997_runs,
                    (long) ctx->mainzisegred_large_216997_total_runtime /
                    (ctx->mainzisegred_large_216997_runs !=
                     0 ? ctx->mainzisegred_large_216997_runs : 1),
                    (long) ctx->mainzisegred_large_216997_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_216997_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_216997_runs;
        str_builder(&builder,
                    "main.segred_large_218721               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_218721_runs,
                    (long) ctx->mainzisegred_large_218721_total_runtime /
                    (ctx->mainzisegred_large_218721_runs !=
                     0 ? ctx->mainzisegred_large_218721_runs : 1),
                    (long) ctx->mainzisegred_large_218721_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_218721_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_218721_runs;
        str_builder(&builder,
                    "main.segred_large_218852               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_218852_runs,
                    (long) ctx->mainzisegred_large_218852_total_runtime /
                    (ctx->mainzisegred_large_218852_runs !=
                     0 ? ctx->mainzisegred_large_218852_runs : 1),
                    (long) ctx->mainzisegred_large_218852_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_218852_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_218852_runs;
        str_builder(&builder,
                    "main.segred_large_218983               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_218983_runs,
                    (long) ctx->mainzisegred_large_218983_total_runtime /
                    (ctx->mainzisegred_large_218983_runs !=
                     0 ? ctx->mainzisegred_large_218983_runs : 1),
                    (long) ctx->mainzisegred_large_218983_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_218983_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_218983_runs;
        str_builder(&builder,
                    "main.segred_large_219605               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_219605_runs,
                    (long) ctx->mainzisegred_large_219605_total_runtime /
                    (ctx->mainzisegred_large_219605_runs !=
                     0 ? ctx->mainzisegred_large_219605_runs : 1),
                    (long) ctx->mainzisegred_large_219605_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_219605_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_219605_runs;
        str_builder(&builder,
                    "main.segred_large_219654               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_219654_runs,
                    (long) ctx->mainzisegred_large_219654_total_runtime /
                    (ctx->mainzisegred_large_219654_runs !=
                     0 ? ctx->mainzisegred_large_219654_runs : 1),
                    (long) ctx->mainzisegred_large_219654_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_219654_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_219654_runs;
        str_builder(&builder,
                    "main.segred_large_220434               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_220434_runs,
                    (long) ctx->mainzisegred_large_220434_total_runtime /
                    (ctx->mainzisegred_large_220434_runs !=
                     0 ? ctx->mainzisegred_large_220434_runs : 1),
                    (long) ctx->mainzisegred_large_220434_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_220434_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_220434_runs;
        str_builder(&builder,
                    "main.segred_large_220503               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_220503_runs,
                    (long) ctx->mainzisegred_large_220503_total_runtime /
                    (ctx->mainzisegred_large_220503_runs !=
                     0 ? ctx->mainzisegred_large_220503_runs : 1),
                    (long) ctx->mainzisegred_large_220503_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_220503_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_220503_runs;
        str_builder(&builder,
                    "main.segred_large_221513               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_221513_runs,
                    (long) ctx->mainzisegred_large_221513_total_runtime /
                    (ctx->mainzisegred_large_221513_runs !=
                     0 ? ctx->mainzisegred_large_221513_runs : 1),
                    (long) ctx->mainzisegred_large_221513_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_221513_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_221513_runs;
        str_builder(&builder,
                    "main.segred_large_221611               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_221611_runs,
                    (long) ctx->mainzisegred_large_221611_total_runtime /
                    (ctx->mainzisegred_large_221611_runs !=
                     0 ? ctx->mainzisegred_large_221611_runs : 1),
                    (long) ctx->mainzisegred_large_221611_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_221611_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_221611_runs;
        str_builder(&builder,
                    "main.segred_large_223287               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_223287_runs,
                    (long) ctx->mainzisegred_large_223287_total_runtime /
                    (ctx->mainzisegred_large_223287_runs !=
                     0 ? ctx->mainzisegred_large_223287_runs : 1),
                    (long) ctx->mainzisegred_large_223287_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_223287_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_223287_runs;
        str_builder(&builder,
                    "main.segred_large_223339               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_223339_runs,
                    (long) ctx->mainzisegred_large_223339_total_runtime /
                    (ctx->mainzisegred_large_223339_runs !=
                     0 ? ctx->mainzisegred_large_223339_runs : 1),
                    (long) ctx->mainzisegred_large_223339_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_223339_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_223339_runs;
        str_builder(&builder,
                    "main.segred_large_224325               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_224325_runs,
                    (long) ctx->mainzisegred_large_224325_total_runtime /
                    (ctx->mainzisegred_large_224325_runs !=
                     0 ? ctx->mainzisegred_large_224325_runs : 1),
                    (long) ctx->mainzisegred_large_224325_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_224325_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_224325_runs;
        str_builder(&builder,
                    "main.segred_large_224397               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_224397_runs,
                    (long) ctx->mainzisegred_large_224397_total_runtime /
                    (ctx->mainzisegred_large_224397_runs !=
                     0 ? ctx->mainzisegred_large_224397_runs : 1),
                    (long) ctx->mainzisegred_large_224397_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_224397_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_224397_runs;
        str_builder(&builder,
                    "main.segred_large_225613               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_225613_runs,
                    (long) ctx->mainzisegred_large_225613_total_runtime /
                    (ctx->mainzisegred_large_225613_runs !=
                     0 ? ctx->mainzisegred_large_225613_runs : 1),
                    (long) ctx->mainzisegred_large_225613_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_225613_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_225613_runs;
        str_builder(&builder,
                    "main.segred_large_225714               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_225714_runs,
                    (long) ctx->mainzisegred_large_225714_total_runtime /
                    (ctx->mainzisegred_large_225714_runs !=
                     0 ? ctx->mainzisegred_large_225714_runs : 1),
                    (long) ctx->mainzisegred_large_225714_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_225714_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_225714_runs;
        str_builder(&builder,
                    "main.segred_large_228180               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_228180_runs,
                    (long) ctx->mainzisegred_large_228180_total_runtime /
                    (ctx->mainzisegred_large_228180_runs !=
                     0 ? ctx->mainzisegred_large_228180_runs : 1),
                    (long) ctx->mainzisegred_large_228180_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_228180_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_228180_runs;
        str_builder(&builder,
                    "main.segred_small_212093               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_212093_runs,
                    (long) ctx->mainzisegred_small_212093_total_runtime /
                    (ctx->mainzisegred_small_212093_runs !=
                     0 ? ctx->mainzisegred_small_212093_runs : 1),
                    (long) ctx->mainzisegred_small_212093_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_212093_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_212093_runs;
        str_builder(&builder,
                    "main.segred_small_212167               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_212167_runs,
                    (long) ctx->mainzisegred_small_212167_total_runtime /
                    (ctx->mainzisegred_small_212167_runs !=
                     0 ? ctx->mainzisegred_small_212167_runs : 1),
                    (long) ctx->mainzisegred_small_212167_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_212167_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_212167_runs;
        str_builder(&builder,
                    "main.segred_small_214227               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_214227_runs,
                    (long) ctx->mainzisegred_small_214227_total_runtime /
                    (ctx->mainzisegred_small_214227_runs !=
                     0 ? ctx->mainzisegred_small_214227_runs : 1),
                    (long) ctx->mainzisegred_small_214227_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_214227_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_214227_runs;
        str_builder(&builder,
                    "main.segred_small_214321               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_214321_runs,
                    (long) ctx->mainzisegred_small_214321_total_runtime /
                    (ctx->mainzisegred_small_214321_runs !=
                     0 ? ctx->mainzisegred_small_214321_runs : 1),
                    (long) ctx->mainzisegred_small_214321_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_214321_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_214321_runs;
        str_builder(&builder,
                    "main.segred_small_216874               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_216874_runs,
                    (long) ctx->mainzisegred_small_216874_total_runtime /
                    (ctx->mainzisegred_small_216874_runs !=
                     0 ? ctx->mainzisegred_small_216874_runs : 1),
                    (long) ctx->mainzisegred_small_216874_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_216874_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_216874_runs;
        str_builder(&builder,
                    "main.segred_small_216997               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_216997_runs,
                    (long) ctx->mainzisegred_small_216997_total_runtime /
                    (ctx->mainzisegred_small_216997_runs !=
                     0 ? ctx->mainzisegred_small_216997_runs : 1),
                    (long) ctx->mainzisegred_small_216997_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_216997_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_216997_runs;
        str_builder(&builder,
                    "main.segred_small_218721               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_218721_runs,
                    (long) ctx->mainzisegred_small_218721_total_runtime /
                    (ctx->mainzisegred_small_218721_runs !=
                     0 ? ctx->mainzisegred_small_218721_runs : 1),
                    (long) ctx->mainzisegred_small_218721_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_218721_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_218721_runs;
        str_builder(&builder,
                    "main.segred_small_218852               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_218852_runs,
                    (long) ctx->mainzisegred_small_218852_total_runtime /
                    (ctx->mainzisegred_small_218852_runs !=
                     0 ? ctx->mainzisegred_small_218852_runs : 1),
                    (long) ctx->mainzisegred_small_218852_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_218852_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_218852_runs;
        str_builder(&builder,
                    "main.segred_small_218983               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_218983_runs,
                    (long) ctx->mainzisegred_small_218983_total_runtime /
                    (ctx->mainzisegred_small_218983_runs !=
                     0 ? ctx->mainzisegred_small_218983_runs : 1),
                    (long) ctx->mainzisegred_small_218983_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_218983_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_218983_runs;
        str_builder(&builder,
                    "main.segred_small_219605               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_219605_runs,
                    (long) ctx->mainzisegred_small_219605_total_runtime /
                    (ctx->mainzisegred_small_219605_runs !=
                     0 ? ctx->mainzisegred_small_219605_runs : 1),
                    (long) ctx->mainzisegred_small_219605_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_219605_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_219605_runs;
        str_builder(&builder,
                    "main.segred_small_219654               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_219654_runs,
                    (long) ctx->mainzisegred_small_219654_total_runtime /
                    (ctx->mainzisegred_small_219654_runs !=
                     0 ? ctx->mainzisegred_small_219654_runs : 1),
                    (long) ctx->mainzisegred_small_219654_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_219654_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_219654_runs;
        str_builder(&builder,
                    "main.segred_small_220434               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_220434_runs,
                    (long) ctx->mainzisegred_small_220434_total_runtime /
                    (ctx->mainzisegred_small_220434_runs !=
                     0 ? ctx->mainzisegred_small_220434_runs : 1),
                    (long) ctx->mainzisegred_small_220434_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_220434_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_220434_runs;
        str_builder(&builder,
                    "main.segred_small_220503               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_220503_runs,
                    (long) ctx->mainzisegred_small_220503_total_runtime /
                    (ctx->mainzisegred_small_220503_runs !=
                     0 ? ctx->mainzisegred_small_220503_runs : 1),
                    (long) ctx->mainzisegred_small_220503_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_220503_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_220503_runs;
        str_builder(&builder,
                    "main.segred_small_221513               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_221513_runs,
                    (long) ctx->mainzisegred_small_221513_total_runtime /
                    (ctx->mainzisegred_small_221513_runs !=
                     0 ? ctx->mainzisegred_small_221513_runs : 1),
                    (long) ctx->mainzisegred_small_221513_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_221513_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_221513_runs;
        str_builder(&builder,
                    "main.segred_small_221611               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_221611_runs,
                    (long) ctx->mainzisegred_small_221611_total_runtime /
                    (ctx->mainzisegred_small_221611_runs !=
                     0 ? ctx->mainzisegred_small_221611_runs : 1),
                    (long) ctx->mainzisegred_small_221611_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_221611_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_221611_runs;
        str_builder(&builder,
                    "main.segred_small_223287               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_223287_runs,
                    (long) ctx->mainzisegred_small_223287_total_runtime /
                    (ctx->mainzisegred_small_223287_runs !=
                     0 ? ctx->mainzisegred_small_223287_runs : 1),
                    (long) ctx->mainzisegred_small_223287_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_223287_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_223287_runs;
        str_builder(&builder,
                    "main.segred_small_223339               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_223339_runs,
                    (long) ctx->mainzisegred_small_223339_total_runtime /
                    (ctx->mainzisegred_small_223339_runs !=
                     0 ? ctx->mainzisegred_small_223339_runs : 1),
                    (long) ctx->mainzisegred_small_223339_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_223339_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_223339_runs;
        str_builder(&builder,
                    "main.segred_small_224325               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_224325_runs,
                    (long) ctx->mainzisegred_small_224325_total_runtime /
                    (ctx->mainzisegred_small_224325_runs !=
                     0 ? ctx->mainzisegred_small_224325_runs : 1),
                    (long) ctx->mainzisegred_small_224325_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_224325_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_224325_runs;
        str_builder(&builder,
                    "main.segred_small_224397               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_224397_runs,
                    (long) ctx->mainzisegred_small_224397_total_runtime /
                    (ctx->mainzisegred_small_224397_runs !=
                     0 ? ctx->mainzisegred_small_224397_runs : 1),
                    (long) ctx->mainzisegred_small_224397_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_224397_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_224397_runs;
        str_builder(&builder,
                    "main.segred_small_225613               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_225613_runs,
                    (long) ctx->mainzisegred_small_225613_total_runtime /
                    (ctx->mainzisegred_small_225613_runs !=
                     0 ? ctx->mainzisegred_small_225613_runs : 1),
                    (long) ctx->mainzisegred_small_225613_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_225613_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_225613_runs;
        str_builder(&builder,
                    "main.segred_small_225714               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_225714_runs,
                    (long) ctx->mainzisegred_small_225714_total_runtime /
                    (ctx->mainzisegred_small_225714_runs !=
                     0 ? ctx->mainzisegred_small_225714_runs : 1),
                    (long) ctx->mainzisegred_small_225714_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_225714_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_225714_runs;
        str_builder(&builder,
                    "main.segred_small_228180               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_228180_runs,
                    (long) ctx->mainzisegred_small_228180_total_runtime /
                    (ctx->mainzisegred_small_228180_runs !=
                     0 ? ctx->mainzisegred_small_228180_runs : 1),
                    (long) ctx->mainzisegred_small_228180_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_228180_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_228180_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_f64(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_f64(struct futhark_context *ctx,
                                         struct memblock_device mem_232947,
                                         int32_t num_elems_232948,
                                         double val_232949);
static int futrts_builtinzhreplicate_i64(struct futhark_context *ctx,
                                         struct memblock_device mem_232530,
                                         int32_t num_elems_232531,
                                         int64_t val_232532);
static int futrts_entry_main(struct futhark_context *ctx,
                             struct memblock_device *mem_out_p_236847,
                             struct memblock_device *mem_out_p_236848,
                             struct memblock_device *mem_out_p_236849,
                             struct memblock_device Y_mem_229239,
                             int64_t m_203571, int64_t n_203572,
                             int64_t n_p_203574, int64_t q_s_203575,
                             int64_t q_t_203576, int64_t q_l_203577,
                             int64_t d_s_203578, int64_t d_t_203579,
                             int64_t d_l_203580, int64_t jump_s_203581,
                             int64_t jump_t_203582, int64_t jump_l_203583,
                             int64_t n_inner_203584, int64_t n_outer_203585,
                             int64_t jump_threshold_203586,
                             int64_t q_threshold_203587);

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_f64_2d {
    struct memblock_device mem;
    int64_t shape[2];
};
struct futhark_f64_2d *futhark_new_f64_2d(struct futhark_context *ctx, const
                                          double *data, int64_t dim0,
                                          int64_t dim1)
{
    struct futhark_f64_2d *bad = NULL;
    struct futhark_f64_2d *arr =
                          (struct futhark_f64_2d *) malloc(sizeof(struct futhark_f64_2d));
    
    if (arr == NULL)
        return bad;
    lock_lock(&ctx->lock);
    arr->mem.references = NULL;
    if (memblock_alloc_device(ctx, &arr->mem, dim0 * dim1 * 8, "arr->mem"))
        return NULL;
    arr->shape[0] = dim0;
    arr->shape[1] = dim1;
    if ((size_t) (dim0 * dim1) * 8 > 0)
        OPENCL_SUCCEED_OR_RETURN(clEnqueueWriteBuffer(ctx->opencl.queue,
                                                      arr->mem.mem, CL_TRUE,
                                                      (size_t) 0,
                                                      (size_t) ((size_t) (dim0 *
                                                                          dim1) *
                                                                8), 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_f64_2d *futhark_new_raw_f64_2d(struct futhark_context *ctx, const
                                              cl_mem data, int64_t offset,
                                              int64_t dim0, int64_t dim1)
{
    struct futhark_f64_2d *bad = NULL;
    struct futhark_f64_2d *arr =
                          (struct futhark_f64_2d *) malloc(sizeof(struct futhark_f64_2d));
    
    if (arr == NULL)
        return bad;
    lock_lock(&ctx->lock);
    arr->mem.references = NULL;
    if (memblock_alloc_device(ctx, &arr->mem, dim0 * dim1 * 8, "arr->mem"))
        return NULL;
    arr->shape[0] = dim0;
    arr->shape[1] = dim1;
    if ((size_t) (dim0 * dim1) * 8 > 0) {
        OPENCL_SUCCEED_OR_RETURN(clEnqueueCopyBuffer(ctx->opencl.queue, data,
                                                     arr->mem.mem,
                                                     (size_t) offset,
                                                     (size_t) 0,
                                                     (size_t) ((size_t) (dim0 *
                                                                         dim1) *
                                                               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));
    }
    lock_unlock(&ctx->lock);
    return arr;
}
int futhark_free_f64_2d(struct futhark_context *ctx, struct futhark_f64_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_f64_2d(struct futhark_context *ctx,
                          struct futhark_f64_2d *arr, double *data)
{
    lock_lock(&ctx->lock);
    if ((size_t) (arr->shape[0] * arr->shape[1]) * 8 > 0) {
        OPENCL_SUCCEED_OR_RETURN(clEnqueueReadBuffer(ctx->opencl.queue,
                                                     arr->mem.mem,
                                                     ctx->failure_is_an_option ? CL_FALSE : CL_TRUE,
                                                     (size_t) 0,
                                                     (size_t) ((size_t) (arr->shape[0] *
                                                                         arr->shape[1]) *
                                                               8), 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_f64_2d(struct futhark_context *ctx,
                                 struct futhark_f64_2d *arr)
{
    (void) ctx;
    return arr->mem.mem;
}
const int64_t *futhark_shape_f64_2d(struct futhark_context *ctx,
                                    struct futhark_f64_2d *arr)
{
    (void) ctx;
    return arr->shape;
}

static int futrts_builtinzhgpu_map_transpose_f64(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,
                                                             (size_t) sext_i32_i64(srcoffset_3),
                                                             (size_t) sext_i32_i64(destoffset_1),
                                                             (size_t) sext_i32_i64(x_elems_5 *
                                                             y_elems_6 * 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_f64_low_width,
                                                        0,
                                                        (size_t) (int64_t) 2176,
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64_low_width,
                                                        1, sizeof(destoffset_1),
                                                        &destoffset_1));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64_low_width,
                                                        2, sizeof(srcoffset_3),
                                                        &srcoffset_3));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64_low_width,
                                                        3, sizeof(num_arrays_4),
                                                        &num_arrays_4));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64_low_width,
                                                        4, sizeof(x_elems_5),
                                                        &x_elems_5));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64_low_width,
                                                        5, sizeof(y_elems_6),
                                                        &y_elems_6));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64_low_width,
                                                        6, sizeof(mulx_7),
                                                        &mulx_7));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64_low_width,
                                                        7, sizeof(muly_8),
                                                        &muly_8));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64_low_width,
                                                        8,
                                                        sizeof(destmem_0.mem),
                                                        &destmem_0.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64_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_236797[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_236801[3] = {(size_t) 16,
                                                               (size_t) 16,
                                                               (size_t) 1};
                    int64_t time_start_236798 = 0, time_end_236799 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu, %zu, %zu] and local work size [%zu, %zu, %zu]; local memory: %d bytes.\n",
                                "gpu_map_transpose_f64_low_width",
                                global_work_sizze_236797[0],
                                global_work_sizze_236797[1],
                                global_work_sizze_236797[2],
                                local_work_sizze_236801[0],
                                local_work_sizze_236801[1],
                                local_work_sizze_236801[2], (int) (0 +
                                                                   (int64_t) 2176));
                        time_start_236798 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->gpu_map_transpose_f64_low_width,
                                                                    3, NULL,
                                                                    global_work_sizze_236797,
                                                                    local_work_sizze_236801,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->gpu_map_transpose_f64_low_width_runs,
                                                                                                              &ctx->gpu_map_transpose_f64_low_width_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_236799 = get_wall_time();
                        
                        long time_diff_236800 = time_end_236799 -
                             time_start_236798;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "gpu_map_transpose_f64_low_width",
                                time_diff_236800);
                    }
                }
            } else {
                if (sle32(y_elems_6, 8) && slt32(16, x_elems_5)) {
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64_low_height,
                                                            0,
                                                            (size_t) (int64_t) 2176,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64_low_height,
                                                            1,
                                                            sizeof(destoffset_1),
                                                            &destoffset_1));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64_low_height,
                                                            2,
                                                            sizeof(srcoffset_3),
                                                            &srcoffset_3));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64_low_height,
                                                            3,
                                                            sizeof(num_arrays_4),
                                                            &num_arrays_4));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64_low_height,
                                                            4,
                                                            sizeof(x_elems_5),
                                                            &x_elems_5));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64_low_height,
                                                            5,
                                                            sizeof(y_elems_6),
                                                            &y_elems_6));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64_low_height,
                                                            6, sizeof(mulx_7),
                                                            &mulx_7));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64_low_height,
                                                            7, sizeof(muly_8),
                                                            &muly_8));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64_low_height,
                                                            8,
                                                            sizeof(destmem_0.mem),
                                                            &destmem_0.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64_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_236802[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_236806[3] = {(size_t) 16,
                                                                   (size_t) 16,
                                                                   (size_t) 1};
                        int64_t time_start_236803 = 0, time_end_236804 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu, %zu, %zu] and local work size [%zu, %zu, %zu]; local memory: %d bytes.\n",
                                    "gpu_map_transpose_f64_low_height",
                                    global_work_sizze_236802[0],
                                    global_work_sizze_236802[1],
                                    global_work_sizze_236802[2],
                                    local_work_sizze_236806[0],
                                    local_work_sizze_236806[1],
                                    local_work_sizze_236806[2], (int) (0 +
                                                                       (int64_t) 2176));
                            time_start_236803 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->gpu_map_transpose_f64_low_height,
                                                                        3, NULL,
                                                                        global_work_sizze_236802,
                                                                        local_work_sizze_236806,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->gpu_map_transpose_f64_low_height_runs,
                                                                                                                  &ctx->gpu_map_transpose_f64_low_height_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_236804 = get_wall_time();
                            
                            long time_diff_236805 = time_end_236804 -
                                 time_start_236803;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "gpu_map_transpose_f64_low_height",
                                    time_diff_236805);
                        }
                    }
                } else {
                    if (sle32(x_elems_5, 8) && sle32(y_elems_6, 8)) {
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64_small,
                                                                0,
                                                                (size_t) (int64_t) 1,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64_small,
                                                                1,
                                                                sizeof(destoffset_1),
                                                                &destoffset_1));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64_small,
                                                                2,
                                                                sizeof(srcoffset_3),
                                                                &srcoffset_3));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64_small,
                                                                3,
                                                                sizeof(num_arrays_4),
                                                                &num_arrays_4));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64_small,
                                                                4,
                                                                sizeof(x_elems_5),
                                                                &x_elems_5));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64_small,
                                                                5,
                                                                sizeof(y_elems_6),
                                                                &y_elems_6));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64_small,
                                                                6,
                                                                sizeof(mulx_7),
                                                                &mulx_7));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64_small,
                                                                7,
                                                                sizeof(muly_8),
                                                                &muly_8));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64_small,
                                                                8,
                                                                sizeof(destmem_0.mem),
                                                                &destmem_0.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64_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_236807[1] =
                                         {(size_t) sdiv_up32(num_arrays_4 *
                                                             x_elems_5 *
                                                             y_elems_6, 256) *
                                         (size_t) 256};
                            const size_t local_work_sizze_236811[1] =
                                         {(size_t) 256};
                            int64_t time_start_236808 = 0, time_end_236809 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "gpu_map_transpose_f64_small",
                                        global_work_sizze_236807[0],
                                        local_work_sizze_236811[0], (int) (0 +
                                                                           (int64_t) 1));
                                time_start_236808 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->gpu_map_transpose_f64_small,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_236807,
                                                                            local_work_sizze_236811,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->gpu_map_transpose_f64_small_runs,
                                                                                                                      &ctx->gpu_map_transpose_f64_small_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_236809 = get_wall_time();
                                
                                long time_diff_236810 = time_end_236809 -
                                     time_start_236808;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "gpu_map_transpose_f64_small",
                                        time_diff_236810);
                            }
                        }
                    } else {
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64,
                                                                0,
                                                                (size_t) (int64_t) 8448,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64,
                                                                1,
                                                                sizeof(destoffset_1),
                                                                &destoffset_1));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64,
                                                                2,
                                                                sizeof(srcoffset_3),
                                                                &srcoffset_3));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64,
                                                                3,
                                                                sizeof(num_arrays_4),
                                                                &num_arrays_4));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64,
                                                                4,
                                                                sizeof(x_elems_5),
                                                                &x_elems_5));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64,
                                                                5,
                                                                sizeof(y_elems_6),
                                                                &y_elems_6));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64,
                                                                6,
                                                                sizeof(mulx_7),
                                                                &mulx_7));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64,
                                                                7,
                                                                sizeof(muly_8),
                                                                &muly_8));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64,
                                                                8,
                                                                sizeof(destmem_0.mem),
                                                                &destmem_0.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f64,
                                                                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_236812[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_236816[3] =
                                         {(size_t) 32, (size_t) 8, (size_t) 1};
                            int64_t time_start_236813 = 0, time_end_236814 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu, %zu, %zu] and local work size [%zu, %zu, %zu]; local memory: %d bytes.\n",
                                        "gpu_map_transpose_f64",
                                        global_work_sizze_236812[0],
                                        global_work_sizze_236812[1],
                                        global_work_sizze_236812[2],
                                        local_work_sizze_236816[0],
                                        local_work_sizze_236816[1],
                                        local_work_sizze_236816[2], (int) (0 +
                                                                           (int64_t) 8448));
                                time_start_236813 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->gpu_map_transpose_f64,
                                                                            3,
                                                                            NULL,
                                                                            global_work_sizze_236812,
                                                                            local_work_sizze_236816,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->gpu_map_transpose_f64_runs,
                                                                                                                      &ctx->gpu_map_transpose_f64_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_236814 = get_wall_time();
                                
                                long time_diff_236815 = time_end_236814 -
                                     time_start_236813;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "gpu_map_transpose_f64",
                                        time_diff_236815);
                            }
                        }
                    }
                }
            }
        }
    }
    
  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,
                                                             (size_t) sext_i32_i64(srcoffset_3),
                                                             (size_t) sext_i32_i64(destoffset_1),
                                                             (size_t) sext_i32_i64(x_elems_5 *
                                                             y_elems_6 * 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,
                                                        (size_t) (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_236817[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_236821[3] = {(size_t) 16,
                                                               (size_t) 16,
                                                               (size_t) 1};
                    int64_t time_start_236818 = 0, time_end_236819 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu, %zu, %zu] and local work size [%zu, %zu, %zu]; local memory: %d bytes.\n",
                                "gpu_map_transpose_i64_low_width",
                                global_work_sizze_236817[0],
                                global_work_sizze_236817[1],
                                global_work_sizze_236817[2],
                                local_work_sizze_236821[0],
                                local_work_sizze_236821[1],
                                local_work_sizze_236821[2], (int) (0 +
                                                                   (int64_t) 2176));
                        time_start_236818 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->gpu_map_transpose_i64_low_width,
                                                                    3, NULL,
                                                                    global_work_sizze_236817,
                                                                    local_work_sizze_236821,
                                                                    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_236819 = get_wall_time();
                        
                        long time_diff_236820 = time_end_236819 -
                             time_start_236818;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "gpu_map_transpose_i64_low_width",
                                time_diff_236820);
                    }
                }
            } 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,
                                                            (size_t) (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_236822[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_236826[3] = {(size_t) 16,
                                                                   (size_t) 16,
                                                                   (size_t) 1};
                        int64_t time_start_236823 = 0, time_end_236824 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu, %zu, %zu] and local work size [%zu, %zu, %zu]; local memory: %d bytes.\n",
                                    "gpu_map_transpose_i64_low_height",
                                    global_work_sizze_236822[0],
                                    global_work_sizze_236822[1],
                                    global_work_sizze_236822[2],
                                    local_work_sizze_236826[0],
                                    local_work_sizze_236826[1],
                                    local_work_sizze_236826[2], (int) (0 +
                                                                       (int64_t) 2176));
                            time_start_236823 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->gpu_map_transpose_i64_low_height,
                                                                        3, NULL,
                                                                        global_work_sizze_236822,
                                                                        local_work_sizze_236826,
                                                                        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_236824 = get_wall_time();
                            
                            long time_diff_236825 = time_end_236824 -
                                 time_start_236823;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "gpu_map_transpose_i64_low_height",
                                    time_diff_236825);
                        }
                    }
                } else {
                    if (sle32(x_elems_5, 8) && sle32(y_elems_6, 8)) {
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_small,
                                                                0,
                                                                (size_t) (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_236827[1] =
                                         {(size_t) sdiv_up32(num_arrays_4 *
                                                             x_elems_5 *
                                                             y_elems_6, 256) *
                                         (size_t) 256};
                            const size_t local_work_sizze_236831[1] =
                                         {(size_t) 256};
                            int64_t time_start_236828 = 0, time_end_236829 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "gpu_map_transpose_i64_small",
                                        global_work_sizze_236827[0],
                                        local_work_sizze_236831[0], (int) (0 +
                                                                           (int64_t) 1));
                                time_start_236828 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->gpu_map_transpose_i64_small,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_236827,
                                                                            local_work_sizze_236831,
                                                                            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_236829 = get_wall_time();
                                
                                long time_diff_236830 = time_end_236829 -
                                     time_start_236828;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "gpu_map_transpose_i64_small",
                                        time_diff_236830);
                            }
                        }
                    } else {
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64,
                                                                0,
                                                                (size_t) (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_236832[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_236836[3] =
                                         {(size_t) 32, (size_t) 8, (size_t) 1};
                            int64_t time_start_236833 = 0, time_end_236834 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu, %zu, %zu] and local work size [%zu, %zu, %zu]; local memory: %d bytes.\n",
                                        "gpu_map_transpose_i64",
                                        global_work_sizze_236832[0],
                                        global_work_sizze_236832[1],
                                        global_work_sizze_236832[2],
                                        local_work_sizze_236836[0],
                                        local_work_sizze_236836[1],
                                        local_work_sizze_236836[2], (int) (0 +
                                                                           (int64_t) 8448));
                                time_start_236833 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->gpu_map_transpose_i64,
                                                                            3,
                                                                            NULL,
                                                                            global_work_sizze_236832,
                                                                            local_work_sizze_236836,
                                                                            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_236834 = get_wall_time();
                                
                                long time_diff_236835 = time_end_236834 -
                                     time_start_236833;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "gpu_map_transpose_i64",
                                        time_diff_236835);
                            }
                        }
                    }
                }
            }
        }
    }
    
  cleanup:
    { }
    return err;
}
static int futrts_builtinzhreplicate_f64(struct futhark_context *ctx,
                                         struct memblock_device mem_232947,
                                         int32_t num_elems_232948,
                                         double val_232949)
{
    (void) ctx;
    
    int err = 0;
    int64_t group_sizze_232954;
    
    group_sizze_232954 =
        *ctx->tuning_params.builtinzhreplicate_f64zigroup_sizze_232954;
    
    int64_t num_groups_232955 = sdiv_up64(num_elems_232948, group_sizze_232954);
    
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->builtinzhreplicate_f64zireplicate_232951,
                                            0, sizeof(num_elems_232948),
                                            &num_elems_232948));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->builtinzhreplicate_f64zireplicate_232951,
                                            1, sizeof(val_232949),
                                            &val_232949));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->builtinzhreplicate_f64zireplicate_232951,
                                            2, sizeof(mem_232947.mem),
                                            &mem_232947.mem));
    if (1 * ((size_t) num_groups_232955 * (size_t) group_sizze_232954) != 0) {
        const size_t global_work_sizze_236837[1] = {(size_t) num_groups_232955 *
                     (size_t) group_sizze_232954};
        const size_t local_work_sizze_236841[1] = {(size_t) group_sizze_232954};
        int64_t time_start_236838 = 0, time_end_236839 = 0;
        
        if (ctx->debugging) {
            fprintf(ctx->log,
                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                    "builtin#replicate_f64.replicate_232951",
                    global_work_sizze_236837[0], local_work_sizze_236841[0],
                    (int) 0);
            time_start_236838 = get_wall_time();
        }
        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                        ctx->builtinzhreplicate_f64zireplicate_232951,
                                                        1, NULL,
                                                        global_work_sizze_236837,
                                                        local_work_sizze_236841,
                                                        0, NULL,
                                                        ctx->profiling_paused ||
                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                  &ctx->builtinzhreplicate_f64zireplicate_232951_runs,
                                                                                                  &ctx->builtinzhreplicate_f64zireplicate_232951_total_runtime)));
        if (ctx->debugging) {
            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
            time_end_236839 = get_wall_time();
            
            long time_diff_236840 = time_end_236839 - time_start_236838;
            
            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                    "builtin#replicate_f64.replicate_232951", time_diff_236840);
        }
    }
    
  cleanup:
    { }
    return err;
}
static int futrts_builtinzhreplicate_i64(struct futhark_context *ctx,
                                         struct memblock_device mem_232530,
                                         int32_t num_elems_232531,
                                         int64_t val_232532)
{
    (void) ctx;
    
    int err = 0;
    int64_t group_sizze_232537;
    
    group_sizze_232537 =
        *ctx->tuning_params.builtinzhreplicate_i64zigroup_sizze_232537;
    
    int64_t num_groups_232538 = sdiv_up64(num_elems_232531, group_sizze_232537);
    
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->builtinzhreplicate_i64zireplicate_232534,
                                            0, sizeof(num_elems_232531),
                                            &num_elems_232531));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->builtinzhreplicate_i64zireplicate_232534,
                                            1, sizeof(val_232532),
                                            &val_232532));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->builtinzhreplicate_i64zireplicate_232534,
                                            2, sizeof(mem_232530.mem),
                                            &mem_232530.mem));
    if (1 * ((size_t) num_groups_232538 * (size_t) group_sizze_232537) != 0) {
        const size_t global_work_sizze_236842[1] = {(size_t) num_groups_232538 *
                     (size_t) group_sizze_232537};
        const size_t local_work_sizze_236846[1] = {(size_t) group_sizze_232537};
        int64_t time_start_236843 = 0, time_end_236844 = 0;
        
        if (ctx->debugging) {
            fprintf(ctx->log,
                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                    "builtin#replicate_i64.replicate_232534",
                    global_work_sizze_236842[0], local_work_sizze_236846[0],
                    (int) 0);
            time_start_236843 = get_wall_time();
        }
        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                        ctx->builtinzhreplicate_i64zireplicate_232534,
                                                        1, NULL,
                                                        global_work_sizze_236842,
                                                        local_work_sizze_236846,
                                                        0, NULL,
                                                        ctx->profiling_paused ||
                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                  &ctx->builtinzhreplicate_i64zireplicate_232534_runs,
                                                                                                  &ctx->builtinzhreplicate_i64zireplicate_232534_total_runtime)));
        if (ctx->debugging) {
            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
            time_end_236844 = get_wall_time();
            
            long time_diff_236845 = time_end_236844 - time_start_236843;
            
            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                    "builtin#replicate_i64.replicate_232534", time_diff_236845);
        }
    }
    
  cleanup:
    { }
    return err;
}
static int futrts_entry_main(struct futhark_context *ctx,
                             struct memblock_device *mem_out_p_236847,
                             struct memblock_device *mem_out_p_236848,
                             struct memblock_device *mem_out_p_236849,
                             struct memblock_device Y_mem_229239,
                             int64_t m_203571, int64_t n_203572,
                             int64_t n_p_203574, int64_t q_s_203575,
                             int64_t q_t_203576, int64_t q_l_203577,
                             int64_t d_s_203578, int64_t d_t_203579,
                             int64_t d_l_203580, int64_t jump_s_203581,
                             int64_t jump_t_203582, int64_t jump_l_203583,
                             int64_t n_inner_203584, int64_t n_outer_203585,
                             int64_t jump_threshold_203586,
                             int64_t q_threshold_203587)
{
    (void) ctx;
    
    int err = 0;
    struct memblock_device mem_out_232359;
    
    mem_out_232359.references = NULL;
    
    struct memblock_device mem_out_232360;
    
    mem_out_232360.references = NULL;
    
    struct memblock_device mem_out_232361;
    
    mem_out_232361.references = NULL;
    
    double i64_res_203588 = sitofp_i64_f64(n_203572);
    double i64_res_203589 = sitofp_i64_f64(n_p_203574);
    double ceil_arg_203590 = i64_res_203588 / i64_res_203589;
    double ceil_res_203591;
    
    ceil_res_203591 = futrts_ceil64(ceil_arg_203590);
    
    int64_t defunc_0_f_res_203592 = fptosi_f64_i64(ceil_res_203591);
    bool bounds_invalid_upwards_203593 = slt64(n_p_203574, (int64_t) 0);
    bool valid_203594 = !bounds_invalid_upwards_203593;
    bool range_valid_c_203595;
    
    if (!valid_203594) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) n_p_203574, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  stl.fut:403:29-408:37\n   #4  stl.fut:402:22-409:28\n   #5  stl.fut:455:3-469:34\n   #6  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool bounds_invalid_upwards_203597 = slt64(defunc_0_f_res_203592,
                                               (int64_t) 0);
    bool valid_203598 = !bounds_invalid_upwards_203597;
    bool range_valid_c_203599;
    
    if (!valid_203598) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) defunc_0_f_res_203592,
                               " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  stl.fut:404:36-407:52\n   #4  /prelude/soacs.fut:59:3-10\n   #5  /prelude/array.fut:195:3-17\n   #6  utils.fut:6:3-16\n   #7  stl.fut:403:29-408:37\n   #8  stl.fut:402:22-409:28\n   #9  stl.fut:455:3-469:34\n   #10 stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t segscan_group_sizze_206952;
    
    segscan_group_sizze_206952 =
        *ctx->tuning_params.mainzisegscan_group_sizze_206951;
    
    int64_t num_groups_206954;
    int32_t max_num_groups_232362;
    
    max_num_groups_232362 = *ctx->tuning_params.mainzisegscan_num_groups_206953;
    num_groups_206954 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(m_203571,
                                                             segscan_group_sizze_206952),
                                                   sext_i32_i64(max_num_groups_232362))));
    
    int64_t binop_x_229240 = m_203571 * n_203572;
    int64_t bytes_229241 = (int64_t) 8 * binop_x_229240;
    struct memblock_device mem_229242;
    
    mem_229242.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229242, bytes_229241, "mem_229242")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_229242, (int64_t) 0,
                                              Y_mem_229239, (int64_t) 0,
                                              (int64_t) 1, n_203572,
                                              m_203571) != 0) {
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t binop_y_229258 = (int64_t) 8 * m_203571;
    int64_t bytes_229259 = smax64((int64_t) 0, binop_y_229258);
    struct memblock_device mem_229260;
    
    mem_229260.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229260, bytes_229259, "mem_229260")) {
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_229263;
    
    mem_229263.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229263, bytes_229259, "mem_229263")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t bytes_229264 = smax64((int64_t) 0, m_203571);
    struct memblock_device mem_229265;
    
    mem_229265.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229265, bytes_229264, "mem_229265")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t bytes_229244 = smax64((int64_t) 0, defunc_0_f_res_203592);
    int64_t num_threads_232195 = segscan_group_sizze_206952 * num_groups_206954;
    int64_t total_sizze_232196 = bytes_229244 * num_threads_232195;
    struct memblock_device color_232074;
    
    color_232074.references = NULL;
    if (memblock_alloc_device(ctx, &color_232074, total_sizze_232196,
                              "color_232074")) {
        err = 1;
        goto cleanup;
    }
    if (slt64((int64_t) 0, m_203571)) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegScan");
        
        int64_t stage1_max_num_groups_232363;
        
        stage1_max_num_groups_232363 = ctx->opencl.max_group_size;
        
        int64_t stage1_num_groups_232364 = smin64(stage1_max_num_groups_232363,
                                                  num_groups_206954);
        int32_t num_threads_232365 = sext_i64_i32(stage1_num_groups_232364 *
                segscan_group_sizze_206952);
        
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_206957,
                                                1,
                                                sizeof(ctx->failure_is_an_option),
                                                &ctx->failure_is_an_option));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_206957,
                                                3, (size_t) smax64((int64_t) 1,
                                                                   (int64_t) 8 *
                                                                   segscan_group_sizze_206952),
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_206957,
                                                4, sizeof(m_203571),
                                                &m_203571));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_206957,
                                                5, sizeof(n_203572),
                                                &n_203572));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_206957,
                                                6, sizeof(n_p_203574),
                                                &n_p_203574));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_206957,
                                                7,
                                                sizeof(defunc_0_f_res_203592),
                                                &defunc_0_f_res_203592));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_206957,
                                                8, sizeof(num_threads_232195),
                                                &num_threads_232195));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_206957,
                                                9, sizeof(num_threads_232365),
                                                &num_threads_232365));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_206957,
                                                10, sizeof(mem_229242.mem),
                                                &mem_229242.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_206957,
                                                11, sizeof(mem_229260.mem),
                                                &mem_229260.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_206957,
                                                12, sizeof(mem_229263.mem),
                                                &mem_229263.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_206957,
                                                13, sizeof(mem_229265.mem),
                                                &mem_229265.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_206957,
                                                14, sizeof(color_232074.mem),
                                                &color_232074.mem));
        if (1 * ((size_t) stage1_num_groups_232364 *
                 (size_t) segscan_group_sizze_206952) != 0) {
            const size_t global_work_sizze_236850[1] =
                         {(size_t) stage1_num_groups_232364 *
                         (size_t) segscan_group_sizze_206952};
            const size_t local_work_sizze_236854[1] =
                         {(size_t) segscan_group_sizze_206952};
            int64_t time_start_236851 = 0, time_end_236852 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                        "main.scan_stage1_206957", global_work_sizze_236850[0],
                        local_work_sizze_236854[0], (int) (0 +
                                                           smax64((int64_t) 1,
                                                                  (int64_t) 8 *
                                                                  segscan_group_sizze_206952)));
                time_start_236851 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainziscan_stage1_206957,
                                                            1, NULL,
                                                            global_work_sizze_236850,
                                                            local_work_sizze_236854,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainziscan_stage1_206957_runs,
                                                                                                      &ctx->mainziscan_stage1_206957_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236852 = get_wall_time();
                
                long time_diff_236853 = time_end_236852 - time_start_236851;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.scan_stage1_206957", time_diff_236853);
            }
        }
        ctx->failure_is_an_option = 1;
        if (ctx->debugging)
            fprintf(ctx->log, "%s: %llu%c", "elems_per_group",
                    (long long) (segscan_group_sizze_206952 *
                                 sdiv_up64(m_203571,
                                           sext_i32_i64(num_threads_232365))),
                    '\n');
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_206957,
                                                1, (size_t) smax64((int64_t) 1,
                                                                   (int64_t) 8 *
                                                                   stage1_num_groups_232364),
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_206957,
                                                2, sizeof(m_203571),
                                                &m_203571));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_206957,
                                                3,
                                                sizeof(stage1_num_groups_232364),
                                                &stage1_num_groups_232364));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_206957,
                                                4, sizeof(num_threads_232365),
                                                &num_threads_232365));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_206957,
                                                5, sizeof(mem_229260.mem),
                                                &mem_229260.mem));
        if (1 * ((size_t) (int64_t) 1 * (size_t) stage1_num_groups_232364) !=
            0) {
            const size_t global_work_sizze_236855[1] = {(size_t) (int64_t) 1 *
                         (size_t) stage1_num_groups_232364};
            const size_t local_work_sizze_236859[1] =
                         {(size_t) stage1_num_groups_232364};
            int64_t time_start_236856 = 0, time_end_236857 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                        "main.scan_stage2_206957", global_work_sizze_236855[0],
                        local_work_sizze_236859[0], (int) (0 +
                                                           smax64((int64_t) 1,
                                                                  (int64_t) 8 *
                                                                  stage1_num_groups_232364)));
                time_start_236856 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainziscan_stage2_206957,
                                                            1, NULL,
                                                            global_work_sizze_236855,
                                                            local_work_sizze_236859,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainziscan_stage2_206957_runs,
                                                                                                      &ctx->mainziscan_stage2_206957_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236857 = get_wall_time();
                
                long time_diff_236858 = time_end_236857 - time_start_236856;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.scan_stage2_206957", time_diff_236858);
            }
        }
        
        int32_t required_groups_232413 = sext_i64_i32(sdiv_up64(m_203571,
                                                                segscan_group_sizze_206952));
        
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_206957,
                                                1, sizeof(m_203571),
                                                &m_203571));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_206957,
                                                2, sizeof(num_groups_206954),
                                                &num_groups_206954));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_206957,
                                                3, sizeof(num_threads_232365),
                                                &num_threads_232365));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_206957,
                                                4,
                                                sizeof(required_groups_232413),
                                                &required_groups_232413));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_206957,
                                                5, sizeof(mem_229260.mem),
                                                &mem_229260.mem));
        if (1 * ((size_t) num_groups_206954 *
                 (size_t) segscan_group_sizze_206952) != 0) {
            const size_t global_work_sizze_236860[1] =
                         {(size_t) num_groups_206954 *
                         (size_t) segscan_group_sizze_206952};
            const size_t local_work_sizze_236864[1] =
                         {(size_t) segscan_group_sizze_206952};
            int64_t time_start_236861 = 0, time_end_236862 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                        "main.scan_stage3_206957", global_work_sizze_236860[0],
                        local_work_sizze_236864[0], (int) 0);
                time_start_236861 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainziscan_stage3_206957,
                                                            1, NULL,
                                                            global_work_sizze_236860,
                                                            local_work_sizze_236864,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainziscan_stage3_206957_runs,
                                                                                                      &ctx->mainziscan_stage3_206957_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236862 = get_wall_time();
                
                long time_diff_236863 = time_end_236862 - time_start_236861;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.scan_stage3_206957", time_diff_236863);
            }
        }
    }
    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
        return 1;
    if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
        return 1;
    
    int64_t last_index_203665 = m_203571 - (int64_t) 1;
    bool is_empty_203666 = m_203571 == (int64_t) 0;
    int64_t partition_sizze_203667;
    
    if (is_empty_203666) {
        partition_sizze_203667 = (int64_t) 0;
    } else {
        int64_t last_offset_203668;
        int64_t read_res_236865;
        
        OPENCL_SUCCEED_OR_RETURN(clEnqueueReadBuffer(ctx->opencl.queue,
                                                     mem_229260.mem,
                                                     ctx->failure_is_an_option ? CL_FALSE : CL_TRUE,
                                                     last_index_203665 *
                                                     sizeof(int64_t),
                                                     sizeof(int64_t),
                                                     &read_res_236865, 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)));
        if (ctx->failure_is_an_option && futhark_context_sync(ctx) != 0)
            return 1;
        last_offset_203668 = read_res_236865;
        partition_sizze_203667 = last_offset_203668;
    }
    
    int64_t bytes_229268 = smax64((int64_t) 0, bytes_229241);
    struct memblock_device mem_229269;
    
    mem_229269.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229269, bytes_229268, "mem_229269")) {
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_229272;
    
    mem_229272.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229272, bytes_229259, "mem_229272")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t segmap_group_sizze_206962;
    
    segmap_group_sizze_206962 =
        *ctx->tuning_params.mainzisegmap_group_sizze_206961;
    
    int64_t num_groups_206964;
    int32_t max_num_groups_232425;
    
    max_num_groups_232425 = *ctx->tuning_params.mainzisegmap_num_groups_206963;
    num_groups_206964 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(m_203571,
                                                             segmap_group_sizze_206962),
                                                   sext_i32_i64(max_num_groups_232425))));
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "\n# SegMap");
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_206959, 1,
                                            sizeof(m_203571), &m_203571));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_206959, 2,
                                            sizeof(n_203572), &n_203572));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_206959, 3,
                                            sizeof(num_groups_206964),
                                            &num_groups_206964));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_206959, 4,
                                            sizeof(mem_229242.mem),
                                            &mem_229242.mem));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_206959, 5,
                                            sizeof(mem_229260.mem),
                                            &mem_229260.mem));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_206959, 6,
                                            sizeof(mem_229263.mem),
                                            &mem_229263.mem));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_206959, 7,
                                            sizeof(mem_229269.mem),
                                            &mem_229269.mem));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_206959, 8,
                                            sizeof(mem_229272.mem),
                                            &mem_229272.mem));
    if (1 * ((size_t) num_groups_206964 * (size_t) segmap_group_sizze_206962) !=
        0) {
        const size_t global_work_sizze_236866[1] = {(size_t) num_groups_206964 *
                     (size_t) segmap_group_sizze_206962};
        const size_t local_work_sizze_236870[1] =
                     {(size_t) segmap_group_sizze_206962};
        int64_t time_start_236867 = 0, time_end_236868 = 0;
        
        if (ctx->debugging) {
            fprintf(ctx->log,
                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                    "main.segmap_206959", global_work_sizze_236866[0],
                    local_work_sizze_236870[0], (int) 0);
            time_start_236867 = get_wall_time();
        }
        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                        ctx->mainzisegmap_206959,
                                                        1, NULL,
                                                        global_work_sizze_236866,
                                                        local_work_sizze_236870,
                                                        0, NULL,
                                                        ctx->profiling_paused ||
                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                  &ctx->mainzisegmap_206959_runs,
                                                                                                  &ctx->mainzisegmap_206959_total_runtime)));
        if (ctx->debugging) {
            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
            time_end_236868 = get_wall_time();
            
            long time_diff_236869 = time_end_236868 - time_start_236867;
            
            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                    "main.segmap_206959", time_diff_236869);
        }
    }
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "");
    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
        return 1;
    
    bool empty_slice_203681 = partition_sizze_203667 == (int64_t) 0;
    int64_t m_203682 = sub64(partition_sizze_203667, (int64_t) 1);
    bool zzero_leq_i_p_m_t_s_203683 = sle64((int64_t) 0, m_203682);
    bool i_p_m_t_s_leq_w_203684 = slt64(m_203682, m_203571);
    bool i_lte_j_203685 = sle64((int64_t) 0, partition_sizze_203667);
    bool y_203686 = zzero_leq_i_p_m_t_s_203683 && i_p_m_t_s_leq_w_203684;
    bool y_203687 = i_lte_j_203685 && y_203686;
    bool ok_or_empty_203688 = empty_slice_203681 || y_203687;
    bool index_certs_203689;
    
    if (!ok_or_empty_203688) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [:", (long long) partition_sizze_203667,
                               "] out of bounds for array of shape [",
                               (long long) m_203571, "].",
                               "-> #0  /prelude/soacs.fut:163:6-16\n   #1  stl.fut:412:7-66\n   #2  stl.fut:455:3-469:34\n   #3  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_203692 = sle64((int64_t) 4, n_p_203574);
    bool assert_c_203693;
    
    if (!assert_cond_203692) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (n_p >= 4)",
                               "-> #0  stl.fut:69:13-33\n   #1  stl.fut:415:61-429:75\n   #2  stl.fut:455:3-469:34\n   #3  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t x_203694 = smod64(q_t_203576, (int64_t) 2);
    bool assert_cond_203695 = x_203694 == (int64_t) 1;
    bool assert_c_203696;
    
    if (!assert_cond_203695) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x % 2 == 1)",
                               "-> #0  utils.fut:20:3-23\n   #1  /prelude/functional.fut:39:62-64\n   #2  stl.fut:71:13-25\n   #3  stl.fut:415:61-429:75\n   #4  stl.fut:455:3-469:34\n   #5  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_203697 = slt64((int64_t) 0, q_t_203576);
    bool assert_c_203698;
    
    if (!assert_cond_203697) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:17:3-18\n   #1  /prelude/functional.fut:39:59-65\n   #2  stl.fut:71:13-25\n   #3  stl.fut:415:61-429:75\n   #4  stl.fut:455:3-469:34\n   #5  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t x_203699 = smod64(q_l_203577, (int64_t) 2);
    bool assert_cond_203700 = x_203699 == (int64_t) 1;
    bool assert_c_203701;
    
    if (!assert_cond_203700) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x % 2 == 1)",
                               "-> #0  utils.fut:20:3-23\n   #1  /prelude/functional.fut:39:62-64\n   #2  stl.fut:72:13-25\n   #3  stl.fut:415:61-429:75\n   #4  stl.fut:455:3-469:34\n   #5  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_203702 = slt64((int64_t) 0, q_l_203577);
    bool assert_c_203703;
    
    if (!assert_cond_203702) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:17:3-18\n   #1  /prelude/functional.fut:39:59-65\n   #2  stl.fut:72:13-25\n   #3  stl.fut:415:61-429:75\n   #4  stl.fut:455:3-469:34\n   #5  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool cond_203704 = sle64((int64_t) 0, d_t_203579);
    bool assert_cond_t_res_203705 = sle64(d_t_203579, (int64_t) 2);
    bool x_203706 = cond_203704 && assert_cond_t_res_203705;
    bool assert_c_203707;
    
    if (!x_203706) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x >= 0 && x <= 2)",
                               "-> #0  utils.fut:23:3-29\n   #1  stl.fut:74:13-25\n   #2  stl.fut:415:61-429:75\n   #3  stl.fut:455:3-469:34\n   #4  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool cond_203708 = sle64((int64_t) 0, d_l_203580);
    bool assert_cond_t_res_203709 = sle64(d_l_203580, (int64_t) 2);
    bool x_203710 = cond_203708 && assert_cond_t_res_203709;
    bool assert_c_203711;
    
    if (!x_203710) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x >= 0 && x <= 2)",
                               "-> #0  utils.fut:23:3-29\n   #1  stl.fut:75:13-25\n   #2  stl.fut:415:61-429:75\n   #3  stl.fut:455:3-469:34\n   #4  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_203712 = slt64((int64_t) 0, jump_t_203582);
    bool assert_c_203713;
    
    if (!assert_cond_203712) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:17:3-18\n   #1  stl.fut:77:16-31\n   #2  stl.fut:415:61-429:75\n   #3  stl.fut:455:3-469:34\n   #4  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_203714 = slt64((int64_t) 0, jump_l_203583);
    bool assert_c_203715;
    
    if (!assert_cond_203714) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:17:3-18\n   #1  stl.fut:78:16-31\n   #2  stl.fut:415:61-429:75\n   #3  stl.fut:455:3-469:34\n   #4  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_203716 = slt64((int64_t) 0, n_inner_203584);
    bool assert_c_203717;
    
    if (!assert_cond_203716) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:17:3-18\n   #1  stl.fut:80:17-33\n   #2  stl.fut:415:61-429:75\n   #3  stl.fut:455:3-469:34\n   #4  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_203718 = slt64((int64_t) 0, n_outer_203585);
    bool assert_c_203719;
    
    if (!assert_cond_203718) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:17:3-18\n   #1  stl.fut:81:17-33\n   #2  stl.fut:415:61-429:75\n   #3  stl.fut:455:3-469:34\n   #4  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    double ceil_res_203720;
    
    ceil_res_203720 = futrts_ceil64(ceil_arg_203590);
    
    int64_t defunc_0_f_res_203721 = fptosi_f64_i64(ceil_res_203720);
    int64_t pad_css_len_203722 = add64((int64_t) 2, defunc_0_f_res_203721);
    int64_t y_203723 = mul64((int64_t) 2, n_p_203574);
    int64_t C_len_203724 = add64(n_203572, y_203723);
    bool cond_203725 = jump_s_203581 == (int64_t) 1;
    int64_t s_n_m_203726;
    
    if (cond_203725) {
        s_n_m_203726 = pad_css_len_203722;
    } else {
        bool zzero_203727 = jump_s_203581 == (int64_t) 0;
        bool nonzzero_203728 = !zzero_203727;
        bool nonzzero_cert_203729;
        
        if (!nonzzero_203728) {
            ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                   "division by zero",
                                   "-> #0  stl.fut:88:52-71\n   #1  stl.fut:415:61-429:75\n   #2  stl.fut:455:3-469:34\n   #3  stl.fut:439:1-469:34\n");
            if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
                return 1;
            if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") !=
                0)
                return 1;
            err = 1;
            goto cleanup;
        }
        
        int64_t x_203730 = sdiv64(defunc_0_f_res_203721, jump_s_203581);
        int64_t s_n_m_f_res_203731 = add64((int64_t) 3, x_203730);
        
        s_n_m_203726 = s_n_m_f_res_203731;
    }
    
    bool cond_203732 = jump_l_203583 == (int64_t) 1;
    int64_t l_n_m_203733;
    
    if (cond_203732) {
        l_n_m_203733 = n_203572;
    } else {
        bool zzero_203734 = jump_l_203583 == (int64_t) 0;
        bool nonzzero_203735 = !zzero_203734;
        bool nonzzero_cert_203736;
        
        if (!nonzzero_203735) {
            ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                   "division by zero",
                                   "-> #0  stl.fut:94:42-51\n   #1  stl.fut:415:61-429:75\n   #2  stl.fut:455:3-469:34\n   #3  stl.fut:439:1-469:34\n");
            if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
                return 1;
            if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") !=
                0)
                return 1;
            err = 1;
            goto cleanup;
        }
        
        int64_t x_203737 = sdiv64(n_203572, jump_l_203583);
        int64_t l_n_m_f_res_203738 = add64((int64_t) 1, x_203737);
        
        l_n_m_203733 = l_n_m_f_res_203738;
    }
    
    bool cond_203739 = jump_t_203582 == (int64_t) 1;
    int64_t t_n_m_203740;
    
    if (cond_203739) {
        t_n_m_203740 = n_203572;
    } else {
        bool zzero_203741 = jump_t_203582 == (int64_t) 0;
        bool nonzzero_203742 = !zzero_203741;
        bool nonzzero_cert_203743;
        
        if (!nonzzero_203742) {
            ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                   "division by zero",
                                   "-> #0  stl.fut:98:42-51\n   #1  stl.fut:415:61-429:75\n   #2  stl.fut:455:3-469:34\n   #3  stl.fut:439:1-469:34\n");
            if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
                return 1;
            if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") !=
                0)
                return 1;
            err = 1;
            goto cleanup;
        }
        
        int64_t x_203744 = sdiv64(n_203572, jump_t_203582);
        int64_t t_n_m_f_res_203745 = add64((int64_t) 1, x_203744);
        
        t_n_m_203740 = t_n_m_f_res_203745;
    }
    
    double x_203746 = i64_res_203588 / 2.0;
    double floor_arg_203747 = 1.0 + x_203746;
    double floor_res_203748;
    
    floor_res_203748 = futrts_floor64(floor_arg_203747);
    
    int64_t defunc_0_f_res_203749 = fptosi_f64_i64(floor_res_203748);
    int64_t x_203750 = sub64(n_203572, defunc_0_f_res_203749);
    int64_t mid2_203751 = add64((int64_t) 1, x_203750);
    bool cond_203752 = defunc_0_f_res_203749 == mid2_203751;
    int64_t stl_res_t_res_203753 = sub64(defunc_0_f_res_203749, (int64_t) 1);
    int64_t stl_res_203754;
    int64_t stl_res_203755;
    
    if (cond_203752) {
        stl_res_203754 = stl_res_t_res_203753;
        stl_res_203755 = defunc_0_f_res_203749;
    } else {
        int64_t min_res_203756 = smin64(defunc_0_f_res_203749, mid2_203751);
        int64_t stl_res_f_res_203757 = sub64(min_res_203756, (int64_t) 1);
        int64_t max_res_203758 = smax64(defunc_0_f_res_203749, mid2_203751);
        
        stl_res_203754 = stl_res_f_res_203757;
        stl_res_203755 = max_res_203758;
    }
    
    int64_t i_203760 = sub64(n_203572, (int64_t) 1);
    bool x_203761 = sle64((int64_t) 0, i_203760);
    bool y_203762 = slt64(i_203760, n_203572);
    bool bounds_check_203763 = x_203761 && y_203762;
    bool index_certs_203764;
    
    if (!bounds_check_203763) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [", (long long) i_203760,
                               "] out of bounds for array of shape [",
                               (long long) n_203572, "].",
                               "-> #0  /prelude/array.fut:26:29-34\n   #1  utils.fut:45:13-20\n   #2  stl.fut:112:31-49\n   #3  stl.fut:415:61-429:75\n   #4  stl.fut:455:3-469:34\n   #5  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t max_group_sizze_206977;
    
    max_group_sizze_206977 = ctx->opencl.max_group_size;
    
    bool fits_206978 = sle64(n_203572, max_group_sizze_206977);
    bool suff_intra_par_206976;
    
    suff_intra_par_206976 = *ctx->tuning_params.mainzisuff_intra_par_0 <=
        n_203572;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_0",
                (long) n_203572, suff_intra_par_206976 ? "true" : "false");
    
    bool intra_suff_and_fits_206979 = suff_intra_par_206976 && fits_206978;
    int64_t nest_sizze_207090 = n_203572 * partition_sizze_203667;
    int64_t segscan_group_sizze_207091;
    
    segscan_group_sizze_207091 =
        *ctx->tuning_params.mainzisegscan_group_sizze_207071;
    
    int64_t num_groups_207092;
    int32_t max_num_groups_232439;
    
    max_num_groups_232439 = *ctx->tuning_params.mainzisegscan_num_groups_207073;
    num_groups_207092 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(nest_sizze_207090,
                                                             segscan_group_sizze_207091),
                                                   sext_i32_i64(max_num_groups_232439))));
    
    int64_t segmap_group_sizze_207130;
    
    segmap_group_sizze_207130 =
        *ctx->tuning_params.mainzisegmap_group_sizze_207015;
    
    int64_t binop_y_229284 = (int64_t) 8 * nest_sizze_207090;
    int64_t bytes_229285 = smax64((int64_t) 0, binop_y_229284);
    int64_t binop_y_229287 = (int64_t) 8 * partition_sizze_203667;
    int64_t bytes_229288 = smax64((int64_t) 0, binop_y_229287);
    int64_t binop_y_229276 = (int64_t) 8 * n_203572;
    int64_t bytes_229277 = smax64((int64_t) 0, binop_y_229276);
    struct memblock_device ext_mem_229305;
    
    ext_mem_229305.references = NULL;
    
    struct memblock_device ext_mem_229304;
    
    ext_mem_229304.references = NULL;
    
    int32_t local_memory_capacity_232561;
    
    local_memory_capacity_232561 = ctx->opencl.max_local_memory;
    if (sle64(bytes_229277 + srem64((int64_t) 8 - srem64(bytes_229277,
                                                         (int64_t) 8),
                                    (int64_t) 8) + (bytes_229277 +
                                                    srem64((int64_t) 8 -
                                                           srem64(bytes_229277,
                                                                  (int64_t) 8),
                                                           (int64_t) 8)),
              sext_i32_i64(local_memory_capacity_232561)) &&
        intra_suff_and_fits_206979) {
        struct memblock_device mem_229286;
        
        mem_229286.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229286, bytes_229285,
                                  "mem_229286")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229289;
        
        mem_229289.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229289, bytes_229288,
                                  "mem_229289")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_206983,
                                                1, (size_t) bytes_229277,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_206983,
                                                2, (size_t) bytes_229277,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_206983,
                                                3, sizeof(n_203572),
                                                &n_203572));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_206983,
                                                4,
                                                sizeof(partition_sizze_203667),
                                                &partition_sizze_203667));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_206983,
                                                5, sizeof(i_203760),
                                                &i_203760));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_206983,
                                                6, sizeof(mem_229269.mem),
                                                &mem_229269.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_206983,
                                                7, sizeof(mem_229286.mem),
                                                &mem_229286.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_206983,
                                                8, sizeof(mem_229289.mem),
                                                &mem_229289.mem));
        if (1 * ((size_t) partition_sizze_203667 * (size_t) n_203572) != 0) {
            const size_t global_work_sizze_236871[1] =
                         {(size_t) partition_sizze_203667 * (size_t) n_203572};
            const size_t local_work_sizze_236875[1] = {(size_t) n_203572};
            int64_t time_start_236872 = 0, time_end_236873 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                        "main.segmap_intragroup_206983",
                        global_work_sizze_236871[0], local_work_sizze_236875[0],
                        (int) (0 + bytes_229277 + bytes_229277));
                time_start_236872 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_intragroup_206983,
                                                            1, NULL,
                                                            global_work_sizze_236871,
                                                            local_work_sizze_236875,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_intragroup_206983_runs,
                                                                                                      &ctx->mainzisegmap_intragroup_206983_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236873 = get_wall_time();
                
                long time_diff_236874 = time_end_236873 - time_start_236872;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_intragroup_206983", time_diff_236874);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_set_device(ctx, &ext_mem_229305, &mem_229286,
                                "mem_229286") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229304, &mem_229289,
                                "mem_229289") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229289, "mem_229289") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229286, "mem_229286") != 0)
            return 1;
    } else {
        struct memblock_device mem_229294;
        
        mem_229294.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229294, bytes_229285,
                                  "mem_229294")) {
            err = 1;
            goto cleanup;
        }
        if (slt64((int64_t) 0, partition_sizze_203667 * n_203572)) {
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegScan");
            
            int64_t stage1_max_num_groups_232465;
            
            stage1_max_num_groups_232465 = ctx->opencl.max_group_size;
            
            int64_t stage1_num_groups_232466 =
                    smin64(stage1_max_num_groups_232465, num_groups_207092);
            int32_t num_threads_232467 = sext_i64_i32(stage1_num_groups_232466 *
                    segscan_group_sizze_207091);
            
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_207097,
                                                    1,
                                                    (size_t) smax64((int64_t) 1,
                                                                    (int64_t) 8 *
                                                                    segscan_group_sizze_207091),
                                                    NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_207097,
                                                    2, sizeof(n_203572),
                                                    &n_203572));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_207097,
                                                    3,
                                                    sizeof(partition_sizze_203667),
                                                    &partition_sizze_203667));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_207097,
                                                    4,
                                                    sizeof(num_threads_232467),
                                                    &num_threads_232467));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_207097,
                                                    5, sizeof(mem_229269.mem),
                                                    &mem_229269.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_207097,
                                                    6, sizeof(mem_229294.mem),
                                                    &mem_229294.mem));
            if (1 * ((size_t) stage1_num_groups_232466 *
                     (size_t) segscan_group_sizze_207091) != 0) {
                const size_t global_work_sizze_236876[1] =
                             {(size_t) stage1_num_groups_232466 *
                             (size_t) segscan_group_sizze_207091};
                const size_t local_work_sizze_236880[1] =
                             {(size_t) segscan_group_sizze_207091};
                int64_t time_start_236877 = 0, time_end_236878 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                            "main.scan_stage1_207097",
                            global_work_sizze_236876[0],
                            local_work_sizze_236880[0], (int) (0 +
                                                               smax64((int64_t) 1,
                                                                      (int64_t) 8 *
                                                                      segscan_group_sizze_207091)));
                    time_start_236877 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainziscan_stage1_207097,
                                                                1, NULL,
                                                                global_work_sizze_236876,
                                                                local_work_sizze_236880,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainziscan_stage1_207097_runs,
                                                                                                          &ctx->mainziscan_stage1_207097_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_236878 = get_wall_time();
                    
                    long time_diff_236879 = time_end_236878 - time_start_236877;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.scan_stage1_207097", time_diff_236879);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s: %llu%c", "elems_per_group",
                        (long long) (segscan_group_sizze_207091 *
                                     sdiv_up64(partition_sizze_203667 *
                                               n_203572,
                                               sext_i32_i64(num_threads_232467))),
                        '\n');
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_207097,
                                                    1,
                                                    (size_t) smax64((int64_t) 1,
                                                                    (int64_t) 8 *
                                                                    stage1_num_groups_232466),
                                                    NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_207097,
                                                    2, sizeof(n_203572),
                                                    &n_203572));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_207097,
                                                    3,
                                                    sizeof(partition_sizze_203667),
                                                    &partition_sizze_203667));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_207097,
                                                    4,
                                                    sizeof(stage1_num_groups_232466),
                                                    &stage1_num_groups_232466));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_207097,
                                                    5,
                                                    sizeof(num_threads_232467),
                                                    &num_threads_232467));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_207097,
                                                    6, sizeof(mem_229294.mem),
                                                    &mem_229294.mem));
            if (1 * ((size_t) (int64_t) 1 *
                     (size_t) stage1_num_groups_232466) != 0) {
                const size_t global_work_sizze_236881[1] =
                             {(size_t) (int64_t) 1 *
                             (size_t) stage1_num_groups_232466};
                const size_t local_work_sizze_236885[1] =
                             {(size_t) stage1_num_groups_232466};
                int64_t time_start_236882 = 0, time_end_236883 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                            "main.scan_stage2_207097",
                            global_work_sizze_236881[0],
                            local_work_sizze_236885[0], (int) (0 +
                                                               smax64((int64_t) 1,
                                                                      (int64_t) 8 *
                                                                      stage1_num_groups_232466)));
                    time_start_236882 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainziscan_stage2_207097,
                                                                1, NULL,
                                                                global_work_sizze_236881,
                                                                local_work_sizze_236885,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainziscan_stage2_207097_runs,
                                                                                                          &ctx->mainziscan_stage2_207097_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_236883 = get_wall_time();
                    
                    long time_diff_236884 = time_end_236883 - time_start_236882;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.scan_stage2_207097", time_diff_236884);
                }
            }
            
            int32_t required_groups_232518 =
                    sext_i64_i32(sdiv_up64(partition_sizze_203667 * n_203572,
                                           segscan_group_sizze_207091));
            
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_207097,
                                                    1, sizeof(n_203572),
                                                    &n_203572));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_207097,
                                                    2,
                                                    sizeof(partition_sizze_203667),
                                                    &partition_sizze_203667));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_207097,
                                                    3,
                                                    sizeof(num_groups_207092),
                                                    &num_groups_207092));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_207097,
                                                    4,
                                                    sizeof(num_threads_232467),
                                                    &num_threads_232467));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_207097,
                                                    5,
                                                    sizeof(required_groups_232518),
                                                    &required_groups_232518));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_207097,
                                                    6, sizeof(mem_229294.mem),
                                                    &mem_229294.mem));
            if (1 * ((size_t) num_groups_207092 *
                     (size_t) segscan_group_sizze_207091) != 0) {
                const size_t global_work_sizze_236886[1] =
                             {(size_t) num_groups_207092 *
                             (size_t) segscan_group_sizze_207091};
                const size_t local_work_sizze_236890[1] =
                             {(size_t) segscan_group_sizze_207091};
                int64_t time_start_236887 = 0, time_end_236888 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                            "main.scan_stage3_207097",
                            global_work_sizze_236886[0],
                            local_work_sizze_236890[0], (int) 0);
                    time_start_236887 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainziscan_stage3_207097,
                                                                1, NULL,
                                                                global_work_sizze_236886,
                                                                local_work_sizze_236890,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainziscan_stage3_207097_runs,
                                                                                                          &ctx->mainziscan_stage3_207097_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_236888 = get_wall_time();
                    
                    long time_diff_236889 = time_end_236888 - time_start_236887;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.scan_stage3_207097", time_diff_236889);
                }
            }
        }
        
        struct memblock_device mem_229298;
        
        mem_229298.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229298, bytes_229285,
                                  "mem_229298")) {
            err = 1;
            goto cleanup;
        }
        if (futrts_builtinzhreplicate_i64(ctx, mem_229298,
                                          partition_sizze_203667 * n_203572,
                                          (int64_t) -1) != 0) {
            if (memblock_unref_device(ctx, &mem_229298, "mem_229298") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229294, "mem_229294") != 0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
                return 1;
            if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") !=
                0)
                return 1;
            err = 1;
            goto cleanup;
        }
        
        int64_t segmap_usable_groups_207131 = sdiv_up64(nest_sizze_207090,
                                                        segmap_group_sizze_207130);
        
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207135, 1,
                                                sizeof(n_203572), &n_203572));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207135, 2,
                                                sizeof(partition_sizze_203667),
                                                &partition_sizze_203667));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207135, 3,
                                                sizeof(mem_229269.mem),
                                                &mem_229269.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207135, 4,
                                                sizeof(mem_229294.mem),
                                                &mem_229294.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207135, 5,
                                                sizeof(mem_229298.mem),
                                                &mem_229298.mem));
        if (1 * ((size_t) segmap_usable_groups_207131 *
                 (size_t) segmap_group_sizze_207130) != 0) {
            const size_t global_work_sizze_236891[1] =
                         {(size_t) segmap_usable_groups_207131 *
                         (size_t) segmap_group_sizze_207130};
            const size_t local_work_sizze_236895[1] =
                         {(size_t) segmap_group_sizze_207130};
            int64_t time_start_236892 = 0, time_end_236893 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                        "main.segmap_207135", global_work_sizze_236891[0],
                        local_work_sizze_236895[0], (int) 0);
                time_start_236892 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_207135,
                                                            1, NULL,
                                                            global_work_sizze_236891,
                                                            local_work_sizze_236895,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_207135_runs,
                                                                                                      &ctx->mainzisegmap_207135_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236893 = get_wall_time();
                
                long time_diff_236894 = time_end_236893 - time_start_236892;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_207135", time_diff_236894);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        
        struct memblock_device mem_229302;
        
        mem_229302.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229302, bytes_229288,
                                  "mem_229302")) {
            err = 1;
            goto cleanup;
        }
        
        int64_t group_sizze_232555;
        
        group_sizze_232555 = *ctx->tuning_params.mainzigroup_sizze_232555;
        
        int64_t num_groups_232556 = sdiv_up64(partition_sizze_203667,
                                              group_sizze_232555);
        
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_232552, 0,
                                                sizeof(n_203572), &n_203572));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_232552, 1,
                                                sizeof(partition_sizze_203667),
                                                &partition_sizze_203667));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_232552, 2,
                                                sizeof(i_203760), &i_203760));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_232552, 3,
                                                sizeof(mem_229294.mem),
                                                &mem_229294.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_232552, 4,
                                                sizeof(mem_229302.mem),
                                                &mem_229302.mem));
        if (1 * ((size_t) num_groups_232556 * (size_t) group_sizze_232555) !=
            0) {
            const size_t global_work_sizze_236896[1] =
                         {(size_t) num_groups_232556 *
                         (size_t) group_sizze_232555};
            const size_t local_work_sizze_236900[1] =
                         {(size_t) group_sizze_232555};
            int64_t time_start_236897 = 0, time_end_236898 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                        "main.copy_232552", global_work_sizze_236896[0],
                        local_work_sizze_236900[0], (int) 0);
                time_start_236897 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzicopy_232552,
                                                            1, NULL,
                                                            global_work_sizze_236896,
                                                            local_work_sizze_236900,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzicopy_232552_runs,
                                                                                                      &ctx->mainzicopy_232552_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236898 = get_wall_time();
                
                long time_diff_236899 = time_end_236898 - time_start_236897;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.copy_232552", time_diff_236899);
            }
        }
        if (memblock_unref_device(ctx, &mem_229294, "mem_229294") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229305, &mem_229298,
                                "mem_229298") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229304, &mem_229302,
                                "mem_229302") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229302, "mem_229302") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229298, "mem_229298") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229294, "mem_229294") != 0)
            return 1;
    }
    
    bool bounds_invalid_upwards_203788 = slt64(defunc_0_f_res_203721,
                                               (int64_t) 0);
    bool valid_203789 = !bounds_invalid_upwards_203788;
    bool range_valid_c_203790;
    
    if (!valid_203789) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) defunc_0_f_res_203721,
                               " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  stl.fut:119:20-125:36\n   #4  /prelude/soacs.fut:59:3-10\n   #5  /prelude/array.fut:195:3-17\n   #6  utils.fut:6:3-16\n   #7  stl.fut:117:12-126:20\n   #8  stl.fut:116:5-127:11\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t y_207252 = n_p_203574 * defunc_0_f_res_203721;
    int64_t nest_sizze_207253 = partition_sizze_203667 * y_207252;
    int64_t segmap_group_sizze_207254;
    
    segmap_group_sizze_207254 =
        *ctx->tuning_params.mainzisegmap_group_sizze_207172;
    
    int64_t segmap_usable_groups_207255 = sdiv_up64(nest_sizze_207253,
                                                    segmap_group_sizze_207254);
    struct memblock_device mem_229308;
    
    mem_229308.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229308, bytes_229241, "mem_229308")) {
        err = 1;
        goto cleanup;
    }
    if (m_203571 * n_203572 * (int64_t) 8 > 0) {
        OPENCL_SUCCEED_OR_RETURN(clEnqueueCopyBuffer(ctx->opencl.queue,
                                                     mem_229269.mem,
                                                     mem_229308.mem,
                                                     (size_t) (int64_t) 0,
                                                     (size_t) (int64_t) 0,
                                                     (size_t) (m_203571 *
                                                               n_203572 *
                                                               (int64_t) 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));
    }
    
    int64_t binop_x_229310 = n_p_203574 * partition_sizze_203667;
    int64_t binop_x_229311 = defunc_0_f_res_203721 * binop_x_229310;
    int64_t binop_y_229312 = (int64_t) 8 * binop_x_229311;
    int64_t bytes_229313 = smax64((int64_t) 0, binop_y_229312);
    struct memblock_device mem_229314;
    
    mem_229314.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229314, bytes_229313, "mem_229314")) {
        err = 1;
        goto cleanup;
    }
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "\n# SegMap");
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207260, 1,
                                            sizeof(ctx->failure_is_an_option),
                                            &ctx->failure_is_an_option));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207260, 3,
                                            sizeof(n_203572), &n_203572));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207260, 4,
                                            sizeof(n_p_203574), &n_p_203574));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207260, 5,
                                            sizeof(partition_sizze_203667),
                                            &partition_sizze_203667));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207260, 6,
                                            sizeof(defunc_0_f_res_203721),
                                            &defunc_0_f_res_203721));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207260, 7,
                                            sizeof(i_203760), &i_203760));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207260, 8,
                                            sizeof(mem_229308.mem),
                                            &mem_229308.mem));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207260, 9,
                                            sizeof(mem_229314.mem),
                                            &mem_229314.mem));
    if (1 * ((size_t) segmap_usable_groups_207255 *
             (size_t) segmap_group_sizze_207254) != 0) {
        const size_t global_work_sizze_236901[1] =
                     {(size_t) segmap_usable_groups_207255 *
                     (size_t) segmap_group_sizze_207254};
        const size_t local_work_sizze_236905[1] =
                     {(size_t) segmap_group_sizze_207254};
        int64_t time_start_236902 = 0, time_end_236903 = 0;
        
        if (ctx->debugging) {
            fprintf(ctx->log,
                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                    "main.segmap_207260", global_work_sizze_236901[0],
                    local_work_sizze_236905[0], (int) 0);
            time_start_236902 = get_wall_time();
        }
        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                        ctx->mainzisegmap_207260,
                                                        1, NULL,
                                                        global_work_sizze_236901,
                                                        local_work_sizze_236905,
                                                        0, NULL,
                                                        ctx->profiling_paused ||
                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                  &ctx->mainzisegmap_207260_runs,
                                                                                                  &ctx->mainzisegmap_207260_total_runtime)));
        if (ctx->debugging) {
            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
            time_end_236903 = get_wall_time();
            
            long time_diff_236904 = time_end_236903 - time_start_236902;
            
            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                    "main.segmap_207260", time_diff_236904);
        }
    }
    ctx->failure_is_an_option = 1;
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "");
    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
        return 1;
    
    int64_t i_203808 = sub64(defunc_0_f_res_203721, (int64_t) 1);
    bool x_203809 = sle64((int64_t) 0, i_203808);
    bool y_203810 = slt64(i_203808, defunc_0_f_res_203721);
    bool bounds_check_203811 = x_203809 && y_203810;
    bool index_certs_203812;
    
    if (!bounds_check_203811) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [", (long long) i_203808,
                               "] out of bounds for array of shape [",
                               (long long) defunc_0_f_res_203721, "].",
                               "-> #0  /prelude/array.fut:26:29-34\n   #1  utils.fut:45:13-20\n   #2  stl.fut:133:51-67\n   #3  stl.fut:132:12-135:21\n   #4  stl.fut:131:5-136:16\n   #5  stl.fut:415:61-429:75\n   #6  stl.fut:455:3-469:34\n   #7  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t y_207325 = smin64(n_p_203574, y_207252);
    int64_t intra_avail_par_207326 = smin64(y_207252, y_207325);
    int64_t computed_group_sizze_207277 = smax64(n_p_203574, y_207252);
    bool fits_207333 = sle64(computed_group_sizze_207277,
                             max_group_sizze_206977);
    bool suff_intra_par_207331;
    
    suff_intra_par_207331 = *ctx->tuning_params.mainzisuff_intra_par_1 <=
        intra_avail_par_207326;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_1",
                (long) intra_avail_par_207326,
                suff_intra_par_207331 ? "true" : "false");
    
    bool intra_suff_and_fits_207334 = suff_intra_par_207331 && fits_207333;
    bool fits_207604 = sle64(defunc_0_f_res_203721, max_group_sizze_206977);
    bool suff_intra_par_207606;
    
    suff_intra_par_207606 = *ctx->tuning_params.mainzisuff_intra_par_2 <=
        defunc_0_f_res_203721;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_2",
                (long) defunc_0_f_res_203721,
                suff_intra_par_207606 ? "true" : "false");
    
    bool intra_suff_and_fits_207607 = fits_207604 && suff_intra_par_207606;
    int64_t segscan_group_sizze_207642;
    
    segscan_group_sizze_207642 =
        *ctx->tuning_params.mainzisegscan_group_sizze_207509;
    
    int64_t num_groups_207643;
    int32_t max_num_groups_232574;
    
    max_num_groups_232574 = *ctx->tuning_params.mainzisegscan_num_groups_207511;
    num_groups_207643 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(binop_x_229311,
                                                             segscan_group_sizze_207642),
                                                   sext_i32_i64(max_num_groups_232574))));
    
    int64_t segmap_group_sizze_207689;
    
    segmap_group_sizze_207689 =
        *ctx->tuning_params.mainzisegmap_group_sizze_207440;
    
    int64_t binop_y_229332 = (int64_t) 8 * binop_x_229310;
    int64_t bytes_229333 = smax64((int64_t) 0, binop_y_229332);
    int64_t binop_y_229318 = (int64_t) 8 * y_207252;
    int64_t bytes_229319 = smax64((int64_t) 0, binop_y_229318);
    int64_t binop_y_229337 = (int64_t) 8 * defunc_0_f_res_203721;
    int64_t bytes_229338 = smax64((int64_t) 0, binop_y_229337);
    struct memblock_device ext_mem_229373;
    
    ext_mem_229373.references = NULL;
    
    struct memblock_device ext_mem_229372;
    
    ext_mem_229372.references = NULL;
    
    int32_t local_memory_capacity_232724;
    
    local_memory_capacity_232724 = ctx->opencl.max_local_memory;
    if (sle64(bytes_229319 + srem64((int64_t) 8 - srem64(bytes_229319,
                                                         (int64_t) 8),
                                    (int64_t) 8) + (bytes_229319 +
                                                    srem64((int64_t) 8 -
                                                           srem64(bytes_229319,
                                                                  (int64_t) 8),
                                                           (int64_t) 8)),
              sext_i32_i64(local_memory_capacity_232724)) &&
        intra_suff_and_fits_207334) {
        struct memblock_device mem_229330;
        
        mem_229330.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229330, bytes_229313,
                                  "mem_229330")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229334;
        
        mem_229334.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229334, bytes_229333,
                                  "mem_229334")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207338,
                                                1, (size_t) bytes_229319,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207338,
                                                2, (size_t) bytes_229319,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207338,
                                                3, sizeof(n_p_203574),
                                                &n_p_203574));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207338,
                                                4,
                                                sizeof(partition_sizze_203667),
                                                &partition_sizze_203667));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207338,
                                                5,
                                                sizeof(defunc_0_f_res_203721),
                                                &defunc_0_f_res_203721));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207338,
                                                6, sizeof(i_203808),
                                                &i_203808));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207338,
                                                7,
                                                sizeof(computed_group_sizze_207277),
                                                &computed_group_sizze_207277));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207338,
                                                8, sizeof(mem_229314.mem),
                                                &mem_229314.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207338,
                                                9, sizeof(mem_229330.mem),
                                                &mem_229330.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207338,
                                                10, sizeof(mem_229334.mem),
                                                &mem_229334.mem));
        if (1 * ((size_t) partition_sizze_203667 *
                 (size_t) computed_group_sizze_207277) != 0) {
            const size_t global_work_sizze_236906[1] =
                         {(size_t) partition_sizze_203667 *
                         (size_t) computed_group_sizze_207277};
            const size_t local_work_sizze_236910[1] =
                         {(size_t) computed_group_sizze_207277};
            int64_t time_start_236907 = 0, time_end_236908 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                        "main.segmap_intragroup_207338",
                        global_work_sizze_236906[0], local_work_sizze_236910[0],
                        (int) (0 + bytes_229319 + bytes_229319));
                time_start_236907 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_intragroup_207338,
                                                            1, NULL,
                                                            global_work_sizze_236906,
                                                            local_work_sizze_236910,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_intragroup_207338_runs,
                                                                                                      &ctx->mainzisegmap_intragroup_207338_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236908 = get_wall_time();
                
                long time_diff_236909 = time_end_236908 - time_start_236907;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_intragroup_207338", time_diff_236909);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_set_device(ctx, &ext_mem_229373, &mem_229330,
                                "mem_229330") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229372, &mem_229334,
                                "mem_229334") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229334, "mem_229334") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229330, "mem_229330") != 0)
            return 1;
    } else {
        struct memblock_device ext_mem_229371;
        
        ext_mem_229371.references = NULL;
        
        struct memblock_device ext_mem_229370;
        
        ext_mem_229370.references = NULL;
        
        int32_t local_memory_capacity_232723;
        
        local_memory_capacity_232723 = ctx->opencl.max_local_memory;
        if (sle64(bytes_229338 + srem64((int64_t) 8 - srem64(bytes_229338,
                                                             (int64_t) 8),
                                        (int64_t) 8) + (bytes_229338 +
                                                        srem64((int64_t) 8 -
                                                               srem64(bytes_229338,
                                                                      (int64_t) 8),
                                                               (int64_t) 8)),
                  sext_i32_i64(local_memory_capacity_232723)) &&
            intra_suff_and_fits_207607) {
            struct memblock_device mem_229348;
            
            mem_229348.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229348, bytes_229313,
                                      "mem_229348")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_229352;
            
            mem_229352.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229352, bytes_229333,
                                      "mem_229352")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207614,
                                                    1, (size_t) bytes_229338,
                                                    NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207614,
                                                    2, (size_t) bytes_229338,
                                                    NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207614,
                                                    3, sizeof(n_p_203574),
                                                    &n_p_203574));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207614,
                                                    4,
                                                    sizeof(partition_sizze_203667),
                                                    &partition_sizze_203667));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207614,
                                                    5,
                                                    sizeof(defunc_0_f_res_203721),
                                                    &defunc_0_f_res_203721));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207614,
                                                    6, sizeof(i_203808),
                                                    &i_203808));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207614,
                                                    7, sizeof(mem_229314.mem),
                                                    &mem_229314.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207614,
                                                    8, sizeof(mem_229348.mem),
                                                    &mem_229348.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207614,
                                                    9, sizeof(mem_229352.mem),
                                                    &mem_229352.mem));
            if (1 * ((size_t) binop_x_229310 *
                     (size_t) defunc_0_f_res_203721) != 0) {
                const size_t global_work_sizze_236911[1] =
                             {(size_t) binop_x_229310 *
                             (size_t) defunc_0_f_res_203721};
                const size_t local_work_sizze_236915[1] =
                             {(size_t) defunc_0_f_res_203721};
                int64_t time_start_236912 = 0, time_end_236913 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                            "main.segmap_intragroup_207614",
                            global_work_sizze_236911[0],
                            local_work_sizze_236915[0], (int) (0 +
                                                               bytes_229338 +
                                                               bytes_229338));
                    time_start_236912 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_intragroup_207614,
                                                                1, NULL,
                                                                global_work_sizze_236911,
                                                                local_work_sizze_236915,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_intragroup_207614_runs,
                                                                                                          &ctx->mainzisegmap_intragroup_207614_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_236913 = get_wall_time();
                    
                    long time_diff_236914 = time_end_236913 - time_start_236912;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_intragroup_207614", time_diff_236914);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_set_device(ctx, &ext_mem_229371, &mem_229348,
                                    "mem_229348") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_229370, &mem_229352,
                                    "mem_229352") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229352, "mem_229352") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229348, "mem_229348") != 0)
                return 1;
        } else {
            struct memblock_device mem_229358;
            
            mem_229358.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229358, bytes_229313,
                                      "mem_229358")) {
                err = 1;
                goto cleanup;
            }
            if (slt64((int64_t) 0, partition_sizze_203667 * n_p_203574 *
                      defunc_0_f_res_203721)) {
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegScan");
                
                int64_t stage1_max_num_groups_232634;
                
                stage1_max_num_groups_232634 = ctx->opencl.max_group_size;
                
                int64_t stage1_num_groups_232635 =
                        smin64(stage1_max_num_groups_232634, num_groups_207643);
                int32_t num_threads_232636 =
                        sext_i64_i32(stage1_num_groups_232635 *
                        segscan_group_sizze_207642);
                
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_207649,
                                                        1,
                                                        (size_t) smax64((int64_t) 1,
                                                                        (int64_t) 8 *
                                                                        segscan_group_sizze_207642),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_207649,
                                                        2, sizeof(n_p_203574),
                                                        &n_p_203574));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_207649,
                                                        3,
                                                        sizeof(partition_sizze_203667),
                                                        &partition_sizze_203667));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_207649,
                                                        4,
                                                        sizeof(defunc_0_f_res_203721),
                                                        &defunc_0_f_res_203721));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_207649,
                                                        5,
                                                        sizeof(num_threads_232636),
                                                        &num_threads_232636));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_207649,
                                                        6,
                                                        sizeof(mem_229314.mem),
                                                        &mem_229314.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_207649,
                                                        7,
                                                        sizeof(mem_229358.mem),
                                                        &mem_229358.mem));
                if (1 * ((size_t) stage1_num_groups_232635 *
                         (size_t) segscan_group_sizze_207642) != 0) {
                    const size_t global_work_sizze_236916[1] =
                                 {(size_t) stage1_num_groups_232635 *
                                 (size_t) segscan_group_sizze_207642};
                    const size_t local_work_sizze_236920[1] =
                                 {(size_t) segscan_group_sizze_207642};
                    int64_t time_start_236917 = 0, time_end_236918 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.scan_stage1_207649",
                                global_work_sizze_236916[0],
                                local_work_sizze_236920[0], (int) (0 +
                                                                   smax64((int64_t) 1,
                                                                          (int64_t) 8 *
                                                                          segscan_group_sizze_207642)));
                        time_start_236917 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainziscan_stage1_207649,
                                                                    1, NULL,
                                                                    global_work_sizze_236916,
                                                                    local_work_sizze_236920,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainziscan_stage1_207649_runs,
                                                                                                              &ctx->mainziscan_stage1_207649_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_236918 = get_wall_time();
                        
                        long time_diff_236919 = time_end_236918 -
                             time_start_236917;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.scan_stage1_207649", time_diff_236919);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c", "elems_per_group",
                            (long long) (segscan_group_sizze_207642 *
                                         sdiv_up64(partition_sizze_203667 *
                                                   n_p_203574 *
                                                   defunc_0_f_res_203721,
                                                   sext_i32_i64(num_threads_232636))),
                            '\n');
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_207649,
                                                        1,
                                                        (size_t) smax64((int64_t) 1,
                                                                        (int64_t) 8 *
                                                                        stage1_num_groups_232635),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_207649,
                                                        2, sizeof(n_p_203574),
                                                        &n_p_203574));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_207649,
                                                        3,
                                                        sizeof(partition_sizze_203667),
                                                        &partition_sizze_203667));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_207649,
                                                        4,
                                                        sizeof(defunc_0_f_res_203721),
                                                        &defunc_0_f_res_203721));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_207649,
                                                        5,
                                                        sizeof(stage1_num_groups_232635),
                                                        &stage1_num_groups_232635));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_207649,
                                                        6,
                                                        sizeof(num_threads_232636),
                                                        &num_threads_232636));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_207649,
                                                        7,
                                                        sizeof(mem_229358.mem),
                                                        &mem_229358.mem));
                if (1 * ((size_t) (int64_t) 1 *
                         (size_t) stage1_num_groups_232635) != 0) {
                    const size_t global_work_sizze_236921[1] =
                                 {(size_t) (int64_t) 1 *
                                 (size_t) stage1_num_groups_232635};
                    const size_t local_work_sizze_236925[1] =
                                 {(size_t) stage1_num_groups_232635};
                    int64_t time_start_236922 = 0, time_end_236923 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.scan_stage2_207649",
                                global_work_sizze_236921[0],
                                local_work_sizze_236925[0], (int) (0 +
                                                                   smax64((int64_t) 1,
                                                                          (int64_t) 8 *
                                                                          stage1_num_groups_232635)));
                        time_start_236922 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainziscan_stage2_207649,
                                                                    1, NULL,
                                                                    global_work_sizze_236921,
                                                                    local_work_sizze_236925,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainziscan_stage2_207649_runs,
                                                                                                              &ctx->mainziscan_stage2_207649_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_236923 = get_wall_time();
                        
                        long time_diff_236924 = time_end_236923 -
                             time_start_236922;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.scan_stage2_207649", time_diff_236924);
                    }
                }
                
                int32_t required_groups_232687 =
                        sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                               n_p_203574 *
                                               defunc_0_f_res_203721,
                                               segscan_group_sizze_207642));
                
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_207649,
                                                        1, sizeof(n_p_203574),
                                                        &n_p_203574));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_207649,
                                                        2,
                                                        sizeof(partition_sizze_203667),
                                                        &partition_sizze_203667));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_207649,
                                                        3,
                                                        sizeof(defunc_0_f_res_203721),
                                                        &defunc_0_f_res_203721));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_207649,
                                                        4,
                                                        sizeof(num_groups_207643),
                                                        &num_groups_207643));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_207649,
                                                        5,
                                                        sizeof(num_threads_232636),
                                                        &num_threads_232636));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_207649,
                                                        6,
                                                        sizeof(required_groups_232687),
                                                        &required_groups_232687));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_207649,
                                                        7,
                                                        sizeof(mem_229358.mem),
                                                        &mem_229358.mem));
                if (1 * ((size_t) num_groups_207643 *
                         (size_t) segscan_group_sizze_207642) != 0) {
                    const size_t global_work_sizze_236926[1] =
                                 {(size_t) num_groups_207643 *
                                 (size_t) segscan_group_sizze_207642};
                    const size_t local_work_sizze_236930[1] =
                                 {(size_t) segscan_group_sizze_207642};
                    int64_t time_start_236927 = 0, time_end_236928 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.scan_stage3_207649",
                                global_work_sizze_236926[0],
                                local_work_sizze_236930[0], (int) 0);
                        time_start_236927 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainziscan_stage3_207649,
                                                                    1, NULL,
                                                                    global_work_sizze_236926,
                                                                    local_work_sizze_236930,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainziscan_stage3_207649_runs,
                                                                                                              &ctx->mainziscan_stage3_207649_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_236928 = get_wall_time();
                        
                        long time_diff_236929 = time_end_236928 -
                             time_start_236927;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.scan_stage3_207649", time_diff_236929);
                    }
                }
            }
            
            struct memblock_device mem_229363;
            
            mem_229363.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229363, bytes_229313,
                                      "mem_229363")) {
                err = 1;
                goto cleanup;
            }
            if (futrts_builtinzhreplicate_i64(ctx, mem_229363,
                                              partition_sizze_203667 *
                                              n_p_203574 *
                                              defunc_0_f_res_203721,
                                              (int64_t) -1) != 0) {
                if (memblock_unref_device(ctx, &mem_229363, "mem_229363") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229358, "mem_229358") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229370,
                                          "ext_mem_229370") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229371,
                                          "ext_mem_229371") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229372,
                                          "ext_mem_229372") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229373,
                                          "ext_mem_229373") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229304,
                                          "ext_mem_229304") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229305,
                                          "ext_mem_229305") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232074, "color_232074") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232361,
                                          "mem_out_232361") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232360,
                                          "mem_out_232360") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232359,
                                          "mem_out_232359") != 0)
                    return 1;
                err = 1;
                goto cleanup;
            }
            
            int64_t segmap_usable_groups_207690 = sdiv_up64(nest_sizze_207253,
                                                            segmap_group_sizze_207689);
            
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207695, 1,
                                                    sizeof(n_p_203574),
                                                    &n_p_203574));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207695, 2,
                                                    sizeof(partition_sizze_203667),
                                                    &partition_sizze_203667));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207695, 3,
                                                    sizeof(defunc_0_f_res_203721),
                                                    &defunc_0_f_res_203721));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207695, 4,
                                                    sizeof(mem_229314.mem),
                                                    &mem_229314.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207695, 5,
                                                    sizeof(mem_229358.mem),
                                                    &mem_229358.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207695, 6,
                                                    sizeof(mem_229363.mem),
                                                    &mem_229363.mem));
            if (1 * ((size_t) segmap_usable_groups_207690 *
                     (size_t) segmap_group_sizze_207689) != 0) {
                const size_t global_work_sizze_236931[1] =
                             {(size_t) segmap_usable_groups_207690 *
                             (size_t) segmap_group_sizze_207689};
                const size_t local_work_sizze_236935[1] =
                             {(size_t) segmap_group_sizze_207689};
                int64_t time_start_236932 = 0, time_end_236933 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                            "main.segmap_207695", global_work_sizze_236931[0],
                            local_work_sizze_236935[0], (int) 0);
                    time_start_236932 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_207695,
                                                                1, NULL,
                                                                global_work_sizze_236931,
                                                                local_work_sizze_236935,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_207695_runs,
                                                                                                          &ctx->mainzisegmap_207695_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_236933 = get_wall_time();
                    
                    long time_diff_236934 = time_end_236933 - time_start_236932;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_207695", time_diff_236934);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            struct memblock_device mem_229368;
            
            mem_229368.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229368, bytes_229333,
                                      "mem_229368")) {
                err = 1;
                goto cleanup;
            }
            
            int64_t group_sizze_232714;
            
            group_sizze_232714 = *ctx->tuning_params.mainzigroup_sizze_232714;
            
            int64_t num_groups_232715 = sdiv_up64(partition_sizze_203667 *
                                                  n_p_203574,
                                                  group_sizze_232714);
            
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_232711, 0,
                                                    sizeof(n_p_203574),
                                                    &n_p_203574));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_232711, 1,
                                                    sizeof(partition_sizze_203667),
                                                    &partition_sizze_203667));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_232711, 2,
                                                    sizeof(defunc_0_f_res_203721),
                                                    &defunc_0_f_res_203721));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_232711, 3,
                                                    sizeof(i_203808),
                                                    &i_203808));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_232711, 4,
                                                    sizeof(mem_229358.mem),
                                                    &mem_229358.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_232711, 5,
                                                    sizeof(mem_229368.mem),
                                                    &mem_229368.mem));
            if (1 * ((size_t) num_groups_232715 *
                     (size_t) group_sizze_232714) != 0) {
                const size_t global_work_sizze_236936[1] =
                             {(size_t) num_groups_232715 *
                             (size_t) group_sizze_232714};
                const size_t local_work_sizze_236940[1] =
                             {(size_t) group_sizze_232714};
                int64_t time_start_236937 = 0, time_end_236938 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                            "main.copy_232711", global_work_sizze_236936[0],
                            local_work_sizze_236940[0], (int) 0);
                    time_start_236937 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzicopy_232711,
                                                                1, NULL,
                                                                global_work_sizze_236936,
                                                                local_work_sizze_236940,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzicopy_232711_runs,
                                                                                                          &ctx->mainzicopy_232711_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_236938 = get_wall_time();
                    
                    long time_diff_236939 = time_end_236938 - time_start_236937;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.copy_232711", time_diff_236939);
                }
            }
            if (memblock_unref_device(ctx, &mem_229358, "mem_229358") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_229371, &mem_229363,
                                    "mem_229363") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_229370, &mem_229368,
                                    "mem_229368") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229368, "mem_229368") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229363, "mem_229363") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229358, "mem_229358") != 0)
                return 1;
        }
        if (memblock_set_device(ctx, &ext_mem_229373, &ext_mem_229371,
                                "ext_mem_229371") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229372, &ext_mem_229370,
                                "ext_mem_229370") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229370, "ext_mem_229370") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229371, "ext_mem_229371") != 0)
            return 1;
    }
    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
        return 1;
    
    int64_t min_res_203839 = smin64(q_s_203575, defunc_0_f_res_203721);
    bool bounds_invalid_upwards_203840 = slt64(s_n_m_203726, (int64_t) 0);
    bool valid_203841 = !bounds_invalid_upwards_203840;
    bool range_valid_c_203842;
    
    if (!valid_203841) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) s_n_m_203726, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  loess.fut:443:3-470:10\n   #4  loess.fut:517:15-50\n   #5  stl.fut:142:20-80\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:141:12-143:40\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:140:5-144:36\n   #12 stl.fut:415:61-429:75\n   #13 stl.fut:455:3-469:34\n   #14 stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool loop_cond_203844 = slt64((int64_t) 1, min_res_203839);
    double i64_res_203845 = sitofp_i64_f64(q_s_203575);
    int64_t one_intra_par_min_207850 = n_p_203574 * s_n_m_203726;
    int64_t y_207853 = smin64(n_p_203574, one_intra_par_min_207850);
    int64_t intra_avail_par_207854 = smin64(y_207252, y_207853);
    int64_t y_207855 = smax64(n_p_203574, one_intra_par_min_207850);
    int64_t computed_group_sizze_207709 = smax64(y_207252, y_207855);
    bool fits_207862 = sle64(computed_group_sizze_207709,
                             max_group_sizze_206977);
    bool suff_intra_par_207860;
    
    suff_intra_par_207860 = *ctx->tuning_params.mainzisuff_intra_par_3 <=
        intra_avail_par_207854;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_3",
                (long) intra_avail_par_207854,
                suff_intra_par_207860 ? "true" : "false");
    
    bool intra_suff_and_fits_207863 = suff_intra_par_207860 && fits_207862;
    int64_t intra_avail_par_208756 = smin64(defunc_0_f_res_203721,
                                            s_n_m_203726);
    int64_t computed_group_sizze_208757 = smax64(defunc_0_f_res_203721,
                                                 s_n_m_203726);
    bool fits_208761 = sle64(computed_group_sizze_208757,
                             max_group_sizze_206977);
    bool suff_intra_par_208763;
    
    suff_intra_par_208763 = *ctx->tuning_params.mainzisuff_intra_par_4 <=
        intra_avail_par_208756;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_4",
                (long) intra_avail_par_208756,
                suff_intra_par_208763 ? "true" : "false");
    
    bool intra_suff_and_fits_208764 = fits_208761 && suff_intra_par_208763;
    int64_t segmap_group_sizze_208902;
    
    segmap_group_sizze_208902 =
        *ctx->tuning_params.mainzisegmap_group_sizze_208565;
    
    int64_t segmap_group_sizze_208914;
    
    segmap_group_sizze_208914 =
        *ctx->tuning_params.mainzisegmap_group_sizze_208534;
    
    int64_t nest_sizze_208938 = partition_sizze_203667 *
            one_intra_par_min_207850;
    int64_t segmap_group_sizze_208939;
    
    segmap_group_sizze_208939 =
        *ctx->tuning_params.mainzisegmap_group_sizze_208295;
    
    int64_t binop_x_229403 = s_n_m_203726 * binop_x_229310;
    int64_t binop_y_229404 = (int64_t) 8 * binop_x_229403;
    int64_t bytes_229405 = smax64((int64_t) 0, binop_y_229404);
    int64_t binop_y_229381 = (int64_t) 8 * n_p_203574;
    int64_t bytes_229382 = smax64((int64_t) 0, binop_y_229381);
    int64_t binop_y_229395 = (int64_t) 8 * one_intra_par_min_207850;
    int64_t bytes_229396 = smax64((int64_t) 0, binop_y_229395);
    int64_t binop_y_229418 = (int64_t) 8 * s_n_m_203726;
    int64_t bytes_229419 = smax64((int64_t) 0, binop_y_229418);
    struct memblock_device ext_mem_229471;
    
    ext_mem_229471.references = NULL;
    
    struct memblock_device ext_mem_229470;
    
    ext_mem_229470.references = NULL;
    
    int32_t local_memory_capacity_232826;
    
    local_memory_capacity_232826 = ctx->opencl.max_local_memory;
    if (sle64(bytes_229396 + srem64((int64_t) 8 - srem64(bytes_229396,
                                                         (int64_t) 8),
                                    (int64_t) 8) + (bytes_229396 +
                                                    srem64((int64_t) 8 -
                                                           srem64(bytes_229396,
                                                                  (int64_t) 8),
                                                           (int64_t) 8)) +
              (bytes_229382 + srem64((int64_t) 8 - srem64(bytes_229382,
                                                          (int64_t) 8),
                                     (int64_t) 8)) + (bytes_229382 +
                                                      srem64((int64_t) 8 -
                                                             srem64(bytes_229382,
                                                                    (int64_t) 8),
                                                             (int64_t) 8)) +
              (bytes_229382 + srem64((int64_t) 8 - srem64(bytes_229382,
                                                          (int64_t) 8),
                                     (int64_t) 8)) + (bytes_229382 +
                                                      srem64((int64_t) 8 -
                                                             srem64(bytes_229382,
                                                                    (int64_t) 8),
                                                             (int64_t) 8)) +
              (bytes_229319 + srem64((int64_t) 8 - srem64(bytes_229319,
                                                          (int64_t) 8),
                                     (int64_t) 8)),
              sext_i32_i64(local_memory_capacity_232826)) &&
        intra_suff_and_fits_207863) {
        struct memblock_device mem_229406;
        
        mem_229406.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229406, bytes_229405,
                                  "mem_229406")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229411;
        
        mem_229411.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229411, bytes_229405,
                                  "mem_229411")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207867,
                                                1,
                                                sizeof(ctx->failure_is_an_option),
                                                &ctx->failure_is_an_option));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207867,
                                                3, (size_t) bytes_229319,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207867,
                                                4, (size_t) bytes_229382,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207867,
                                                5, (size_t) bytes_229382,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207867,
                                                6, (size_t) bytes_229382,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207867,
                                                7, (size_t) bytes_229382,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207867,
                                                8, (size_t) bytes_229396,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207867,
                                                9, (size_t) bytes_229396,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207867,
                                                10, sizeof(n_p_203574),
                                                &n_p_203574));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207867,
                                                11, sizeof(q_s_203575),
                                                &q_s_203575));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207867,
                                                12, sizeof(jump_s_203581),
                                                &jump_s_203581));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207867,
                                                13,
                                                sizeof(partition_sizze_203667),
                                                &partition_sizze_203667));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207867,
                                                14,
                                                sizeof(defunc_0_f_res_203721),
                                                &defunc_0_f_res_203721));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207867,
                                                15, sizeof(pad_css_len_203722),
                                                &pad_css_len_203722));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207867,
                                                16, sizeof(s_n_m_203726),
                                                &s_n_m_203726));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207867,
                                                17, sizeof(i_203808),
                                                &i_203808));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207867,
                                                18, sizeof(x_203809),
                                                &x_203809));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207867,
                                                19, sizeof(min_res_203839),
                                                &min_res_203839));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207867,
                                                20, sizeof(loop_cond_203844),
                                                &loop_cond_203844));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207867,
                                                21, sizeof(i64_res_203845),
                                                &i64_res_203845));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207867,
                                                22,
                                                sizeof(computed_group_sizze_207709),
                                                &computed_group_sizze_207709));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207867,
                                                23, sizeof(ext_mem_229372.mem),
                                                &ext_mem_229372.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207867,
                                                24, sizeof(ext_mem_229373.mem),
                                                &ext_mem_229373.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207867,
                                                25, sizeof(mem_229406.mem),
                                                &mem_229406.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207867,
                                                26, sizeof(mem_229411.mem),
                                                &mem_229411.mem));
        if (1 * ((size_t) partition_sizze_203667 *
                 (size_t) computed_group_sizze_207709) != 0) {
            const size_t global_work_sizze_236941[1] =
                         {(size_t) partition_sizze_203667 *
                         (size_t) computed_group_sizze_207709};
            const size_t local_work_sizze_236945[1] =
                         {(size_t) computed_group_sizze_207709};
            int64_t time_start_236942 = 0, time_end_236943 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                        "main.segmap_intragroup_207867",
                        global_work_sizze_236941[0], local_work_sizze_236945[0],
                        (int) (0 + bytes_229319 + bytes_229382 + bytes_229382 +
                               bytes_229382 + bytes_229382 + bytes_229396 +
                               bytes_229396));
                time_start_236942 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_intragroup_207867,
                                                            1, NULL,
                                                            global_work_sizze_236941,
                                                            local_work_sizze_236945,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_intragroup_207867_runs,
                                                                                                      &ctx->mainzisegmap_intragroup_207867_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236943 = get_wall_time();
                
                long time_diff_236944 = time_end_236943 - time_start_236942;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_intragroup_207867", time_diff_236944);
            }
        }
        ctx->failure_is_an_option = 1;
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_set_device(ctx, &ext_mem_229471, &mem_229406,
                                "mem_229406") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229470, &mem_229411,
                                "mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229411, "mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229406, "mem_229406") != 0)
            return 1;
    } else {
        struct memblock_device ext_mem_229469;
        
        ext_mem_229469.references = NULL;
        
        struct memblock_device ext_mem_229468;
        
        ext_mem_229468.references = NULL;
        
        int32_t local_memory_capacity_232825;
        
        local_memory_capacity_232825 = ctx->opencl.max_local_memory;
        if (sle64(bytes_229419 + srem64((int64_t) 8 - srem64(bytes_229419,
                                                             (int64_t) 8),
                                        (int64_t) 8) + (bytes_229419 +
                                                        srem64((int64_t) 8 -
                                                               srem64(bytes_229419,
                                                                      (int64_t) 8),
                                                               (int64_t) 8)) +
                  (bytes_229338 + srem64((int64_t) 8 - srem64(bytes_229338,
                                                              (int64_t) 8),
                                         (int64_t) 8)),
                  sext_i32_i64(local_memory_capacity_232825)) &&
            intra_suff_and_fits_208764) {
            struct memblock_device mem_229428;
            
            mem_229428.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229428, bytes_229405,
                                      "mem_229428")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_229433;
            
            mem_229433.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229433, bytes_229405,
                                      "mem_229433")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208771,
                                                    1,
                                                    sizeof(ctx->failure_is_an_option),
                                                    &ctx->failure_is_an_option));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208771,
                                                    3, (size_t) bytes_229338,
                                                    NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208771,
                                                    4, (size_t) bytes_229419,
                                                    NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208771,
                                                    5, (size_t) bytes_229419,
                                                    NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208771,
                                                    6, sizeof(n_p_203574),
                                                    &n_p_203574));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208771,
                                                    7, sizeof(q_s_203575),
                                                    &q_s_203575));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208771,
                                                    8, sizeof(jump_s_203581),
                                                    &jump_s_203581));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208771,
                                                    9,
                                                    sizeof(partition_sizze_203667),
                                                    &partition_sizze_203667));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208771,
                                                    10,
                                                    sizeof(defunc_0_f_res_203721),
                                                    &defunc_0_f_res_203721));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208771,
                                                    11,
                                                    sizeof(pad_css_len_203722),
                                                    &pad_css_len_203722));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208771,
                                                    12, sizeof(s_n_m_203726),
                                                    &s_n_m_203726));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208771,
                                                    13, sizeof(i_203808),
                                                    &i_203808));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208771,
                                                    14, sizeof(x_203809),
                                                    &x_203809));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208771,
                                                    15, sizeof(min_res_203839),
                                                    &min_res_203839));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208771,
                                                    16,
                                                    sizeof(loop_cond_203844),
                                                    &loop_cond_203844));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208771,
                                                    17, sizeof(i64_res_203845),
                                                    &i64_res_203845));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208771,
                                                    18,
                                                    sizeof(computed_group_sizze_208757),
                                                    &computed_group_sizze_208757));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208771,
                                                    19,
                                                    sizeof(ext_mem_229372.mem),
                                                    &ext_mem_229372.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208771,
                                                    20,
                                                    sizeof(ext_mem_229373.mem),
                                                    &ext_mem_229373.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208771,
                                                    21, sizeof(mem_229428.mem),
                                                    &mem_229428.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208771,
                                                    22, sizeof(mem_229433.mem),
                                                    &mem_229433.mem));
            if (1 * ((size_t) binop_x_229310 *
                     (size_t) computed_group_sizze_208757) != 0) {
                const size_t global_work_sizze_236946[1] =
                             {(size_t) binop_x_229310 *
                             (size_t) computed_group_sizze_208757};
                const size_t local_work_sizze_236950[1] =
                             {(size_t) computed_group_sizze_208757};
                int64_t time_start_236947 = 0, time_end_236948 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                            "main.segmap_intragroup_208771",
                            global_work_sizze_236946[0],
                            local_work_sizze_236950[0], (int) (0 +
                                                               bytes_229338 +
                                                               bytes_229419 +
                                                               bytes_229419));
                    time_start_236947 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_intragroup_208771,
                                                                1, NULL,
                                                                global_work_sizze_236946,
                                                                local_work_sizze_236950,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_intragroup_208771_runs,
                                                                                                          &ctx->mainzisegmap_intragroup_208771_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_236948 = get_wall_time();
                    
                    long time_diff_236949 = time_end_236948 - time_start_236947;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_intragroup_208771", time_diff_236949);
                }
            }
            ctx->failure_is_an_option = 1;
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_set_device(ctx, &ext_mem_229469, &mem_229428,
                                    "mem_229428") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_229468, &mem_229433,
                                    "mem_229433") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229433, "mem_229433") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229428, "mem_229428") != 0)
                return 1;
        } else {
            int64_t segmap_usable_groups_208903 = sdiv_up64(nest_sizze_207253,
                                                            segmap_group_sizze_208902);
            struct memblock_device mem_229439;
            
            mem_229439.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229439, bytes_229313,
                                      "mem_229439")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208908, 1,
                                                    sizeof(n_p_203574),
                                                    &n_p_203574));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208908, 2,
                                                    sizeof(partition_sizze_203667),
                                                    &partition_sizze_203667));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208908, 3,
                                                    sizeof(defunc_0_f_res_203721),
                                                    &defunc_0_f_res_203721));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208908, 4,
                                                    sizeof(ext_mem_229373.mem),
                                                    &ext_mem_229373.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208908, 5,
                                                    sizeof(mem_229439.mem),
                                                    &mem_229439.mem));
            if (1 * ((size_t) segmap_usable_groups_208903 *
                     (size_t) segmap_group_sizze_208902) != 0) {
                const size_t global_work_sizze_236951[1] =
                             {(size_t) segmap_usable_groups_208903 *
                             (size_t) segmap_group_sizze_208902};
                const size_t local_work_sizze_236955[1] =
                             {(size_t) segmap_group_sizze_208902};
                int64_t time_start_236952 = 0, time_end_236953 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                            "main.segmap_208908", global_work_sizze_236951[0],
                            local_work_sizze_236955[0], (int) 0);
                    time_start_236952 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_208908,
                                                                1, NULL,
                                                                global_work_sizze_236951,
                                                                local_work_sizze_236955,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_208908_runs,
                                                                                                          &ctx->mainzisegmap_208908_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_236953 = get_wall_time();
                    
                    long time_diff_236954 = time_end_236953 - time_start_236952;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_208908", time_diff_236954);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            int64_t segmap_usable_groups_208915 = sdiv_up64(binop_x_229310,
                                                            segmap_group_sizze_208914);
            struct memblock_device mem_229444;
            
            mem_229444.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229444, bytes_229333,
                                      "mem_229444")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_229448;
            
            mem_229448.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229448, bytes_229333,
                                      "mem_229448")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_229452;
            
            mem_229452.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229452, bytes_229333,
                                      "mem_229452")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_229456;
            
            mem_229456.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229456, bytes_229333,
                                      "mem_229456")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208922, 1,
                                                    sizeof(n_p_203574),
                                                    &n_p_203574));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208922, 2,
                                                    sizeof(q_s_203575),
                                                    &q_s_203575));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208922, 3,
                                                    sizeof(partition_sizze_203667),
                                                    &partition_sizze_203667));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208922, 4,
                                                    sizeof(min_res_203839),
                                                    &min_res_203839));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208922, 5,
                                                    sizeof(i64_res_203845),
                                                    &i64_res_203845));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208922, 6,
                                                    sizeof(ext_mem_229372.mem),
                                                    &ext_mem_229372.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208922, 7,
                                                    sizeof(mem_229444.mem),
                                                    &mem_229444.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208922, 8,
                                                    sizeof(mem_229448.mem),
                                                    &mem_229448.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208922, 9,
                                                    sizeof(mem_229452.mem),
                                                    &mem_229452.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208922,
                                                    10, sizeof(mem_229456.mem),
                                                    &mem_229456.mem));
            if (1 * ((size_t) segmap_usable_groups_208915 *
                     (size_t) segmap_group_sizze_208914) != 0) {
                const size_t global_work_sizze_236956[1] =
                             {(size_t) segmap_usable_groups_208915 *
                             (size_t) segmap_group_sizze_208914};
                const size_t local_work_sizze_236960[1] =
                             {(size_t) segmap_group_sizze_208914};
                int64_t time_start_236957 = 0, time_end_236958 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                            "main.segmap_208922", global_work_sizze_236956[0],
                            local_work_sizze_236960[0], (int) 0);
                    time_start_236957 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_208922,
                                                                1, NULL,
                                                                global_work_sizze_236956,
                                                                local_work_sizze_236960,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_208922_runs,
                                                                                                          &ctx->mainzisegmap_208922_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_236958 = get_wall_time();
                    
                    long time_diff_236959 = time_end_236958 - time_start_236957;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_208922", time_diff_236959);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            int64_t segmap_usable_groups_208940 = sdiv_up64(nest_sizze_208938,
                                                            segmap_group_sizze_208939);
            struct memblock_device mem_229462;
            
            mem_229462.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229462, bytes_229405,
                                      "mem_229462")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_229467;
            
            mem_229467.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229467, bytes_229405,
                                      "mem_229467")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208946, 1,
                                                    sizeof(ctx->failure_is_an_option),
                                                    &ctx->failure_is_an_option));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208946, 3,
                                                    sizeof(n_p_203574),
                                                    &n_p_203574));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208946, 4,
                                                    sizeof(jump_s_203581),
                                                    &jump_s_203581));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208946, 5,
                                                    sizeof(partition_sizze_203667),
                                                    &partition_sizze_203667));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208946, 6,
                                                    sizeof(defunc_0_f_res_203721),
                                                    &defunc_0_f_res_203721));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208946, 7,
                                                    sizeof(pad_css_len_203722),
                                                    &pad_css_len_203722));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208946, 8,
                                                    sizeof(s_n_m_203726),
                                                    &s_n_m_203726));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208946, 9,
                                                    sizeof(i_203808),
                                                    &i_203808));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208946,
                                                    10, sizeof(x_203809),
                                                    &x_203809));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208946,
                                                    11, sizeof(min_res_203839),
                                                    &min_res_203839));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208946,
                                                    12,
                                                    sizeof(loop_cond_203844),
                                                    &loop_cond_203844));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208946,
                                                    13, sizeof(mem_229439.mem),
                                                    &mem_229439.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208946,
                                                    14, sizeof(mem_229444.mem),
                                                    &mem_229444.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208946,
                                                    15, sizeof(mem_229448.mem),
                                                    &mem_229448.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208946,
                                                    16, sizeof(mem_229452.mem),
                                                    &mem_229452.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208946,
                                                    17, sizeof(mem_229456.mem),
                                                    &mem_229456.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208946,
                                                    18, sizeof(mem_229462.mem),
                                                    &mem_229462.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208946,
                                                    19, sizeof(mem_229467.mem),
                                                    &mem_229467.mem));
            if (1 * ((size_t) segmap_usable_groups_208940 *
                     (size_t) segmap_group_sizze_208939) != 0) {
                const size_t global_work_sizze_236961[1] =
                             {(size_t) segmap_usable_groups_208940 *
                             (size_t) segmap_group_sizze_208939};
                const size_t local_work_sizze_236965[1] =
                             {(size_t) segmap_group_sizze_208939};
                int64_t time_start_236962 = 0, time_end_236963 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                            "main.segmap_208946", global_work_sizze_236961[0],
                            local_work_sizze_236965[0], (int) 0);
                    time_start_236962 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_208946,
                                                                1, NULL,
                                                                global_work_sizze_236961,
                                                                local_work_sizze_236965,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_208946_runs,
                                                                                                          &ctx->mainzisegmap_208946_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_236963 = get_wall_time();
                    
                    long time_diff_236964 = time_end_236963 - time_start_236962;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_208946", time_diff_236964);
                }
            }
            ctx->failure_is_an_option = 1;
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_unref_device(ctx, &mem_229439, "mem_229439") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229444, "mem_229444") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229448, "mem_229448") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229452, "mem_229452") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229456, "mem_229456") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_229469, &mem_229467,
                                    "mem_229467") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_229468, &mem_229462,
                                    "mem_229462") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229467, "mem_229467") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229462, "mem_229462") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229456, "mem_229456") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229452, "mem_229452") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229448, "mem_229448") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229444, "mem_229444") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229439, "mem_229439") != 0)
                return 1;
        }
        if (memblock_set_device(ctx, &ext_mem_229471, &ext_mem_229469,
                                "ext_mem_229469") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229470, &ext_mem_229468,
                                "ext_mem_229468") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229468, "ext_mem_229468") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229469, "ext_mem_229469") != 0)
            return 1;
    }
    
    int64_t min_res_203971 = smin64(n_203572, q_l_203577);
    bool bounds_invalid_upwards_203972 = slt64(l_n_m_203733, (int64_t) 0);
    bool valid_203973 = !bounds_invalid_upwards_203972;
    bool range_valid_c_203974;
    
    if (!valid_203973) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) l_n_m_203733, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  loess.fut:443:3-470:10\n   #4  loess.fut:503:15-61\n   #5  stl.fut:150:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:148:5-151:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool loop_cond_203976 = slt64((int64_t) 1, min_res_203971);
    double i64_res_203977 = sitofp_i64_f64(q_l_203577);
    int64_t intra_avail_par_209161 = smin64(n_203572, l_n_m_203733);
    int64_t computed_group_sizze_209063 = smax64(n_203572, l_n_m_203733);
    bool fits_209167 = sle64(computed_group_sizze_209063,
                             max_group_sizze_206977);
    bool suff_intra_par_209165;
    
    suff_intra_par_209165 = *ctx->tuning_params.mainzisuff_intra_par_5 <=
        intra_avail_par_209161;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_5",
                (long) intra_avail_par_209161,
                suff_intra_par_209165 ? "true" : "false");
    
    bool intra_suff_and_fits_209168 = suff_intra_par_209165 && fits_209167;
    int64_t segmap_group_sizze_209551;
    
    segmap_group_sizze_209551 =
        *ctx->tuning_params.mainzisegmap_group_sizze_209527;
    
    int64_t segmap_group_sizze_209561;
    
    segmap_group_sizze_209561 =
        *ctx->tuning_params.mainzisegmap_group_sizze_209501;
    
    int64_t nest_sizze_209582 = partition_sizze_203667 * l_n_m_203733;
    int64_t segmap_group_sizze_209583;
    
    segmap_group_sizze_209583 =
        *ctx->tuning_params.mainzisegmap_group_sizze_209297;
    
    int64_t binop_y_229485 = (int64_t) 8 * nest_sizze_209582;
    int64_t bytes_229486 = smax64((int64_t) 0, binop_y_229485);
    int64_t binop_y_229478 = (int64_t) 8 * l_n_m_203733;
    int64_t bytes_229479 = smax64((int64_t) 0, binop_y_229478);
    struct memblock_device ext_mem_229520;
    
    ext_mem_229520.references = NULL;
    
    struct memblock_device ext_mem_229519;
    
    ext_mem_229519.references = NULL;
    
    int32_t local_memory_capacity_232886;
    
    local_memory_capacity_232886 = ctx->opencl.max_local_memory;
    if (sle64(bytes_229479 + srem64((int64_t) 8 - srem64(bytes_229479,
                                                         (int64_t) 8),
                                    (int64_t) 8) + (bytes_229479 +
                                                    srem64((int64_t) 8 -
                                                           srem64(bytes_229479,
                                                                  (int64_t) 8),
                                                           (int64_t) 8)) +
              (bytes_229277 + srem64((int64_t) 8 - srem64(bytes_229277,
                                                          (int64_t) 8),
                                     (int64_t) 8)),
              sext_i32_i64(local_memory_capacity_232886)) &&
        intra_suff_and_fits_209168) {
        struct memblock_device mem_229487;
        
        mem_229487.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229487, bytes_229486,
                                  "mem_229487")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229491;
        
        mem_229491.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229491, bytes_229486,
                                  "mem_229491")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209172,
                                                1,
                                                sizeof(ctx->failure_is_an_option),
                                                &ctx->failure_is_an_option));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209172,
                                                3, (size_t) bytes_229277,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209172,
                                                4, (size_t) bytes_229479,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209172,
                                                5, (size_t) bytes_229479,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209172,
                                                6, sizeof(n_203572),
                                                &n_203572));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209172,
                                                7, sizeof(q_l_203577),
                                                &q_l_203577));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209172,
                                                8, sizeof(jump_l_203583),
                                                &jump_l_203583));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209172,
                                                9,
                                                sizeof(partition_sizze_203667),
                                                &partition_sizze_203667));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209172,
                                                10, sizeof(l_n_m_203733),
                                                &l_n_m_203733));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209172,
                                                11, sizeof(i_203760),
                                                &i_203760));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209172,
                                                12, sizeof(x_203761),
                                                &x_203761));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209172,
                                                13, sizeof(min_res_203971),
                                                &min_res_203971));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209172,
                                                14, sizeof(loop_cond_203976),
                                                &loop_cond_203976));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209172,
                                                15, sizeof(i64_res_203977),
                                                &i64_res_203977));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209172,
                                                16,
                                                sizeof(computed_group_sizze_209063),
                                                &computed_group_sizze_209063));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209172,
                                                17, sizeof(ext_mem_229304.mem),
                                                &ext_mem_229304.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209172,
                                                18, sizeof(ext_mem_229305.mem),
                                                &ext_mem_229305.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209172,
                                                19, sizeof(mem_229487.mem),
                                                &mem_229487.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209172,
                                                20, sizeof(mem_229491.mem),
                                                &mem_229491.mem));
        if (1 * ((size_t) partition_sizze_203667 *
                 (size_t) computed_group_sizze_209063) != 0) {
            const size_t global_work_sizze_236966[1] =
                         {(size_t) partition_sizze_203667 *
                         (size_t) computed_group_sizze_209063};
            const size_t local_work_sizze_236970[1] =
                         {(size_t) computed_group_sizze_209063};
            int64_t time_start_236967 = 0, time_end_236968 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                        "main.segmap_intragroup_209172",
                        global_work_sizze_236966[0], local_work_sizze_236970[0],
                        (int) (0 + bytes_229277 + bytes_229479 + bytes_229479));
                time_start_236967 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_intragroup_209172,
                                                            1, NULL,
                                                            global_work_sizze_236966,
                                                            local_work_sizze_236970,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_intragroup_209172_runs,
                                                                                                      &ctx->mainzisegmap_intragroup_209172_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236968 = get_wall_time();
                
                long time_diff_236969 = time_end_236968 - time_start_236967;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_intragroup_209172", time_diff_236969);
            }
        }
        ctx->failure_is_an_option = 1;
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_set_device(ctx, &ext_mem_229520, &mem_229487,
                                "mem_229487") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229519, &mem_229491,
                                "mem_229491") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229491, "mem_229491") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229487, "mem_229487") != 0)
            return 1;
    } else {
        int64_t segmap_usable_groups_209552 = sdiv_up64(nest_sizze_207090,
                                                        segmap_group_sizze_209551);
        struct memblock_device mem_229496;
        
        mem_229496.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229496, bytes_229285,
                                  "mem_229496")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209556, 1,
                                                sizeof(n_203572), &n_203572));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209556, 2,
                                                sizeof(partition_sizze_203667),
                                                &partition_sizze_203667));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209556, 3,
                                                sizeof(ext_mem_229305.mem),
                                                &ext_mem_229305.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209556, 4,
                                                sizeof(mem_229496.mem),
                                                &mem_229496.mem));
        if (1 * ((size_t) segmap_usable_groups_209552 *
                 (size_t) segmap_group_sizze_209551) != 0) {
            const size_t global_work_sizze_236971[1] =
                         {(size_t) segmap_usable_groups_209552 *
                         (size_t) segmap_group_sizze_209551};
            const size_t local_work_sizze_236975[1] =
                         {(size_t) segmap_group_sizze_209551};
            int64_t time_start_236972 = 0, time_end_236973 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                        "main.segmap_209556", global_work_sizze_236971[0],
                        local_work_sizze_236975[0], (int) 0);
                time_start_236972 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_209556,
                                                            1, NULL,
                                                            global_work_sizze_236971,
                                                            local_work_sizze_236975,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_209556_runs,
                                                                                                      &ctx->mainzisegmap_209556_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236973 = get_wall_time();
                
                long time_diff_236974 = time_end_236973 - time_start_236972;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_209556", time_diff_236974);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        
        int64_t segmap_usable_groups_209562 = sdiv_up64(partition_sizze_203667,
                                                        segmap_group_sizze_209561);
        struct memblock_device mem_229500;
        
        mem_229500.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229500, bytes_229288,
                                  "mem_229500")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229503;
        
        mem_229503.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229503, bytes_229288,
                                  "mem_229503")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229506;
        
        mem_229506.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229506, bytes_229288,
                                  "mem_229506")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229509;
        
        mem_229509.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229509, bytes_229288,
                                  "mem_229509")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209568, 1,
                                                sizeof(q_l_203577),
                                                &q_l_203577));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209568, 2,
                                                sizeof(partition_sizze_203667),
                                                &partition_sizze_203667));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209568, 3,
                                                sizeof(min_res_203971),
                                                &min_res_203971));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209568, 4,
                                                sizeof(i64_res_203977),
                                                &i64_res_203977));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209568, 5,
                                                sizeof(ext_mem_229304.mem),
                                                &ext_mem_229304.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209568, 6,
                                                sizeof(mem_229500.mem),
                                                &mem_229500.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209568, 7,
                                                sizeof(mem_229503.mem),
                                                &mem_229503.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209568, 8,
                                                sizeof(mem_229506.mem),
                                                &mem_229506.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209568, 9,
                                                sizeof(mem_229509.mem),
                                                &mem_229509.mem));
        if (1 * ((size_t) segmap_usable_groups_209562 *
                 (size_t) segmap_group_sizze_209561) != 0) {
            const size_t global_work_sizze_236976[1] =
                         {(size_t) segmap_usable_groups_209562 *
                         (size_t) segmap_group_sizze_209561};
            const size_t local_work_sizze_236980[1] =
                         {(size_t) segmap_group_sizze_209561};
            int64_t time_start_236977 = 0, time_end_236978 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                        "main.segmap_209568", global_work_sizze_236976[0],
                        local_work_sizze_236980[0], (int) 0);
                time_start_236977 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_209568,
                                                            1, NULL,
                                                            global_work_sizze_236976,
                                                            local_work_sizze_236980,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_209568_runs,
                                                                                                      &ctx->mainzisegmap_209568_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236978 = get_wall_time();
                
                long time_diff_236979 = time_end_236978 - time_start_236977;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_209568", time_diff_236979);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        
        int64_t segmap_usable_groups_209584 = sdiv_up64(nest_sizze_209582,
                                                        segmap_group_sizze_209583);
        struct memblock_device mem_229514;
        
        mem_229514.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229514, bytes_229486,
                                  "mem_229514")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229518;
        
        mem_229518.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229518, bytes_229486,
                                  "mem_229518")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209589, 1,
                                                sizeof(ctx->failure_is_an_option),
                                                &ctx->failure_is_an_option));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209589, 3,
                                                sizeof(n_203572), &n_203572));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209589, 4,
                                                sizeof(jump_l_203583),
                                                &jump_l_203583));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209589, 5,
                                                sizeof(partition_sizze_203667),
                                                &partition_sizze_203667));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209589, 6,
                                                sizeof(l_n_m_203733),
                                                &l_n_m_203733));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209589, 7,
                                                sizeof(i_203760), &i_203760));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209589, 8,
                                                sizeof(x_203761), &x_203761));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209589, 9,
                                                sizeof(min_res_203971),
                                                &min_res_203971));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209589, 10,
                                                sizeof(loop_cond_203976),
                                                &loop_cond_203976));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209589, 11,
                                                sizeof(ext_mem_229305.mem),
                                                &ext_mem_229305.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209589, 12,
                                                sizeof(mem_229496.mem),
                                                &mem_229496.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209589, 13,
                                                sizeof(mem_229500.mem),
                                                &mem_229500.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209589, 14,
                                                sizeof(mem_229503.mem),
                                                &mem_229503.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209589, 15,
                                                sizeof(mem_229506.mem),
                                                &mem_229506.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209589, 16,
                                                sizeof(mem_229509.mem),
                                                &mem_229509.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209589, 17,
                                                sizeof(mem_229514.mem),
                                                &mem_229514.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209589, 18,
                                                sizeof(mem_229518.mem),
                                                &mem_229518.mem));
        if (1 * ((size_t) segmap_usable_groups_209584 *
                 (size_t) segmap_group_sizze_209583) != 0) {
            const size_t global_work_sizze_236981[1] =
                         {(size_t) segmap_usable_groups_209584 *
                         (size_t) segmap_group_sizze_209583};
            const size_t local_work_sizze_236985[1] =
                         {(size_t) segmap_group_sizze_209583};
            int64_t time_start_236982 = 0, time_end_236983 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                        "main.segmap_209589", global_work_sizze_236981[0],
                        local_work_sizze_236985[0], (int) 0);
                time_start_236982 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_209589,
                                                            1, NULL,
                                                            global_work_sizze_236981,
                                                            local_work_sizze_236985,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_209589_runs,
                                                                                                      &ctx->mainzisegmap_209589_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236983 = get_wall_time();
                
                long time_diff_236984 = time_end_236983 - time_start_236982;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_209589", time_diff_236984);
            }
        }
        ctx->failure_is_an_option = 1;
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_unref_device(ctx, &mem_229496, "mem_229496") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229500, "mem_229500") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229503, "mem_229503") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229506, "mem_229506") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229509, "mem_229509") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229520, &mem_229518,
                                "mem_229518") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229519, &mem_229514,
                                "mem_229514") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229518, "mem_229518") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229514, "mem_229514") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229509, "mem_229509") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229506, "mem_229506") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229503, "mem_229503") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229500, "mem_229500") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229496, "mem_229496") != 0)
            return 1;
    }
    
    int64_t min_res_204083 = smin64(n_203572, q_t_203576);
    bool bounds_invalid_upwards_204084 = slt64(t_n_m_203740, (int64_t) 0);
    bool valid_204085 = !bounds_invalid_upwards_204084;
    bool range_valid_c_204086;
    
    if (!valid_204085) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) t_n_m_203740, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  loess.fut:443:3-470:10\n   #4  loess.fut:503:15-61\n   #5  stl.fut:157:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:155:5-158:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool loop_cond_204088 = slt64((int64_t) 1, min_res_204083);
    double i64_res_204089 = sitofp_i64_f64(q_t_203576);
    int64_t intra_avail_par_209787 = smin64(n_203572, t_n_m_203740);
    int64_t computed_group_sizze_209689 = smax64(n_203572, t_n_m_203740);
    bool fits_209793 = sle64(computed_group_sizze_209689,
                             max_group_sizze_206977);
    bool suff_intra_par_209791;
    
    suff_intra_par_209791 = *ctx->tuning_params.mainzisuff_intra_par_6 <=
        intra_avail_par_209787;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_6",
                (long) intra_avail_par_209787,
                suff_intra_par_209791 ? "true" : "false");
    
    bool intra_suff_and_fits_209794 = suff_intra_par_209791 && fits_209793;
    int64_t segmap_group_sizze_210177;
    
    segmap_group_sizze_210177 =
        *ctx->tuning_params.mainzisegmap_group_sizze_210153;
    
    int64_t segmap_group_sizze_210187;
    
    segmap_group_sizze_210187 =
        *ctx->tuning_params.mainzisegmap_group_sizze_210127;
    
    int64_t nest_sizze_210208 = partition_sizze_203667 * t_n_m_203740;
    int64_t segmap_group_sizze_210209;
    
    segmap_group_sizze_210209 =
        *ctx->tuning_params.mainzisegmap_group_sizze_209923;
    
    int64_t binop_y_229534 = (int64_t) 8 * nest_sizze_210208;
    int64_t bytes_229535 = smax64((int64_t) 0, binop_y_229534);
    int64_t binop_y_229527 = (int64_t) 8 * t_n_m_203740;
    int64_t bytes_229528 = smax64((int64_t) 0, binop_y_229527);
    struct memblock_device ext_mem_229569;
    
    ext_mem_229569.references = NULL;
    
    struct memblock_device ext_mem_229568;
    
    ext_mem_229568.references = NULL;
    
    int32_t local_memory_capacity_232946;
    
    local_memory_capacity_232946 = ctx->opencl.max_local_memory;
    if (sle64(bytes_229528 + srem64((int64_t) 8 - srem64(bytes_229528,
                                                         (int64_t) 8),
                                    (int64_t) 8) + (bytes_229528 +
                                                    srem64((int64_t) 8 -
                                                           srem64(bytes_229528,
                                                                  (int64_t) 8),
                                                           (int64_t) 8)) +
              (bytes_229277 + srem64((int64_t) 8 - srem64(bytes_229277,
                                                          (int64_t) 8),
                                     (int64_t) 8)),
              sext_i32_i64(local_memory_capacity_232946)) &&
        intra_suff_and_fits_209794) {
        struct memblock_device mem_229536;
        
        mem_229536.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229536, bytes_229535,
                                  "mem_229536")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229540;
        
        mem_229540.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229540, bytes_229535,
                                  "mem_229540")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209798,
                                                1,
                                                sizeof(ctx->failure_is_an_option),
                                                &ctx->failure_is_an_option));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209798,
                                                3, (size_t) bytes_229277,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209798,
                                                4, (size_t) bytes_229528,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209798,
                                                5, (size_t) bytes_229528,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209798,
                                                6, sizeof(n_203572),
                                                &n_203572));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209798,
                                                7, sizeof(q_t_203576),
                                                &q_t_203576));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209798,
                                                8, sizeof(jump_t_203582),
                                                &jump_t_203582));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209798,
                                                9,
                                                sizeof(partition_sizze_203667),
                                                &partition_sizze_203667));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209798,
                                                10, sizeof(t_n_m_203740),
                                                &t_n_m_203740));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209798,
                                                11, sizeof(i_203760),
                                                &i_203760));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209798,
                                                12, sizeof(x_203761),
                                                &x_203761));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209798,
                                                13, sizeof(min_res_204083),
                                                &min_res_204083));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209798,
                                                14, sizeof(loop_cond_204088),
                                                &loop_cond_204088));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209798,
                                                15, sizeof(i64_res_204089),
                                                &i64_res_204089));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209798,
                                                16,
                                                sizeof(computed_group_sizze_209689),
                                                &computed_group_sizze_209689));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209798,
                                                17, sizeof(ext_mem_229304.mem),
                                                &ext_mem_229304.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209798,
                                                18, sizeof(ext_mem_229305.mem),
                                                &ext_mem_229305.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209798,
                                                19, sizeof(mem_229536.mem),
                                                &mem_229536.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209798,
                                                20, sizeof(mem_229540.mem),
                                                &mem_229540.mem));
        if (1 * ((size_t) partition_sizze_203667 *
                 (size_t) computed_group_sizze_209689) != 0) {
            const size_t global_work_sizze_236986[1] =
                         {(size_t) partition_sizze_203667 *
                         (size_t) computed_group_sizze_209689};
            const size_t local_work_sizze_236990[1] =
                         {(size_t) computed_group_sizze_209689};
            int64_t time_start_236987 = 0, time_end_236988 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                        "main.segmap_intragroup_209798",
                        global_work_sizze_236986[0], local_work_sizze_236990[0],
                        (int) (0 + bytes_229277 + bytes_229528 + bytes_229528));
                time_start_236987 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_intragroup_209798,
                                                            1, NULL,
                                                            global_work_sizze_236986,
                                                            local_work_sizze_236990,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_intragroup_209798_runs,
                                                                                                      &ctx->mainzisegmap_intragroup_209798_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236988 = get_wall_time();
                
                long time_diff_236989 = time_end_236988 - time_start_236987;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_intragroup_209798", time_diff_236989);
            }
        }
        ctx->failure_is_an_option = 1;
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_set_device(ctx, &ext_mem_229569, &mem_229536,
                                "mem_229536") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229568, &mem_229540,
                                "mem_229540") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229540, "mem_229540") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229536, "mem_229536") != 0)
            return 1;
    } else {
        int64_t segmap_usable_groups_210178 = sdiv_up64(nest_sizze_207090,
                                                        segmap_group_sizze_210177);
        struct memblock_device mem_229545;
        
        mem_229545.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229545, bytes_229285,
                                  "mem_229545")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210182, 1,
                                                sizeof(n_203572), &n_203572));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210182, 2,
                                                sizeof(partition_sizze_203667),
                                                &partition_sizze_203667));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210182, 3,
                                                sizeof(ext_mem_229305.mem),
                                                &ext_mem_229305.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210182, 4,
                                                sizeof(mem_229545.mem),
                                                &mem_229545.mem));
        if (1 * ((size_t) segmap_usable_groups_210178 *
                 (size_t) segmap_group_sizze_210177) != 0) {
            const size_t global_work_sizze_236991[1] =
                         {(size_t) segmap_usable_groups_210178 *
                         (size_t) segmap_group_sizze_210177};
            const size_t local_work_sizze_236995[1] =
                         {(size_t) segmap_group_sizze_210177};
            int64_t time_start_236992 = 0, time_end_236993 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                        "main.segmap_210182", global_work_sizze_236991[0],
                        local_work_sizze_236995[0], (int) 0);
                time_start_236992 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_210182,
                                                            1, NULL,
                                                            global_work_sizze_236991,
                                                            local_work_sizze_236995,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_210182_runs,
                                                                                                      &ctx->mainzisegmap_210182_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236993 = get_wall_time();
                
                long time_diff_236994 = time_end_236993 - time_start_236992;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_210182", time_diff_236994);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        
        int64_t segmap_usable_groups_210188 = sdiv_up64(partition_sizze_203667,
                                                        segmap_group_sizze_210187);
        struct memblock_device mem_229549;
        
        mem_229549.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229549, bytes_229288,
                                  "mem_229549")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229552;
        
        mem_229552.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229552, bytes_229288,
                                  "mem_229552")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229555;
        
        mem_229555.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229555, bytes_229288,
                                  "mem_229555")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229558;
        
        mem_229558.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229558, bytes_229288,
                                  "mem_229558")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210194, 1,
                                                sizeof(q_t_203576),
                                                &q_t_203576));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210194, 2,
                                                sizeof(partition_sizze_203667),
                                                &partition_sizze_203667));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210194, 3,
                                                sizeof(min_res_204083),
                                                &min_res_204083));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210194, 4,
                                                sizeof(i64_res_204089),
                                                &i64_res_204089));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210194, 5,
                                                sizeof(ext_mem_229304.mem),
                                                &ext_mem_229304.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210194, 6,
                                                sizeof(mem_229549.mem),
                                                &mem_229549.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210194, 7,
                                                sizeof(mem_229552.mem),
                                                &mem_229552.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210194, 8,
                                                sizeof(mem_229555.mem),
                                                &mem_229555.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210194, 9,
                                                sizeof(mem_229558.mem),
                                                &mem_229558.mem));
        if (1 * ((size_t) segmap_usable_groups_210188 *
                 (size_t) segmap_group_sizze_210187) != 0) {
            const size_t global_work_sizze_236996[1] =
                         {(size_t) segmap_usable_groups_210188 *
                         (size_t) segmap_group_sizze_210187};
            const size_t local_work_sizze_237000[1] =
                         {(size_t) segmap_group_sizze_210187};
            int64_t time_start_236997 = 0, time_end_236998 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                        "main.segmap_210194", global_work_sizze_236996[0],
                        local_work_sizze_237000[0], (int) 0);
                time_start_236997 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_210194,
                                                            1, NULL,
                                                            global_work_sizze_236996,
                                                            local_work_sizze_237000,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_210194_runs,
                                                                                                      &ctx->mainzisegmap_210194_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236998 = get_wall_time();
                
                long time_diff_236999 = time_end_236998 - time_start_236997;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_210194", time_diff_236999);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        
        int64_t segmap_usable_groups_210210 = sdiv_up64(nest_sizze_210208,
                                                        segmap_group_sizze_210209);
        struct memblock_device mem_229563;
        
        mem_229563.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229563, bytes_229535,
                                  "mem_229563")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229567;
        
        mem_229567.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229567, bytes_229535,
                                  "mem_229567")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210215, 1,
                                                sizeof(ctx->failure_is_an_option),
                                                &ctx->failure_is_an_option));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210215, 3,
                                                sizeof(n_203572), &n_203572));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210215, 4,
                                                sizeof(jump_t_203582),
                                                &jump_t_203582));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210215, 5,
                                                sizeof(partition_sizze_203667),
                                                &partition_sizze_203667));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210215, 6,
                                                sizeof(t_n_m_203740),
                                                &t_n_m_203740));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210215, 7,
                                                sizeof(i_203760), &i_203760));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210215, 8,
                                                sizeof(x_203761), &x_203761));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210215, 9,
                                                sizeof(min_res_204083),
                                                &min_res_204083));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210215, 10,
                                                sizeof(loop_cond_204088),
                                                &loop_cond_204088));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210215, 11,
                                                sizeof(ext_mem_229305.mem),
                                                &ext_mem_229305.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210215, 12,
                                                sizeof(mem_229545.mem),
                                                &mem_229545.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210215, 13,
                                                sizeof(mem_229549.mem),
                                                &mem_229549.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210215, 14,
                                                sizeof(mem_229552.mem),
                                                &mem_229552.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210215, 15,
                                                sizeof(mem_229555.mem),
                                                &mem_229555.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210215, 16,
                                                sizeof(mem_229558.mem),
                                                &mem_229558.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210215, 17,
                                                sizeof(mem_229563.mem),
                                                &mem_229563.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210215, 18,
                                                sizeof(mem_229567.mem),
                                                &mem_229567.mem));
        if (1 * ((size_t) segmap_usable_groups_210210 *
                 (size_t) segmap_group_sizze_210209) != 0) {
            const size_t global_work_sizze_237001[1] =
                         {(size_t) segmap_usable_groups_210210 *
                         (size_t) segmap_group_sizze_210209};
            const size_t local_work_sizze_237005[1] =
                         {(size_t) segmap_group_sizze_210209};
            int64_t time_start_237002 = 0, time_end_237003 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                        "main.segmap_210215", global_work_sizze_237001[0],
                        local_work_sizze_237005[0], (int) 0);
                time_start_237002 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_210215,
                                                            1, NULL,
                                                            global_work_sizze_237001,
                                                            local_work_sizze_237005,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_210215_runs,
                                                                                                      &ctx->mainzisegmap_210215_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_237003 = get_wall_time();
                
                long time_diff_237004 = time_end_237003 - time_start_237002;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_210215", time_diff_237004);
            }
        }
        ctx->failure_is_an_option = 1;
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_unref_device(ctx, &mem_229545, "mem_229545") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229549, "mem_229549") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229552, "mem_229552") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229555, "mem_229555") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229558, "mem_229558") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229569, &mem_229567,
                                "mem_229567") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229568, &mem_229563,
                                "mem_229563") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229567, "mem_229567") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229563, "mem_229563") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229558, "mem_229558") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229555, "mem_229555") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229552, "mem_229552") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229549, "mem_229549") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229545, "mem_229545") != 0)
            return 1;
    }
    
    struct memblock_device mem_229573;
    
    mem_229573.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229573, bytes_229285, "mem_229573")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhreplicate_f64(ctx, mem_229573, partition_sizze_203667 *
                                      n_203572, 0.0) != 0) {
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_229577;
    
    mem_229577.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229577, bytes_229285, "mem_229577")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhreplicate_f64(ctx, mem_229577, partition_sizze_203667 *
                                      n_203572, 1.0) != 0) {
        if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool cond_204197 = slt64((int64_t) 1, jump_l_203583);
    bool cond_204198 = slt64((int64_t) 1, jump_t_203582);
    int64_t y_204199 = sub64(n_outer_203585, (int64_t) 1);
    int64_t css_results_l_204200;
    
    if (cond_203725) {
        css_results_l_204200 = s_n_m_203726;
    } else {
        css_results_l_204200 = pad_css_len_203722;
    }
    
    bool zzero_204201 = n_p_203574 == (int64_t) 0;
    bool nonzzero_204202 = !zzero_204201;
    bool loop_not_taken_204203 = !assert_cond_203716;
    bool protect_assert_disj_204204 = nonzzero_204202 || loop_not_taken_204203;
    bool loop_not_taken_204205 = !assert_cond_203718;
    bool protect_assert_disj_204206 = protect_assert_disj_204204 ||
         loop_not_taken_204205;
    bool nonzzero_cert_204207;
    
    if (!protect_assert_disj_204206) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "division by zero",
                               "-> #0  stl.fut:226:51-57\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:226:28-74\n   #5  stl.fut:225:21-227:39\n   #6  stl.fut:415:61-429:75\n   #7  stl.fut:455:3-469:34\n   #8  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t j_204208 = add64(n_203572, n_p_203574);
    bool empty_slice_204209 = n_203572 == (int64_t) 0;
    int64_t i_p_m_t_s_204210 = add64(n_p_203574, i_203760);
    bool zzero_leq_i_p_m_t_s_204211 = sle64((int64_t) 0, i_p_m_t_s_204210);
    bool i_p_m_t_s_leq_w_204212 = slt64(i_p_m_t_s_204210, C_len_203724);
    bool zzero_lte_i_204213 = sle64((int64_t) 0, n_p_203574);
    bool i_lte_j_204214 = sle64(n_p_203574, j_204208);
    bool y_204215 = i_p_m_t_s_leq_w_204212 && zzero_lte_i_204213;
    bool y_204216 = zzero_leq_i_p_m_t_s_204211 && y_204215;
    bool y_204217 = i_lte_j_204214 && y_204216;
    bool forwards_ok_204218 = zzero_lte_i_204213 && y_204217;
    bool ok_or_empty_204219 = empty_slice_204209 || forwards_ok_204218;
    bool protect_assert_disj_204220 = loop_not_taken_204203 ||
         ok_or_empty_204219;
    bool protect_assert_disj_204221 = loop_not_taken_204205 ||
         protect_assert_disj_204220;
    bool index_certs_204222;
    
    if (!protect_assert_disj_204221) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [", (long long) n_p_203574, ":",
                               (long long) j_204208,
                               "] out of bounds for array of shape [",
                               (long long) C_len_203724, "].",
                               "-> #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:415:61-429:75\n   #5  stl.fut:455:3-469:34\n   #6  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t j_m_i_204223 = sub64(stl_res_203755, stl_res_203754);
    int64_t lifted_single_ma_l_arg_204224 = add64((int64_t) 1, j_204208);
    int64_t m_204225 = sub64(n_p_203574, (int64_t) 1);
    bool zzero_leq_i_p_m_t_s_204226 = sle64((int64_t) 0, m_204225);
    bool i_p_m_t_s_leq_w_204227 = slt64(m_204225, C_len_203724);
    bool y_204228 = zzero_leq_i_p_m_t_s_204226 && i_p_m_t_s_leq_w_204227;
    bool y_204229 = zzero_lte_i_204213 && y_204228;
    bool ok_or_empty_204230 = zzero_204201 || y_204229;
    bool protect_assert_disj_204231 = loop_not_taken_204203 ||
         ok_or_empty_204230;
    bool protect_assert_disj_204232 = loop_not_taken_204205 ||
         protect_assert_disj_204231;
    bool index_certs_204233;
    
    if (!protect_assert_disj_204232) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [:", (long long) n_p_203574,
                               "] out of bounds for array of shape [",
                               (long long) C_len_203724, "].",
                               "-> #0  stl.fut:24:37-43\n   #1  stl.fut:24:20-48\n   #2  stl.fut:38:3-36\n   #3  stl.fut:231:23-47\n   #4  stl.fut:415:61-429:75\n   #5  stl.fut:455:3-469:34\n   #6  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t dyn_lifted_single_ma_l_arg_204234 = add64((int64_t) 2, n_203572);
    bool i_p_m_t_s_leq_w_204235 = slt64(m_204225,
                                        lifted_single_ma_l_arg_204224);
    bool y_204236 = zzero_leq_i_p_m_t_s_204226 && i_p_m_t_s_leq_w_204235;
    bool y_204237 = zzero_lte_i_204213 && y_204236;
    bool ok_or_empty_204238 = zzero_204201 || y_204237;
    bool protect_assert_disj_204239 = loop_not_taken_204203 ||
         ok_or_empty_204238;
    bool protect_assert_disj_204240 = loop_not_taken_204205 ||
         protect_assert_disj_204239;
    bool index_certs_204241;
    
    if (!protect_assert_disj_204240) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [:", (long long) n_p_203574,
                               "] out of bounds for array of shape [",
                               (long long) lifted_single_ma_l_arg_204224, "].",
                               "-> #0  stl.fut:24:37-43\n   #1  stl.fut:24:20-48\n   #2  /prelude/functional.fut:9:42-44\n   #3  stl.fut:38:3-64\n   #4  stl.fut:231:23-47\n   #5  stl.fut:415:61-429:75\n   #6  stl.fut:455:3-469:34\n   #7  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool i_p_m_t_s_leq_w_204242 = slt64((int64_t) 2,
                                        dyn_lifted_single_ma_l_arg_204234);
    bool protect_assert_disj_204243 = loop_not_taken_204203 ||
         i_p_m_t_s_leq_w_204242;
    bool protect_assert_disj_204244 = loop_not_taken_204205 ||
         protect_assert_disj_204243;
    bool index_certs_204245;
    
    if (!protect_assert_disj_204244) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [:", (long long) (int64_t) 3,
                               "] out of bounds for array of shape [",
                               (long long) dyn_lifted_single_ma_l_arg_204234,
                               "].",
                               "-> #0  stl.fut:24:37-43\n   #1  stl.fut:24:20-48\n   #2  /prelude/functional.fut:9:42-44\n   #3  stl.fut:38:3-84\n   #4  stl.fut:231:23-47\n   #5  stl.fut:415:61-429:75\n   #6  stl.fut:455:3-469:34\n   #7  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool cond_204246 = slt64(jump_l_203583, jump_threshold_203586);
    bool cond_f_res_204247 = slt64(q_threshold_203587, q_l_203577);
    bool x_204248 = !cond_204246;
    bool y_204249 = cond_f_res_204247 && x_204248;
    bool cond_204250 = cond_204246 || y_204249;
    bool cond_204251 = slt64(jump_t_203582, jump_threshold_203586);
    bool cond_f_res_204252 = slt64(q_threshold_203587, q_t_203576);
    bool x_204253 = !cond_204251;
    bool y_204254 = cond_f_res_204252 && x_204253;
    bool cond_204255 = cond_204251 || y_204254;
    bool cond_204256 = slt64(jump_s_203581, jump_threshold_203586);
    bool cond_f_res_204257 = slt64(q_threshold_203587, q_s_203575);
    bool x_204258 = !cond_204256;
    bool y_204259 = cond_f_res_204257 && x_204258;
    bool cond_204260 = cond_204256 || y_204259;
    bool bounds_invalid_upwards_204261 = slt64(C_len_203724, (int64_t) 0);
    bool valid_204262 = !bounds_invalid_upwards_204261;
    bool protect_assert_disj_204263 = loop_not_taken_204203 || valid_204262;
    bool protect_assert_disj_204264 = loop_not_taken_204205 ||
         protect_assert_disj_204263;
    bool range_valid_c_204265;
    
    if (!protect_assert_disj_204264) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) C_len_203724, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  stl.fut:226:28-74\n   #4  stl.fut:225:21-227:39\n   #5  stl.fut:415:61-429:75\n   #6  stl.fut:455:3-469:34\n   #7  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool bounds_invalid_upwards_204267 = slt64(lifted_single_ma_l_arg_204224,
                                               (int64_t) 0);
    bool valid_204268 = !bounds_invalid_upwards_204267;
    bool protect_assert_disj_204269 = loop_not_taken_204203 || valid_204268;
    bool protect_assert_disj_204270 = loop_not_taken_204205 ||
         protect_assert_disj_204269;
    bool range_valid_c_204271;
    
    if (!protect_assert_disj_204270) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) lifted_single_ma_l_arg_204224,
                               " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  stl.fut:27:13-33:19\n   #4  /prelude/soacs.fut:67:19-23\n   #5  /prelude/soacs.fut:67:3-37\n   #6  stl.fut:26:5-34:23\n   #7  stl.fut:38:3-36\n   #8  stl.fut:231:23-47\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool bounds_invalid_upwards_204273 =
         slt64(dyn_lifted_single_ma_l_arg_204234, (int64_t) 0);
    bool valid_204274 = !bounds_invalid_upwards_204273;
    bool protect_assert_disj_204275 = loop_not_taken_204203 || valid_204274;
    bool protect_assert_disj_204276 = loop_not_taken_204205 ||
         protect_assert_disj_204275;
    bool range_valid_c_204277;
    
    if (!protect_assert_disj_204276) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) dyn_lifted_single_ma_l_arg_204234,
                               " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  stl.fut:27:13-33:19\n   #4  /prelude/soacs.fut:67:19-23\n   #5  /prelude/soacs.fut:67:3-37\n   #6  stl.fut:26:5-34:23\n   #7  /prelude/functional.fut:9:42-44\n   #8  stl.fut:38:3-64\n   #9  stl.fut:231:23-47\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t segmap_group_sizze_210352;
    
    segmap_group_sizze_210352 =
        *ctx->tuning_params.mainzisegmap_group_sizze_210326;
    
    int64_t segmap_usable_groups_210353 = sdiv_up_safe64(nest_sizze_207090,
                                                         segmap_group_sizze_210352);
    int64_t segmap_group_sizze_210495;
    
    segmap_group_sizze_210495 =
        *ctx->tuning_params.mainzisegmap_group_sizze_210389;
    
    int64_t segmap_usable_groups_210496 = sdiv_up_safe64(nest_sizze_207253,
                                                         segmap_group_sizze_210495);
    int64_t nest_sizze_218646 = partition_sizze_203667 * C_len_203724;
    int64_t segmap_group_sizze_218647;
    
    segmap_group_sizze_218647 =
        *ctx->tuning_params.mainzisegmap_group_sizze_218601;
    
    int64_t segmap_usable_groups_218648 = sdiv_up_safe64(nest_sizze_218646,
                                                         segmap_group_sizze_218647);
    bool suff_outer_par_218668;
    
    suff_outer_par_218668 = *ctx->tuning_params.mainzisuff_outer_par_19 <=
        partition_sizze_203667;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_outer_par_19",
                (long) partition_sizze_203667,
                suff_outer_par_218668 ? "true" : "false");
    
    int64_t segmap_group_sizze_218684;
    
    segmap_group_sizze_218684 =
        *ctx->tuning_params.mainzisegmap_group_sizze_218672;
    
    int64_t segred_group_sizze_218715;
    
    segred_group_sizze_218715 =
        *ctx->tuning_params.mainzisegred_group_sizze_218698;
    
    int64_t num_groups_218716;
    int32_t max_num_groups_232959;
    
    max_num_groups_232959 = *ctx->tuning_params.mainzisegred_num_groups_218700;
    num_groups_218716 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(binop_x_229310,
                                                             segred_group_sizze_218715),
                                                   sext_i32_i64(max_num_groups_232959))));
    
    int64_t nest_sizze_218766 = partition_sizze_203667 *
            lifted_single_ma_l_arg_204224;
    int64_t segscan_group_sizze_218767;
    
    segscan_group_sizze_218767 =
        *ctx->tuning_params.mainzisegscan_group_sizze_218731;
    
    int64_t num_groups_218768;
    int32_t max_num_groups_232960;
    
    max_num_groups_232960 = *ctx->tuning_params.mainzisegscan_num_groups_218733;
    num_groups_218768 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(nest_sizze_218766,
                                                             segscan_group_sizze_218767),
                                                   sext_i32_i64(max_num_groups_232960))));
    
    bool suff_outer_par_218799;
    
    suff_outer_par_218799 = *ctx->tuning_params.mainzisuff_outer_par_20 <=
        partition_sizze_203667;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_outer_par_20",
                (long) partition_sizze_203667,
                suff_outer_par_218799 ? "true" : "false");
    
    int64_t segmap_group_sizze_218815;
    
    segmap_group_sizze_218815 =
        *ctx->tuning_params.mainzisegmap_group_sizze_218803;
    
    int64_t segred_group_sizze_218846;
    
    segred_group_sizze_218846 =
        *ctx->tuning_params.mainzisegred_group_sizze_218829;
    
    int64_t num_groups_218847;
    int32_t max_num_groups_232961;
    
    max_num_groups_232961 = *ctx->tuning_params.mainzisegred_num_groups_218831;
    num_groups_218847 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(binop_x_229310,
                                                             segred_group_sizze_218846),
                                                   sext_i32_i64(max_num_groups_232961))));
    
    int64_t nest_sizze_218897 = partition_sizze_203667 *
            dyn_lifted_single_ma_l_arg_204234;
    int64_t segscan_group_sizze_218898;
    
    segscan_group_sizze_218898 =
        *ctx->tuning_params.mainzisegscan_group_sizze_218862;
    
    int64_t num_groups_218899;
    int32_t max_num_groups_232962;
    
    max_num_groups_232962 = *ctx->tuning_params.mainzisegscan_num_groups_218864;
    num_groups_218899 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(nest_sizze_218897,
                                                             segscan_group_sizze_218898),
                                                   sext_i32_i64(max_num_groups_232962))));
    
    bool suff_outer_par_218930;
    
    suff_outer_par_218930 = *ctx->tuning_params.mainzisuff_outer_par_21 <=
        partition_sizze_203667;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_outer_par_21",
                (long) partition_sizze_203667,
                suff_outer_par_218930 ? "true" : "false");
    
    int64_t segmap_group_sizze_218946;
    
    segmap_group_sizze_218946 =
        *ctx->tuning_params.mainzisegmap_group_sizze_218934;
    
    int64_t nest_sizze_218976 = (int64_t) 3 * partition_sizze_203667;
    int64_t segred_group_sizze_218977;
    
    segred_group_sizze_218977 =
        *ctx->tuning_params.mainzisegred_group_sizze_218960;
    
    int64_t num_groups_218978;
    int32_t max_num_groups_232963;
    
    max_num_groups_232963 = *ctx->tuning_params.mainzisegred_num_groups_218962;
    num_groups_218978 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(nest_sizze_218976,
                                                             segred_group_sizze_218977),
                                                   sext_i32_i64(max_num_groups_232963))));
    
    int64_t segscan_group_sizze_219029;
    
    segscan_group_sizze_219029 =
        *ctx->tuning_params.mainzisegscan_group_sizze_218993;
    
    int64_t num_groups_219030;
    int32_t max_num_groups_232964;
    
    max_num_groups_232964 = *ctx->tuning_params.mainzisegscan_num_groups_218995;
    num_groups_219030 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(nest_sizze_207090,
                                                             segscan_group_sizze_219029),
                                                   sext_i32_i64(max_num_groups_232964))));
    
    int64_t segmap_group_sizze_222529;
    
    segmap_group_sizze_222529 =
        *ctx->tuning_params.mainzisegmap_group_sizze_222503;
    
    int64_t segmap_usable_groups_222530 = sdiv_up_safe64(nest_sizze_207090,
                                                         segmap_group_sizze_222529);
    int64_t segmap_usable_groups_218685 = sdiv_up_safe64(partition_sizze_203667,
                                                         segmap_group_sizze_218684);
    int64_t segmap_usable_groups_218816 = sdiv_up_safe64(partition_sizze_203667,
                                                         segmap_group_sizze_218815);
    int64_t segmap_usable_groups_218947 = sdiv_up_safe64(partition_sizze_203667,
                                                         segmap_group_sizze_218946);
    struct memblock_device mem_229628;
    
    mem_229628.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229628, bytes_229285, "mem_229628")) {
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_229634;
    
    mem_229634.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229634, bytes_229313, "mem_229634")) {
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_229639;
    
    mem_229639.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229639, bytes_229313, "mem_229639")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t binop_x_230598 = pad_css_len_203722 * binop_x_229310;
    int64_t binop_y_230599 = (int64_t) 8 * binop_x_230598;
    int64_t bytes_230600 = smax64((int64_t) 0, binop_y_230599);
    int64_t binop_y_230606 = (int64_t) 8 * nest_sizze_218646;
    int64_t bytes_230607 = smax64((int64_t) 0, binop_y_230606);
    struct memblock_device mem_230608;
    
    mem_230608.references = NULL;
    if (memblock_alloc_device(ctx, &mem_230608, bytes_230607, "mem_230608")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t binop_y_230623 = (int64_t) 8 * nest_sizze_218766;
    int64_t bytes_230624 = smax64((int64_t) 0, binop_y_230623);
    struct memblock_device mem_230625;
    
    mem_230625.references = NULL;
    if (memblock_alloc_device(ctx, &mem_230625, bytes_230624, "mem_230625")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t binop_y_230640 = (int64_t) 8 * nest_sizze_218897;
    int64_t bytes_230641 = smax64((int64_t) 0, binop_y_230640);
    struct memblock_device mem_230642;
    
    mem_230642.references = NULL;
    if (memblock_alloc_device(ctx, &mem_230642, bytes_230641, "mem_230642")) {
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_230659;
    
    mem_230659.references = NULL;
    if (memblock_alloc_device(ctx, &mem_230659, bytes_229285, "mem_230659")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t ext_231023;
    
    if (cond_204197) {
        ext_231023 = n_203572;
    } else {
        ext_231023 = l_n_m_203733;
    }
    
    int64_t ext_231620;
    
    if (cond_204198) {
        ext_231620 = n_203572;
    } else {
        ext_231620 = t_n_m_203740;
    }
    
    int64_t ext_231983;
    int64_t ext_231981;
    int64_t ext_231977;
    int64_t ext_231976;
    int64_t ext_231975;
    int64_t ext_231974;
    int64_t ext_231973;
    int64_t ext_231972;
    int64_t ext_231971;
    struct memblock_device ext_mem_231970;
    
    ext_mem_231970.references = NULL;
    
    struct memblock_device ext_mem_231969;
    
    ext_mem_231969.references = NULL;
    
    struct memblock_device ext_mem_231968;
    
    ext_mem_231968.references = NULL;
    
    struct memblock_device mem_param_229585;
    
    mem_param_229585.references = NULL;
    
    int64_t ctx_param_ext_229587;
    int64_t ctx_param_ext_229589;
    struct memblock_device mem_param_229593;
    
    mem_param_229593.references = NULL;
    
    int64_t ctx_param_ext_229594;
    int64_t ctx_param_ext_229595;
    int64_t ctx_param_ext_229596;
    int64_t ctx_param_ext_229597;
    int64_t ctx_param_ext_229598;
    int64_t ctx_param_ext_229599;
    int64_t ctx_param_ext_229600;
    struct memblock_device mem_param_229601;
    
    mem_param_229601.references = NULL;
    ctx_param_ext_229587 = n_203572;
    ctx_param_ext_229589 = n_203572;
    ctx_param_ext_229594 = partition_sizze_203667;
    ctx_param_ext_229595 = n_203572;
    ctx_param_ext_229596 = (int64_t) 0;
    ctx_param_ext_229597 = n_203572;
    ctx_param_ext_229598 = partition_sizze_203667;
    ctx_param_ext_229599 = (int64_t) 1;
    ctx_param_ext_229600 = n_203572;
    if (memblock_set_device(ctx, &mem_param_229585, &mem_229573,
                            "mem_229573") != 0)
        return 1;
    if (memblock_set_device(ctx, &mem_param_229593, &mem_229573,
                            "mem_229573") != 0)
        return 1;
    if (memblock_set_device(ctx, &mem_param_229601, &mem_229577,
                            "mem_229577") != 0)
        return 1;
    for (int64_t i_outer_204282 = 0; i_outer_204282 < n_outer_203585;
         i_outer_204282++) {
        int64_t ext_231632;
        int64_t ext_231630;
        struct memblock_device ext_mem_231626;
        
        ext_mem_231626.references = NULL;
        
        struct memblock_device ext_mem_231625;
        
        ext_mem_231625.references = NULL;
        
        struct memblock_device mem_param_229615;
        
        mem_param_229615.references = NULL;
        
        int64_t ctx_param_ext_229617;
        int64_t ctx_param_ext_229619;
        struct memblock_device mem_param_229623;
        
        mem_param_229623.references = NULL;
        ctx_param_ext_229617 = ctx_param_ext_229587;
        ctx_param_ext_229619 = ctx_param_ext_229589;
        if (memblock_set_device(ctx, &mem_param_229615, &mem_param_229585,
                                "mem_param_229585") != 0)
            return 1;
        if (memblock_set_device(ctx, &mem_param_229623, &mem_param_229593,
                                "mem_param_229593") != 0)
            return 1;
        for (int64_t _i_inner_204288 = 0; _i_inner_204288 < n_inner_203584;
             _i_inner_204288++) {
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210357, 1,
                                                    sizeof(n_203572),
                                                    &n_203572));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210357, 2,
                                                    sizeof(partition_sizze_203667),
                                                    &partition_sizze_203667));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210357, 3,
                                                    sizeof(ctx_param_ext_229619),
                                                    &ctx_param_ext_229619));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210357, 4,
                                                    sizeof(mem_229269.mem),
                                                    &mem_229269.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210357, 5,
                                                    sizeof(mem_param_229623.mem),
                                                    &mem_param_229623.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210357, 6,
                                                    sizeof(mem_229628.mem),
                                                    &mem_229628.mem));
            if (1 * ((size_t) segmap_usable_groups_210353 *
                     (size_t) segmap_group_sizze_210352) != 0) {
                const size_t global_work_sizze_237006[1] =
                             {(size_t) segmap_usable_groups_210353 *
                             (size_t) segmap_group_sizze_210352};
                const size_t local_work_sizze_237010[1] =
                             {(size_t) segmap_group_sizze_210352};
                int64_t time_start_237007 = 0, time_end_237008 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                            "main.segmap_210357", global_work_sizze_237006[0],
                            local_work_sizze_237010[0], (int) 0);
                    time_start_237007 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_210357,
                                                                1, NULL,
                                                                global_work_sizze_237006,
                                                                local_work_sizze_237010,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_210357_runs,
                                                                                                          &ctx->mainzisegmap_210357_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_237008 = get_wall_time();
                    
                    long time_diff_237009 = time_end_237008 - time_start_237007;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_210357", time_diff_237009);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210502, 1,
                                                    sizeof(ctx->failure_is_an_option),
                                                    &ctx->failure_is_an_option));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210502, 3,
                                                    sizeof(n_203572),
                                                    &n_203572));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210502, 4,
                                                    sizeof(n_p_203574),
                                                    &n_p_203574));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210502, 5,
                                                    sizeof(partition_sizze_203667),
                                                    &partition_sizze_203667));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210502, 6,
                                                    sizeof(defunc_0_f_res_203721),
                                                    &defunc_0_f_res_203721));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210502, 7,
                                                    sizeof(i_203760),
                                                    &i_203760));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210502, 8,
                                                    sizeof(ctx_param_ext_229596),
                                                    &ctx_param_ext_229596));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210502, 9,
                                                    sizeof(ctx_param_ext_229597),
                                                    &ctx_param_ext_229597));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210502,
                                                    10,
                                                    sizeof(ctx_param_ext_229599),
                                                    &ctx_param_ext_229599));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210502,
                                                    11,
                                                    sizeof(ext_mem_229373.mem),
                                                    &ext_mem_229373.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210502,
                                                    12,
                                                    sizeof(mem_param_229601.mem),
                                                    &mem_param_229601.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210502,
                                                    13, sizeof(mem_229628.mem),
                                                    &mem_229628.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210502,
                                                    14, sizeof(mem_229634.mem),
                                                    &mem_229634.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210502,
                                                    15, sizeof(mem_229639.mem),
                                                    &mem_229639.mem));
            if (1 * ((size_t) segmap_usable_groups_210496 *
                     (size_t) segmap_group_sizze_210495) != 0) {
                const size_t global_work_sizze_237011[1] =
                             {(size_t) segmap_usable_groups_210496 *
                             (size_t) segmap_group_sizze_210495};
                const size_t local_work_sizze_237015[1] =
                             {(size_t) segmap_group_sizze_210495};
                int64_t time_start_237012 = 0, time_end_237013 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                            "main.segmap_210502", global_work_sizze_237011[0],
                            local_work_sizze_237015[0], (int) 0);
                    time_start_237012 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_210502,
                                                                1, NULL,
                                                                global_work_sizze_237011,
                                                                local_work_sizze_237015,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_210502_runs,
                                                                                                          &ctx->mainzisegmap_210502_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_237013 = get_wall_time();
                    
                    long time_diff_237014 = time_end_237013 - time_start_237012;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_210502", time_diff_237014);
                }
            }
            ctx->failure_is_an_option = 1;
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            struct memblock_device ext_mem_230595;
            
            ext_mem_230595.references = NULL;
            
            struct memblock_device ext_mem_230594;
            
            ext_mem_230594.references = NULL;
            if (cond_204260) {
                bool match_lit_204330 = (int64_t) 0 == d_s_203578;
                struct memblock_device ext_mem_230528;
                
                ext_mem_230528.references = NULL;
                
                struct memblock_device ext_mem_230527;
                
                ext_mem_230527.references = NULL;
                if (match_lit_204330) {
                    struct memblock_device mem_229644;
                    
                    mem_229644.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_229644, bytes_229405,
                                              "mem_229644")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f64(ctx, mem_229644,
                                                      partition_sizze_203667 *
                                                      n_p_203574 * s_n_m_203726,
                                                      0.0) != 0) {
                        if (memblock_unref_device(ctx, &mem_229644,
                                                  "mem_229644") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230527,
                                                  "ext_mem_230527") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230528,
                                                  "ext_mem_230528") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230594,
                                                  "ext_mem_230594") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230595,
                                                  "ext_mem_230595") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229623,
                                                  "mem_param_229623") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229615,
                                                  "mem_param_229615") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231625,
                                                  "ext_mem_231625") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231626,
                                                  "ext_mem_231626") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229601,
                                                  "mem_param_229601") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229593,
                                                  "mem_param_229593") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229585,
                                                  "mem_param_229585") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231968,
                                                  "ext_mem_231968") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231969,
                                                  "ext_mem_231969") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231970,
                                                  "ext_mem_231970") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230659,
                                                  "mem_230659") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230642,
                                                  "mem_230642") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230625,
                                                  "mem_230625") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230608,
                                                  "mem_230608") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229639,
                                                  "mem_229639") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229634,
                                                  "mem_229634") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229628,
                                                  "mem_229628") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229577,
                                                  "mem_229577") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229573,
                                                  "mem_229573") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229568,
                                                  "ext_mem_229568") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229569,
                                                  "ext_mem_229569") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229519,
                                                  "ext_mem_229519") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229520,
                                                  "ext_mem_229520") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229470,
                                                  "ext_mem_229470") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229471,
                                                  "ext_mem_229471") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229372,
                                                  "ext_mem_229372") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229373,
                                                  "ext_mem_229373") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229314,
                                                  "mem_229314") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229308,
                                                  "mem_229308") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229304,
                                                  "ext_mem_229304") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229305,
                                                  "ext_mem_229305") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229272,
                                                  "mem_229272") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229269,
                                                  "mem_229269") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232074,
                                                  "color_232074") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229265,
                                                  "mem_229265") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229263,
                                                  "mem_229263") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229260,
                                                  "mem_229260") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229242,
                                                  "mem_229242") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232361,
                                                  "mem_out_232361") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232360,
                                                  "mem_out_232360") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232359,
                                                  "mem_out_232359") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    bool suff_outer_par_210527;
                    
                    suff_outer_par_210527 =
                        *ctx->tuning_params.mainzisuff_outer_par_7 <=
                        partition_sizze_203667;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_7",
                                (long) partition_sizze_203667,
                                suff_outer_par_210527 ? "true" : "false");
                    
                    int64_t segmap_group_sizze_210627;
                    
                    segmap_group_sizze_210627 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_210531;
                    
                    int64_t num_groups_210628;
                    int32_t max_num_groups_233008;
                    
                    max_num_groups_233008 =
                        *ctx->tuning_params.mainzisegmap_num_groups_210533;
                    num_groups_210628 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(partition_sizze_203667,
                                                                             segmap_group_sizze_210627),
                                                                   sext_i32_i64(max_num_groups_233008))));
                    
                    int64_t segmap_group_sizze_211751;
                    
                    segmap_group_sizze_211751 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_210726;
                    
                    int64_t num_groups_211752;
                    int32_t max_num_groups_233009;
                    
                    max_num_groups_233009 =
                        *ctx->tuning_params.mainzisegmap_num_groups_210728;
                    num_groups_211752 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(binop_x_229310,
                                                                             segmap_group_sizze_211751),
                                                                   sext_i32_i64(max_num_groups_233009))));
                    
                    bool suff_outer_par_211756;
                    
                    suff_outer_par_211756 =
                        *ctx->tuning_params.mainzisuff_outer_par_8 <=
                        binop_x_229310;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_8", (long) binop_x_229310,
                                suff_outer_par_211756 ? "true" : "false");
                    
                    int64_t one_intra_par_min_211757 = q_s_203575 *
                            s_n_m_203726;
                    int64_t intra_avail_par_211759 = smin64(s_n_m_203726,
                                                            one_intra_par_min_211757);
                    int64_t computed_group_sizze_211760 = smax64(s_n_m_203726,
                                                                 one_intra_par_min_211757);
                    bool fits_211764 = sle64(computed_group_sizze_211760,
                                             max_group_sizze_206977);
                    bool suff_intra_par_211766;
                    
                    suff_intra_par_211766 =
                        *ctx->tuning_params.mainzisuff_intra_par_9 <=
                        intra_avail_par_211759;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_intra_par_9",
                                (long) intra_avail_par_211759,
                                suff_intra_par_211766 ? "true" : "false");
                    
                    bool intra_suff_and_fits_211767 = fits_211764 &&
                         suff_intra_par_211766;
                    int64_t segmap_group_sizze_211969;
                    
                    segmap_group_sizze_211969 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_211061;
                    
                    bool suff_outer_par_211974;
                    
                    suff_outer_par_211974 =
                        *ctx->tuning_params.mainzisuff_outer_par_10 <=
                        nest_sizze_208938;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_10",
                                (long) nest_sizze_208938,
                                suff_outer_par_211974 ? "true" : "false");
                    
                    int64_t segmap_group_sizze_212062;
                    
                    segmap_group_sizze_212062 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_211322;
                    
                    int64_t nest_sizze_212084 = q_s_203575 * nest_sizze_208938;
                    int64_t segred_group_sizze_212085;
                    
                    segred_group_sizze_212085 =
                        *ctx->tuning_params.mainzisegred_group_sizze_211266;
                    
                    int64_t num_groups_212086;
                    int32_t max_num_groups_233010;
                    
                    max_num_groups_233010 =
                        *ctx->tuning_params.mainzisegred_num_groups_211268;
                    num_groups_212086 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(nest_sizze_212084,
                                                                             segred_group_sizze_212085),
                                                                   sext_i32_i64(max_num_groups_233010))));
                    
                    int64_t segmap_group_sizze_212134;
                    
                    segmap_group_sizze_212134 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_211236;
                    
                    int64_t segred_group_sizze_212159;
                    
                    segred_group_sizze_212159 =
                        *ctx->tuning_params.mainzisegred_group_sizze_211164;
                    
                    int64_t num_groups_212160;
                    int32_t max_num_groups_233011;
                    
                    max_num_groups_233011 =
                        *ctx->tuning_params.mainzisegred_num_groups_211166;
                    num_groups_212160 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(nest_sizze_212084,
                                                                             segred_group_sizze_212159),
                                                                   sext_i32_i64(max_num_groups_233011))));
                    
                    int64_t bytes_229647 = (int64_t) 8 * nest_sizze_208938;
                    int64_t bytes_229654 = (int64_t) 8 * nest_sizze_207253;
                    int64_t binop_x_229717 = partition_sizze_203667 *
                            s_n_m_203726;
                    int64_t binop_x_229718 = n_p_203574 * binop_x_229717;
                    int64_t bytes_229719 = (int64_t) 8 * binop_x_229718;
                    int64_t binop_x_229725 = partition_sizze_203667 *
                            defunc_0_f_res_203721;
                    int64_t binop_x_229726 = n_p_203574 * binop_x_229725;
                    int64_t bytes_229727 = (int64_t) 8 * binop_x_229726;
                    int64_t bytes_229762 = smax64((int64_t) 0, s_n_m_203726);
                    int64_t bytes_229798 = smax64((int64_t) 0, binop_x_229403);
                    int64_t num_threads_232221 = segmap_group_sizze_210627 *
                            num_groups_210628;
                    int64_t total_sizze_232222 = bytes_229396 *
                            num_threads_232221;
                    int64_t num_threads_232223 = segmap_group_sizze_211751 *
                            num_groups_211752;
                    int64_t total_sizze_232224 = bytes_229419 *
                            num_threads_232223;
                    struct memblock_device ext_mem_229838;
                    
                    ext_mem_229838.references = NULL;
                    
                    int32_t local_memory_capacity_233297;
                    
                    local_memory_capacity_233297 = ctx->opencl.max_local_memory;
                    if (sle64((int64_t) 0,
                              sext_i32_i64(local_memory_capacity_233297)) &&
                        suff_outer_par_210527) {
                        struct memblock_device mem_229648;
                        
                        mem_229648.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229648,
                                                  bytes_229647, "mem_229648")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_229648,
                                                                  (int64_t) 0,
                                                                  ext_mem_229470,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_p_203574 *
                                                                  s_n_m_203726,
                                                                  partition_sizze_203667) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_229648,
                                                      "mem_229648") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229838,
                                                      "ext_mem_229838") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229644,
                                                      "mem_229644") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230527,
                                                      "ext_mem_230527") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230528,
                                                      "ext_mem_230528") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_229651;
                        
                        mem_229651.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229651,
                                                  binop_y_229332,
                                                  "mem_229651")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                  mem_229651,
                                                                  (int64_t) 0,
                                                                  ext_mem_229372,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_p_203574,
                                                                  partition_sizze_203667) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_229651,
                                                      "mem_229651") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229648,
                                                      "mem_229648") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229838,
                                                      "ext_mem_229838") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229644,
                                                      "mem_229644") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230527,
                                                      "ext_mem_230527") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230528,
                                                      "ext_mem_230528") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_229655;
                        
                        mem_229655.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229655,
                                                  bytes_229654, "mem_229655")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_229655,
                                                                  (int64_t) 0,
                                                                  mem_229639,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_p_203574 *
                                                                  defunc_0_f_res_203721,
                                                                  partition_sizze_203667) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_229655,
                                                      "mem_229655") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229651,
                                                      "mem_229651") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229648,
                                                      "mem_229648") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229838,
                                                      "ext_mem_229838") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229644,
                                                      "mem_229644") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230527,
                                                      "ext_mem_230527") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230528,
                                                      "ext_mem_230528") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_229659;
                        
                        mem_229659.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229659,
                                                  bytes_229647, "mem_229659")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                  mem_229659,
                                                                  (int64_t) 0,
                                                                  ext_mem_229471,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_p_203574 *
                                                                  s_n_m_203726,
                                                                  partition_sizze_203667) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_229659,
                                                      "mem_229659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229655,
                                                      "mem_229655") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229651,
                                                      "mem_229651") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229648,
                                                      "mem_229648") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229838,
                                                      "ext_mem_229838") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229644,
                                                      "mem_229644") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230527,
                                                      "ext_mem_230527") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230528,
                                                      "ext_mem_230528") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_229663;
                        
                        mem_229663.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229663,
                                                  bytes_229654, "mem_229663")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_229663,
                                                                  (int64_t) 0,
                                                                  mem_229634,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_p_203574 *
                                                                  defunc_0_f_res_203721,
                                                                  partition_sizze_203667) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_229663,
                                                      "mem_229663") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229659,
                                                      "mem_229659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229655,
                                                      "mem_229655") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229651,
                                                      "mem_229651") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229648,
                                                      "mem_229648") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229838,
                                                      "ext_mem_229838") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229644,
                                                      "mem_229644") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230527,
                                                      "ext_mem_230527") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230528,
                                                      "ext_mem_230528") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_229667;
                        
                        mem_229667.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229667,
                                                  bytes_229654, "mem_229667")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                  mem_229667,
                                                                  (int64_t) 0,
                                                                  ext_mem_229373,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_p_203574 *
                                                                  defunc_0_f_res_203721,
                                                                  partition_sizze_203667) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_229667,
                                                      "mem_229667") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229663,
                                                      "mem_229663") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229659,
                                                      "mem_229659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229655,
                                                      "mem_229655") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229651,
                                                      "mem_229651") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229648,
                                                      "mem_229648") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229838,
                                                      "ext_mem_229838") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229644,
                                                      "mem_229644") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230527,
                                                      "ext_mem_230527") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230528,
                                                      "ext_mem_230528") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_229716;
                        
                        mem_229716.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229716,
                                                  bytes_229647, "mem_229716")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device color_232097;
                        
                        color_232097.references = NULL;
                        if (memblock_alloc_device(ctx, &color_232097,
                                                  total_sizze_232222,
                                                  "color_232097")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210632,
                                                                1,
                                                                sizeof(n_p_203574),
                                                                &n_p_203574));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210632,
                                                                2,
                                                                sizeof(q_s_203575),
                                                                &q_s_203575));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210632,
                                                                3,
                                                                sizeof(jump_s_203581),
                                                                &jump_s_203581));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210632,
                                                                4,
                                                                sizeof(partition_sizze_203667),
                                                                &partition_sizze_203667));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210632,
                                                                5,
                                                                sizeof(defunc_0_f_res_203721),
                                                                &defunc_0_f_res_203721));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210632,
                                                                6,
                                                                sizeof(pad_css_len_203722),
                                                                &pad_css_len_203722));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210632,
                                                                7,
                                                                sizeof(s_n_m_203726),
                                                                &s_n_m_203726));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210632,
                                                                8,
                                                                sizeof(num_groups_210628),
                                                                &num_groups_210628));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210632,
                                                                9,
                                                                sizeof(num_threads_232221),
                                                                &num_threads_232221));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210632,
                                                                10,
                                                                sizeof(mem_229648.mem),
                                                                &mem_229648.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210632,
                                                                11,
                                                                sizeof(mem_229651.mem),
                                                                &mem_229651.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210632,
                                                                12,
                                                                sizeof(mem_229655.mem),
                                                                &mem_229655.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210632,
                                                                13,
                                                                sizeof(mem_229659.mem),
                                                                &mem_229659.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210632,
                                                                14,
                                                                sizeof(mem_229663.mem),
                                                                &mem_229663.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210632,
                                                                15,
                                                                sizeof(mem_229667.mem),
                                                                &mem_229667.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210632,
                                                                16,
                                                                sizeof(mem_229716.mem),
                                                                &mem_229716.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210632,
                                                                17,
                                                                sizeof(color_232097.mem),
                                                                &color_232097.mem));
                        if (1 * ((size_t) num_groups_210628 *
                                 (size_t) segmap_group_sizze_210627) != 0) {
                            const size_t global_work_sizze_237016[1] =
                                         {(size_t) num_groups_210628 *
                                         (size_t) segmap_group_sizze_210627};
                            const size_t local_work_sizze_237020[1] =
                                         {(size_t) segmap_group_sizze_210627};
                            int64_t time_start_237017 = 0, time_end_237018 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.segmap_210632",
                                        global_work_sizze_237016[0],
                                        local_work_sizze_237020[0], (int) 0);
                                time_start_237017 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_210632,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237016,
                                                                            local_work_sizze_237020,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_210632_runs,
                                                                                                                      &ctx->mainzisegmap_210632_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237018 = get_wall_time();
                                
                                long time_diff_237019 = time_end_237018 -
                                     time_start_237017;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_210632", time_diff_237019);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_229648,
                                                  "mem_229648") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229651,
                                                  "mem_229651") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229655,
                                                  "mem_229655") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229659,
                                                  "mem_229659") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229663,
                                                  "mem_229663") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229667,
                                                  "mem_229667") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232097,
                                                  "color_232097") != 0)
                            return 1;
                        
                        struct memblock_device mem_229836;
                        
                        mem_229836.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229836,
                                                  bytes_229405, "mem_229836")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_229836,
                                                                  (int64_t) 0,
                                                                  mem_229716,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  partition_sizze_203667,
                                                                  n_p_203574 *
                                                                  s_n_m_203726) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_229836,
                                                      "mem_229836") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232097,
                                                      "color_232097") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229716,
                                                      "mem_229716") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229667,
                                                      "mem_229667") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229663,
                                                      "mem_229663") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229659,
                                                      "mem_229659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229655,
                                                      "mem_229655") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229651,
                                                      "mem_229651") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229648,
                                                      "mem_229648") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229838,
                                                      "ext_mem_229838") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229644,
                                                      "mem_229644") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230527,
                                                      "ext_mem_230527") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230528,
                                                      "ext_mem_230528") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        if (memblock_unref_device(ctx, &mem_229716,
                                                  "mem_229716") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_229838,
                                                &mem_229836, "mem_229836") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229836,
                                                  "mem_229836") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232097,
                                                  "color_232097") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229716,
                                                  "mem_229716") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229667,
                                                  "mem_229667") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229663,
                                                  "mem_229663") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229659,
                                                  "mem_229659") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229655,
                                                  "mem_229655") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229651,
                                                  "mem_229651") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229648,
                                                  "mem_229648") != 0)
                            return 1;
                    } else {
                        struct memblock_device ext_mem_229831;
                        
                        ext_mem_229831.references = NULL;
                        
                        int32_t local_memory_capacity_233296;
                        
                        local_memory_capacity_233296 =
                            ctx->opencl.max_local_memory;
                        if (sle64((int64_t) 0,
                                  sext_i32_i64(local_memory_capacity_233296)) &&
                            suff_outer_par_211756) {
                            struct memblock_device mem_229720;
                            
                            mem_229720.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229720,
                                                      bytes_229719,
                                                      "mem_229720")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_229720,
                                                                      (int64_t) 0,
                                                                      ext_mem_229471,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      s_n_m_203726,
                                                                      partition_sizze_203667 *
                                                                      n_p_203574) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229720,
                                                          "mem_229720") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229831,
                                                          "ext_mem_229831") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229838,
                                                          "ext_mem_229838") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229644,
                                                          "mem_229644") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229724;
                            
                            mem_229724.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229724,
                                                      bytes_229719,
                                                      "mem_229724")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_229724,
                                                                      (int64_t) 0,
                                                                      ext_mem_229470,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      s_n_m_203726,
                                                                      partition_sizze_203667 *
                                                                      n_p_203574) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229724,
                                                          "mem_229724") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229720,
                                                          "mem_229720") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229831,
                                                          "ext_mem_229831") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229838,
                                                          "ext_mem_229838") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229644,
                                                          "mem_229644") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229728;
                            
                            mem_229728.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229728,
                                                      bytes_229727,
                                                      "mem_229728")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_229728,
                                                                      (int64_t) 0,
                                                                      ext_mem_229373,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      defunc_0_f_res_203721,
                                                                      partition_sizze_203667 *
                                                                      n_p_203574) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229728,
                                                          "mem_229728") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229724,
                                                          "mem_229724") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229720,
                                                          "mem_229720") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229831,
                                                          "ext_mem_229831") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229838,
                                                          "ext_mem_229838") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229644,
                                                          "mem_229644") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229732;
                            
                            mem_229732.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229732,
                                                      bytes_229727,
                                                      "mem_229732")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_229732,
                                                                      (int64_t) 0,
                                                                      mem_229639,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      defunc_0_f_res_203721,
                                                                      partition_sizze_203667 *
                                                                      n_p_203574) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229732,
                                                          "mem_229732") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229728,
                                                          "mem_229728") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229724,
                                                          "mem_229724") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229720,
                                                          "mem_229720") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229831,
                                                          "ext_mem_229831") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229838,
                                                          "ext_mem_229838") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229644,
                                                          "mem_229644") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229736;
                            
                            mem_229736.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229736,
                                                      bytes_229727,
                                                      "mem_229736")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_229736,
                                                                      (int64_t) 0,
                                                                      mem_229634,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      defunc_0_f_res_203721,
                                                                      partition_sizze_203667 *
                                                                      n_p_203574) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229736,
                                                          "mem_229736") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229732,
                                                          "mem_229732") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229728,
                                                          "mem_229728") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229724,
                                                          "mem_229724") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229720,
                                                          "mem_229720") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229831,
                                                          "ext_mem_229831") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229838,
                                                          "ext_mem_229838") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229644,
                                                          "mem_229644") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229756;
                            
                            mem_229756.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229756,
                                                      bytes_229719,
                                                      "mem_229756")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232098;
                            
                            color_232098.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232098,
                                                      total_sizze_232224,
                                                      "color_232098")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211772,
                                                                    1,
                                                                    sizeof(n_p_203574),
                                                                    &n_p_203574));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211772,
                                                                    2,
                                                                    sizeof(q_s_203575),
                                                                    &q_s_203575));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211772,
                                                                    3,
                                                                    sizeof(jump_s_203581),
                                                                    &jump_s_203581));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211772,
                                                                    4,
                                                                    sizeof(partition_sizze_203667),
                                                                    &partition_sizze_203667));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211772,
                                                                    5,
                                                                    sizeof(defunc_0_f_res_203721),
                                                                    &defunc_0_f_res_203721));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211772,
                                                                    6,
                                                                    sizeof(pad_css_len_203722),
                                                                    &pad_css_len_203722));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211772,
                                                                    7,
                                                                    sizeof(s_n_m_203726),
                                                                    &s_n_m_203726));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211772,
                                                                    8,
                                                                    sizeof(num_groups_211752),
                                                                    &num_groups_211752));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211772,
                                                                    9,
                                                                    sizeof(num_threads_232223),
                                                                    &num_threads_232223));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211772,
                                                                    10,
                                                                    sizeof(ext_mem_229372.mem),
                                                                    &ext_mem_229372.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211772,
                                                                    11,
                                                                    sizeof(mem_229720.mem),
                                                                    &mem_229720.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211772,
                                                                    12,
                                                                    sizeof(mem_229724.mem),
                                                                    &mem_229724.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211772,
                                                                    13,
                                                                    sizeof(mem_229728.mem),
                                                                    &mem_229728.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211772,
                                                                    14,
                                                                    sizeof(mem_229732.mem),
                                                                    &mem_229732.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211772,
                                                                    15,
                                                                    sizeof(mem_229736.mem),
                                                                    &mem_229736.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211772,
                                                                    16,
                                                                    sizeof(mem_229756.mem),
                                                                    &mem_229756.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211772,
                                                                    17,
                                                                    sizeof(color_232098.mem),
                                                                    &color_232098.mem));
                            if (1 * ((size_t) num_groups_211752 *
                                     (size_t) segmap_group_sizze_211751) != 0) {
                                const size_t global_work_sizze_237021[1] =
                                             {(size_t) num_groups_211752 *
                                             (size_t) segmap_group_sizze_211751};
                                const size_t local_work_sizze_237025[1] =
                                             {(size_t) segmap_group_sizze_211751};
                                int64_t time_start_237022 = 0, time_end_237023 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                            "main.segmap_211772",
                                            global_work_sizze_237021[0],
                                            local_work_sizze_237025[0],
                                            (int) 0);
                                    time_start_237022 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_211772,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237021,
                                                                                local_work_sizze_237025,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_211772_runs,
                                                                                                                          &ctx->mainzisegmap_211772_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237023 = get_wall_time();
                                    
                                    long time_diff_237024 = time_end_237023 -
                                         time_start_237022;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_211772",
                                            time_diff_237024);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_229720,
                                                      "mem_229720") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229724,
                                                      "mem_229724") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229728,
                                                      "mem_229728") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229732,
                                                      "mem_229732") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229736,
                                                      "mem_229736") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232098,
                                                      "color_232098") != 0)
                                return 1;
                            
                            struct memblock_device mem_229829;
                            
                            mem_229829.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229829,
                                                      bytes_229405,
                                                      "mem_229829")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_229829,
                                                                      (int64_t) 0,
                                                                      mem_229756,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203667 *
                                                                      n_p_203574,
                                                                      s_n_m_203726) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229829,
                                                          "mem_229829") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232098,
                                                          "color_232098") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229756,
                                                          "mem_229756") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229736,
                                                          "mem_229736") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229732,
                                                          "mem_229732") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229728,
                                                          "mem_229728") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229724,
                                                          "mem_229724") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229720,
                                                          "mem_229720") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229831,
                                                          "ext_mem_229831") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229838,
                                                          "ext_mem_229838") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229644,
                                                          "mem_229644") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_229756,
                                                      "mem_229756") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_229831,
                                                    &mem_229829,
                                                    "mem_229829") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229829,
                                                      "mem_229829") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232098,
                                                      "color_232098") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229756,
                                                      "mem_229756") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229736,
                                                      "mem_229736") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229732,
                                                      "mem_229732") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229728,
                                                      "mem_229728") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229724,
                                                      "mem_229724") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229720,
                                                      "mem_229720") != 0)
                                return 1;
                        } else {
                            struct memblock_device ext_mem_229824;
                            
                            ext_mem_229824.references = NULL;
                            
                            int32_t local_memory_capacity_233295;
                            
                            local_memory_capacity_233295 =
                                ctx->opencl.max_local_memory;
                            if (sle64(bytes_229419 + srem64((int64_t) 8 -
                                                            srem64(bytes_229419,
                                                                   (int64_t) 8),
                                                            (int64_t) 8) +
                                      (bytes_229419 + srem64((int64_t) 8 -
                                                             srem64(bytes_229419,
                                                                    (int64_t) 8),
                                                             (int64_t) 8)) +
                                      (bytes_229419 + srem64((int64_t) 8 -
                                                             srem64(bytes_229419,
                                                                    (int64_t) 8),
                                                             (int64_t) 8)) +
                                      (bytes_229762 + srem64((int64_t) 8 -
                                                             srem64(bytes_229762,
                                                                    (int64_t) 8),
                                                             (int64_t) 8)) +
                                      ((int64_t) 8 * (s_n_m_203726 *
                                                      q_s_203575) +
                                       srem64((int64_t) 8 - srem64((int64_t) 8 *
                                                                   (s_n_m_203726 *
                                                                    q_s_203575),
                                                                   (int64_t) 8),
                                              (int64_t) 8)) + ((int64_t) 8 *
                                                               (s_n_m_203726 *
                                                                q_s_203575) +
                                                               srem64((int64_t) 8 -
                                                                      srem64((int64_t) 8 *
                                                                             (s_n_m_203726 *
                                                                              q_s_203575),
                                                                             (int64_t) 8),
                                                                      (int64_t) 8)),
                                      sext_i32_i64(local_memory_capacity_233295)) &&
                                intra_suff_and_fits_211767) {
                                struct memblock_device mem_229783;
                                
                                mem_229783.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_229783,
                                                          bytes_229405,
                                                          "mem_229783")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211858,
                                                                        1,
                                                                        (size_t) ((int64_t) 8 *
                                                                                  (s_n_m_203726 *
                                                                                   q_s_203575)),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211858,
                                                                        2,
                                                                        (size_t) ((int64_t) 8 *
                                                                                  (s_n_m_203726 *
                                                                                   q_s_203575)),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211858,
                                                                        3,
                                                                        (size_t) bytes_229762,
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211858,
                                                                        4,
                                                                        (size_t) bytes_229419,
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211858,
                                                                        5,
                                                                        (size_t) bytes_229419,
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211858,
                                                                        6,
                                                                        (size_t) bytes_229419,
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211858,
                                                                        7,
                                                                        sizeof(n_p_203574),
                                                                        &n_p_203574));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211858,
                                                                        8,
                                                                        sizeof(q_s_203575),
                                                                        &q_s_203575));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211858,
                                                                        9,
                                                                        sizeof(jump_s_203581),
                                                                        &jump_s_203581));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211858,
                                                                        10,
                                                                        sizeof(partition_sizze_203667),
                                                                        &partition_sizze_203667));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211858,
                                                                        11,
                                                                        sizeof(defunc_0_f_res_203721),
                                                                        &defunc_0_f_res_203721));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211858,
                                                                        12,
                                                                        sizeof(pad_css_len_203722),
                                                                        &pad_css_len_203722));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211858,
                                                                        13,
                                                                        sizeof(s_n_m_203726),
                                                                        &s_n_m_203726));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211858,
                                                                        14,
                                                                        sizeof(computed_group_sizze_211760),
                                                                        &computed_group_sizze_211760));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211858,
                                                                        15,
                                                                        sizeof(ext_mem_229372.mem),
                                                                        &ext_mem_229372.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211858,
                                                                        16,
                                                                        sizeof(ext_mem_229373.mem),
                                                                        &ext_mem_229373.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211858,
                                                                        17,
                                                                        sizeof(ext_mem_229470.mem),
                                                                        &ext_mem_229470.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211858,
                                                                        18,
                                                                        sizeof(ext_mem_229471.mem),
                                                                        &ext_mem_229471.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211858,
                                                                        19,
                                                                        sizeof(mem_229634.mem),
                                                                        &mem_229634.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211858,
                                                                        20,
                                                                        sizeof(mem_229639.mem),
                                                                        &mem_229639.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211858,
                                                                        21,
                                                                        sizeof(mem_229783.mem),
                                                                        &mem_229783.mem));
                                if (1 * ((size_t) binop_x_229310 *
                                         (size_t) computed_group_sizze_211760) !=
                                    0) {
                                    const size_t global_work_sizze_237026[1] =
                                                 {(size_t) binop_x_229310 *
                                                 (size_t) computed_group_sizze_211760};
                                    const size_t local_work_sizze_237030[1] =
                                                 {(size_t) computed_group_sizze_211760};
                                    int64_t time_start_237027 = 0,
                                            time_end_237028 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                "main.segmap_intragroup_211858",
                                                global_work_sizze_237026[0],
                                                local_work_sizze_237030[0],
                                                (int) (0 + (int64_t) 8 *
                                                       (s_n_m_203726 *
                                                        q_s_203575) +
                                                       (int64_t) 8 *
                                                       (s_n_m_203726 *
                                                        q_s_203575) +
                                                       bytes_229762 +
                                                       bytes_229419 +
                                                       bytes_229419 +
                                                       bytes_229419));
                                        time_start_237027 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegmap_intragroup_211858,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237026,
                                                                                    local_work_sizze_237030,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegmap_intragroup_211858_runs,
                                                                                                                              &ctx->mainzisegmap_intragroup_211858_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237028 = get_wall_time();
                                        
                                        long time_diff_237029 =
                                             time_end_237028 -
                                             time_start_237027;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segmap_intragroup_211858",
                                                time_diff_237029);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_set_device(ctx, &ext_mem_229824,
                                                        &mem_229783,
                                                        "mem_229783") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229783,
                                                          "mem_229783") != 0)
                                    return 1;
                            } else {
                                int64_t segmap_usable_groups_211970 =
                                        sdiv_up64(nest_sizze_208938,
                                                  segmap_group_sizze_211969);
                                struct memblock_device ext_mem_229823;
                                
                                ext_mem_229823.references = NULL;
                                
                                int32_t local_memory_capacity_233294;
                                
                                local_memory_capacity_233294 =
                                    ctx->opencl.max_local_memory;
                                if (sle64((int64_t) 0,
                                          sext_i32_i64(local_memory_capacity_233294)) &&
                                    suff_outer_par_211974) {
                                    struct memblock_device mem_229789;
                                    
                                    mem_229789.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229789,
                                                              bytes_229405,
                                                              "mem_229789")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211980,
                                                                            1,
                                                                            sizeof(n_p_203574),
                                                                            &n_p_203574));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211980,
                                                                            2,
                                                                            sizeof(q_s_203575),
                                                                            &q_s_203575));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211980,
                                                                            3,
                                                                            sizeof(jump_s_203581),
                                                                            &jump_s_203581));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211980,
                                                                            4,
                                                                            sizeof(partition_sizze_203667),
                                                                            &partition_sizze_203667));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211980,
                                                                            5,
                                                                            sizeof(defunc_0_f_res_203721),
                                                                            &defunc_0_f_res_203721));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211980,
                                                                            6,
                                                                            sizeof(pad_css_len_203722),
                                                                            &pad_css_len_203722));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211980,
                                                                            7,
                                                                            sizeof(s_n_m_203726),
                                                                            &s_n_m_203726));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211980,
                                                                            8,
                                                                            sizeof(ext_mem_229372.mem),
                                                                            &ext_mem_229372.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211980,
                                                                            9,
                                                                            sizeof(ext_mem_229373.mem),
                                                                            &ext_mem_229373.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211980,
                                                                            10,
                                                                            sizeof(ext_mem_229470.mem),
                                                                            &ext_mem_229470.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211980,
                                                                            11,
                                                                            sizeof(ext_mem_229471.mem),
                                                                            &ext_mem_229471.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211980,
                                                                            12,
                                                                            sizeof(mem_229634.mem),
                                                                            &mem_229634.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211980,
                                                                            13,
                                                                            sizeof(mem_229639.mem),
                                                                            &mem_229639.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211980,
                                                                            14,
                                                                            sizeof(mem_229789.mem),
                                                                            &mem_229789.mem));
                                    if (1 *
                                        ((size_t) segmap_usable_groups_211970 *
                                         (size_t) segmap_group_sizze_211969) !=
                                        0) {
                                        const size_t global_work_sizze_237031[1]
                                                     =
                                                     {(size_t) segmap_usable_groups_211970 *
                                                     (size_t) segmap_group_sizze_211969};
                                        const size_t local_work_sizze_237035[1]
                                                     =
                                                     {(size_t) segmap_group_sizze_211969};
                                        int64_t time_start_237032 = 0,
                                                time_end_237033 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                    "main.segmap_211980",
                                                    global_work_sizze_237031[0],
                                                    local_work_sizze_237035[0],
                                                    (int) 0);
                                            time_start_237032 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegmap_211980,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237031,
                                                                                        local_work_sizze_237035,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegmap_211980_runs,
                                                                                                                                  &ctx->mainzisegmap_211980_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237033 = get_wall_time();
                                            
                                            long time_diff_237034 =
                                                 time_end_237033 -
                                                 time_start_237032;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segmap_211980",
                                                    time_diff_237034);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_229823,
                                                            &mem_229789,
                                                            "mem_229789") != 0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229789,
                                                              "mem_229789") !=
                                        0)
                                        return 1;
                                } else {
                                    int64_t segmap_usable_groups_212063 =
                                            sdiv_up64(nest_sizze_208938,
                                                      segmap_group_sizze_212062);
                                    struct memblock_device mem_229795;
                                    
                                    mem_229795.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229795,
                                                              bytes_229405,
                                                              "mem_229795")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device mem_229799;
                                    
                                    mem_229799.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229799,
                                                              bytes_229798,
                                                              "mem_229799")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212069,
                                                                            1,
                                                                            sizeof(n_p_203574),
                                                                            &n_p_203574));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212069,
                                                                            2,
                                                                            sizeof(jump_s_203581),
                                                                            &jump_s_203581));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212069,
                                                                            3,
                                                                            sizeof(partition_sizze_203667),
                                                                            &partition_sizze_203667));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212069,
                                                                            4,
                                                                            sizeof(defunc_0_f_res_203721),
                                                                            &defunc_0_f_res_203721));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212069,
                                                                            5,
                                                                            sizeof(pad_css_len_203722),
                                                                            &pad_css_len_203722));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212069,
                                                                            6,
                                                                            sizeof(s_n_m_203726),
                                                                            &s_n_m_203726));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212069,
                                                                            7,
                                                                            sizeof(mem_229795.mem),
                                                                            &mem_229795.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212069,
                                                                            8,
                                                                            sizeof(mem_229799.mem),
                                                                            &mem_229799.mem));
                                    if (1 *
                                        ((size_t) segmap_usable_groups_212063 *
                                         (size_t) segmap_group_sizze_212062) !=
                                        0) {
                                        const size_t global_work_sizze_237036[1]
                                                     =
                                                     {(size_t) segmap_usable_groups_212063 *
                                                     (size_t) segmap_group_sizze_212062};
                                        const size_t local_work_sizze_237040[1]
                                                     =
                                                     {(size_t) segmap_group_sizze_212062};
                                        int64_t time_start_237037 = 0,
                                                time_end_237038 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                    "main.segmap_212069",
                                                    global_work_sizze_237036[0],
                                                    local_work_sizze_237040[0],
                                                    (int) 0);
                                            time_start_237037 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegmap_212069,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237036,
                                                                                        local_work_sizze_237040,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegmap_212069_runs,
                                                                                                                                  &ctx->mainzisegmap_212069_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237038 = get_wall_time();
                                            
                                            long time_diff_237039 =
                                                 time_end_237038 -
                                                 time_start_237037;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segmap_212069",
                                                    time_diff_237039);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx, &mem_229799,
                                                              "mem_229799") !=
                                        0)
                                        return 1;
                                    
                                    struct memblock_device mem_229805;
                                    
                                    mem_229805.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229805,
                                                              bytes_229405,
                                                              "mem_229805")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    if (slt64(q_s_203575 * (int64_t) 2,
                                              segred_group_sizze_212085)) {
                                        int64_t segment_sizze_nonzzero_233130 =
                                                smax64((int64_t) 1, q_s_203575);
                                        int64_t num_threads_233131 =
                                                num_groups_212086 *
                                                segred_group_sizze_212085;
                                        
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegRed-small");
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "num_segments",
                                                    (long long) (partition_sizze_203667 *
                                                                 n_p_203574 *
                                                                 s_n_m_203726),
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "segment_size",
                                                    (long long) q_s_203575,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "segments_per_group",
                                                    (long long) squot64(segred_group_sizze_212085,
                                                                        segment_sizze_nonzzero_233130),
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "required_groups",
                                                    (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                                       n_p_203574 *
                                                                                       s_n_m_203726,
                                                                                       squot64(segred_group_sizze_212085,
                                                                                               segment_sizze_nonzzero_233130))),
                                                    '\n');
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212093,
                                                                                1,
                                                                                (size_t) ((int64_t) 8 *
                                                                                          segred_group_sizze_212085),
                                                                                NULL));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212093,
                                                                                2,
                                                                                sizeof(n_p_203574),
                                                                                &n_p_203574));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212093,
                                                                                3,
                                                                                sizeof(q_s_203575),
                                                                                &q_s_203575));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212093,
                                                                                4,
                                                                                sizeof(partition_sizze_203667),
                                                                                &partition_sizze_203667));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212093,
                                                                                5,
                                                                                sizeof(defunc_0_f_res_203721),
                                                                                &defunc_0_f_res_203721));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212093,
                                                                                6,
                                                                                sizeof(s_n_m_203726),
                                                                                &s_n_m_203726));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212093,
                                                                                7,
                                                                                sizeof(num_groups_212086),
                                                                                &num_groups_212086));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212093,
                                                                                8,
                                                                                sizeof(segment_sizze_nonzzero_233130),
                                                                                &segment_sizze_nonzzero_233130));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212093,
                                                                                9,
                                                                                sizeof(ext_mem_229372.mem),
                                                                                &ext_mem_229372.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212093,
                                                                                10,
                                                                                sizeof(ext_mem_229373.mem),
                                                                                &ext_mem_229373.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212093,
                                                                                11,
                                                                                sizeof(ext_mem_229470.mem),
                                                                                &ext_mem_229470.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212093,
                                                                                12,
                                                                                sizeof(ext_mem_229471.mem),
                                                                                &ext_mem_229471.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212093,
                                                                                13,
                                                                                sizeof(mem_229639.mem),
                                                                                &mem_229639.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212093,
                                                                                14,
                                                                                sizeof(mem_229795.mem),
                                                                                &mem_229795.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212093,
                                                                                15,
                                                                                sizeof(mem_229805.mem),
                                                                                &mem_229805.mem));
                                        if (1 * ((size_t) num_groups_212086 *
                                                 (size_t) segred_group_sizze_212085) !=
                                            0) {
                                            const size_t
                                            global_work_sizze_237041[1] =
                                            {(size_t) num_groups_212086 *
                                            (size_t) segred_group_sizze_212085};
                                            const size_t
                                            local_work_sizze_237045[1] =
                                            {(size_t) segred_group_sizze_212085};
                                            int64_t time_start_237042 = 0,
                                                    time_end_237043 = 0;
                                            
                                            if (ctx->debugging) {
                                                fprintf(ctx->log,
                                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                        "main.segred_small_212093",
                                                        global_work_sizze_237041[0],
                                                        local_work_sizze_237045[0],
                                                        (int) (0 + (int64_t) 8 *
                                                               segred_group_sizze_212085));
                                                time_start_237042 =
                                                    get_wall_time();
                                            }
                                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                            ctx->mainzisegred_small_212093,
                                                                                            1,
                                                                                            NULL,
                                                                                            global_work_sizze_237041,
                                                                                            local_work_sizze_237045,
                                                                                            0,
                                                                                            NULL,
                                                                                            ctx->profiling_paused ||
                                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                      &ctx->mainzisegred_small_212093_runs,
                                                                                                                                      &ctx->mainzisegred_small_212093_total_runtime)));
                                            if (ctx->debugging) {
                                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                time_end_237043 =
                                                    get_wall_time();
                                                
                                                long time_diff_237044 =
                                                     time_end_237043 -
                                                     time_start_237042;
                                                
                                                fprintf(ctx->log,
                                                        "kernel %s runtime: %ldus\n",
                                                        "main.segred_small_212093",
                                                        time_diff_237044);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                    } else {
                                        int64_t groups_per_segment_233161 =
                                                sdiv_up64(num_groups_212086,
                                                          smax64((int64_t) 1,
                                                                 partition_sizze_203667 *
                                                                 n_p_203574 *
                                                                 s_n_m_203726));
                                        int64_t elements_per_thread_233162 =
                                                sdiv_up64(q_s_203575,
                                                          segred_group_sizze_212085 *
                                                          groups_per_segment_233161);
                                        int64_t virt_num_groups_233163 =
                                                groups_per_segment_233161 *
                                                (partition_sizze_203667 *
                                                 n_p_203574 * s_n_m_203726);
                                        int64_t num_threads_233164 =
                                                num_groups_212086 *
                                                segred_group_sizze_212085;
                                        int64_t threads_per_segment_233165 =
                                                groups_per_segment_233161 *
                                                segred_group_sizze_212085;
                                        
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegRed-large");
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "num_segments",
                                                    (long long) (partition_sizze_203667 *
                                                                 n_p_203574 *
                                                                 s_n_m_203726),
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "segment_size",
                                                    (long long) q_s_203575,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "virt_num_groups",
                                                    (long long) virt_num_groups_233163,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "num_groups",
                                                    (long long) num_groups_212086,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "group_size",
                                                    (long long) segred_group_sizze_212085,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "elems_per_thread",
                                                    (long long) elements_per_thread_233162,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "groups_per_segment",
                                                    (long long) groups_per_segment_233161,
                                                    '\n');
                                        
                                        struct memblock_device
                                        segred_tmp_mem_233166;
                                        
                                        segred_tmp_mem_233166.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &segred_tmp_mem_233166,
                                                                  (int64_t) 8 *
                                                                  virt_num_groups_233163,
                                                                  "segred_tmp_mem_233166")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device
                                        mainzicounter_mem_233168 =
                                        ctx->mainzicounter_mem_233168;
                                        
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212093,
                                                                                1,
                                                                                (size_t) 1,
                                                                                NULL));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212093,
                                                                                2,
                                                                                (size_t) ((int64_t) 8 *
                                                                                          segred_group_sizze_212085),
                                                                                NULL));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212093,
                                                                                3,
                                                                                sizeof(n_p_203574),
                                                                                &n_p_203574));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212093,
                                                                                4,
                                                                                sizeof(q_s_203575),
                                                                                &q_s_203575));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212093,
                                                                                5,
                                                                                sizeof(partition_sizze_203667),
                                                                                &partition_sizze_203667));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212093,
                                                                                6,
                                                                                sizeof(defunc_0_f_res_203721),
                                                                                &defunc_0_f_res_203721));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212093,
                                                                                7,
                                                                                sizeof(s_n_m_203726),
                                                                                &s_n_m_203726));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212093,
                                                                                8,
                                                                                sizeof(num_groups_212086),
                                                                                &num_groups_212086));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212093,
                                                                                9,
                                                                                sizeof(groups_per_segment_233161),
                                                                                &groups_per_segment_233161));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212093,
                                                                                10,
                                                                                sizeof(elements_per_thread_233162),
                                                                                &elements_per_thread_233162));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212093,
                                                                                11,
                                                                                sizeof(virt_num_groups_233163),
                                                                                &virt_num_groups_233163));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212093,
                                                                                12,
                                                                                sizeof(threads_per_segment_233165),
                                                                                &threads_per_segment_233165));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212093,
                                                                                13,
                                                                                sizeof(ext_mem_229372.mem),
                                                                                &ext_mem_229372.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212093,
                                                                                14,
                                                                                sizeof(ext_mem_229373.mem),
                                                                                &ext_mem_229373.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212093,
                                                                                15,
                                                                                sizeof(ext_mem_229470.mem),
                                                                                &ext_mem_229470.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212093,
                                                                                16,
                                                                                sizeof(ext_mem_229471.mem),
                                                                                &ext_mem_229471.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212093,
                                                                                17,
                                                                                sizeof(mem_229639.mem),
                                                                                &mem_229639.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212093,
                                                                                18,
                                                                                sizeof(mem_229795.mem),
                                                                                &mem_229795.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212093,
                                                                                19,
                                                                                sizeof(mem_229805.mem),
                                                                                &mem_229805.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212093,
                                                                                20,
                                                                                sizeof(segred_tmp_mem_233166.mem),
                                                                                &segred_tmp_mem_233166.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212093,
                                                                                21,
                                                                                sizeof(mainzicounter_mem_233168.mem),
                                                                                &mainzicounter_mem_233168.mem));
                                        if (1 * ((size_t) num_groups_212086 *
                                                 (size_t) segred_group_sizze_212085) !=
                                            0) {
                                            const size_t
                                            global_work_sizze_237047[1] =
                                            {(size_t) num_groups_212086 *
                                            (size_t) segred_group_sizze_212085};
                                            const size_t
                                            local_work_sizze_237051[1] =
                                            {(size_t) segred_group_sizze_212085};
                                            int64_t time_start_237048 = 0,
                                                    time_end_237049 = 0;
                                            
                                            if (ctx->debugging) {
                                                fprintf(ctx->log,
                                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                        "main.segred_large_212093",
                                                        global_work_sizze_237047[0],
                                                        local_work_sizze_237051[0],
                                                        (int) (0 + 1 +
                                                               (int64_t) 8 *
                                                               segred_group_sizze_212085));
                                                time_start_237048 =
                                                    get_wall_time();
                                            }
                                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                            ctx->mainzisegred_large_212093,
                                                                                            1,
                                                                                            NULL,
                                                                                            global_work_sizze_237047,
                                                                                            local_work_sizze_237051,
                                                                                            0,
                                                                                            NULL,
                                                                                            ctx->profiling_paused ||
                                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                      &ctx->mainzisegred_large_212093_runs,
                                                                                                                                      &ctx->mainzisegred_large_212093_total_runtime)));
                                            if (ctx->debugging) {
                                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                time_end_237049 =
                                                    get_wall_time();
                                                
                                                long time_diff_237050 =
                                                     time_end_237049 -
                                                     time_start_237048;
                                                
                                                fprintf(ctx->log,
                                                        "kernel %s runtime: %ldus\n",
                                                        "main.segred_large_212093",
                                                        time_diff_237050);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_unref_device(ctx,
                                                                  &segred_tmp_mem_233166,
                                                                  "segred_tmp_mem_233166") !=
                                            0)
                                            return 1;
                                    }
                                    if (memblock_unref_device(ctx, &mem_229795,
                                                              "mem_229795") !=
                                        0)
                                        return 1;
                                    
                                    int64_t segmap_usable_groups_212135 =
                                            sdiv_up64(nest_sizze_208938,
                                                      segmap_group_sizze_212134);
                                    struct memblock_device mem_229811;
                                    
                                    mem_229811.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229811,
                                                              bytes_229405,
                                                              "mem_229811")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device mem_229816;
                                    
                                    mem_229816.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229816,
                                                              bytes_229405,
                                                              "mem_229816")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212141,
                                                                            1,
                                                                            sizeof(n_p_203574),
                                                                            &n_p_203574));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212141,
                                                                            2,
                                                                            sizeof(jump_s_203581),
                                                                            &jump_s_203581));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212141,
                                                                            3,
                                                                            sizeof(partition_sizze_203667),
                                                                            &partition_sizze_203667));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212141,
                                                                            4,
                                                                            sizeof(defunc_0_f_res_203721),
                                                                            &defunc_0_f_res_203721));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212141,
                                                                            5,
                                                                            sizeof(pad_css_len_203722),
                                                                            &pad_css_len_203722));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212141,
                                                                            6,
                                                                            sizeof(s_n_m_203726),
                                                                            &s_n_m_203726));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212141,
                                                                            7,
                                                                            sizeof(mem_229805.mem),
                                                                            &mem_229805.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212141,
                                                                            8,
                                                                            sizeof(mem_229811.mem),
                                                                            &mem_229811.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212141,
                                                                            9,
                                                                            sizeof(mem_229816.mem),
                                                                            &mem_229816.mem));
                                    if (1 *
                                        ((size_t) segmap_usable_groups_212135 *
                                         (size_t) segmap_group_sizze_212134) !=
                                        0) {
                                        const size_t global_work_sizze_237052[1]
                                                     =
                                                     {(size_t) segmap_usable_groups_212135 *
                                                     (size_t) segmap_group_sizze_212134};
                                        const size_t local_work_sizze_237056[1]
                                                     =
                                                     {(size_t) segmap_group_sizze_212134};
                                        int64_t time_start_237053 = 0,
                                                time_end_237054 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                    "main.segmap_212141",
                                                    global_work_sizze_237052[0],
                                                    local_work_sizze_237056[0],
                                                    (int) 0);
                                            time_start_237053 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegmap_212141,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237052,
                                                                                        local_work_sizze_237056,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegmap_212141_runs,
                                                                                                                                  &ctx->mainzisegmap_212141_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237054 = get_wall_time();
                                            
                                            long time_diff_237055 =
                                                 time_end_237054 -
                                                 time_start_237053;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segmap_212141",
                                                    time_diff_237055);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx, &mem_229805,
                                                              "mem_229805") !=
                                        0)
                                        return 1;
                                    
                                    struct memblock_device mem_229822;
                                    
                                    mem_229822.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229822,
                                                              bytes_229405,
                                                              "mem_229822")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    if (slt64(q_s_203575 * (int64_t) 2,
                                              segred_group_sizze_212159)) {
                                        int64_t segment_sizze_nonzzero_233218 =
                                                smax64((int64_t) 1, q_s_203575);
                                        int64_t num_threads_233219 =
                                                num_groups_212160 *
                                                segred_group_sizze_212159;
                                        
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegRed-small");
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "num_segments",
                                                    (long long) (partition_sizze_203667 *
                                                                 n_p_203574 *
                                                                 s_n_m_203726),
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "segment_size",
                                                    (long long) q_s_203575,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "segments_per_group",
                                                    (long long) squot64(segred_group_sizze_212159,
                                                                        segment_sizze_nonzzero_233218),
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "required_groups",
                                                    (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                                       n_p_203574 *
                                                                                       s_n_m_203726,
                                                                                       squot64(segred_group_sizze_212159,
                                                                                               segment_sizze_nonzzero_233218))),
                                                    '\n');
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212167,
                                                                                1,
                                                                                (size_t) ((int64_t) 8 *
                                                                                          segred_group_sizze_212159),
                                                                                NULL));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212167,
                                                                                2,
                                                                                sizeof(n_p_203574),
                                                                                &n_p_203574));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212167,
                                                                                3,
                                                                                sizeof(q_s_203575),
                                                                                &q_s_203575));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212167,
                                                                                4,
                                                                                sizeof(partition_sizze_203667),
                                                                                &partition_sizze_203667));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212167,
                                                                                5,
                                                                                sizeof(defunc_0_f_res_203721),
                                                                                &defunc_0_f_res_203721));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212167,
                                                                                6,
                                                                                sizeof(s_n_m_203726),
                                                                                &s_n_m_203726));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212167,
                                                                                7,
                                                                                sizeof(num_groups_212160),
                                                                                &num_groups_212160));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212167,
                                                                                8,
                                                                                sizeof(segment_sizze_nonzzero_233218),
                                                                                &segment_sizze_nonzzero_233218));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212167,
                                                                                9,
                                                                                sizeof(ext_mem_229372.mem),
                                                                                &ext_mem_229372.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212167,
                                                                                10,
                                                                                sizeof(ext_mem_229373.mem),
                                                                                &ext_mem_229373.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212167,
                                                                                11,
                                                                                sizeof(ext_mem_229470.mem),
                                                                                &ext_mem_229470.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212167,
                                                                                12,
                                                                                sizeof(ext_mem_229471.mem),
                                                                                &ext_mem_229471.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212167,
                                                                                13,
                                                                                sizeof(mem_229634.mem),
                                                                                &mem_229634.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212167,
                                                                                14,
                                                                                sizeof(mem_229639.mem),
                                                                                &mem_229639.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212167,
                                                                                15,
                                                                                sizeof(mem_229811.mem),
                                                                                &mem_229811.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212167,
                                                                                16,
                                                                                sizeof(mem_229816.mem),
                                                                                &mem_229816.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212167,
                                                                                17,
                                                                                sizeof(mem_229822.mem),
                                                                                &mem_229822.mem));
                                        if (1 * ((size_t) num_groups_212160 *
                                                 (size_t) segred_group_sizze_212159) !=
                                            0) {
                                            const size_t
                                            global_work_sizze_237057[1] =
                                            {(size_t) num_groups_212160 *
                                            (size_t) segred_group_sizze_212159};
                                            const size_t
                                            local_work_sizze_237061[1] =
                                            {(size_t) segred_group_sizze_212159};
                                            int64_t time_start_237058 = 0,
                                                    time_end_237059 = 0;
                                            
                                            if (ctx->debugging) {
                                                fprintf(ctx->log,
                                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                        "main.segred_small_212167",
                                                        global_work_sizze_237057[0],
                                                        local_work_sizze_237061[0],
                                                        (int) (0 + (int64_t) 8 *
                                                               segred_group_sizze_212159));
                                                time_start_237058 =
                                                    get_wall_time();
                                            }
                                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                            ctx->mainzisegred_small_212167,
                                                                                            1,
                                                                                            NULL,
                                                                                            global_work_sizze_237057,
                                                                                            local_work_sizze_237061,
                                                                                            0,
                                                                                            NULL,
                                                                                            ctx->profiling_paused ||
                                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                      &ctx->mainzisegred_small_212167_runs,
                                                                                                                                      &ctx->mainzisegred_small_212167_total_runtime)));
                                            if (ctx->debugging) {
                                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                time_end_237059 =
                                                    get_wall_time();
                                                
                                                long time_diff_237060 =
                                                     time_end_237059 -
                                                     time_start_237058;
                                                
                                                fprintf(ctx->log,
                                                        "kernel %s runtime: %ldus\n",
                                                        "main.segred_small_212167",
                                                        time_diff_237060);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                    } else {
                                        int64_t groups_per_segment_233249 =
                                                sdiv_up64(num_groups_212160,
                                                          smax64((int64_t) 1,
                                                                 partition_sizze_203667 *
                                                                 n_p_203574 *
                                                                 s_n_m_203726));
                                        int64_t elements_per_thread_233250 =
                                                sdiv_up64(q_s_203575,
                                                          segred_group_sizze_212159 *
                                                          groups_per_segment_233249);
                                        int64_t virt_num_groups_233251 =
                                                groups_per_segment_233249 *
                                                (partition_sizze_203667 *
                                                 n_p_203574 * s_n_m_203726);
                                        int64_t num_threads_233252 =
                                                num_groups_212160 *
                                                segred_group_sizze_212159;
                                        int64_t threads_per_segment_233253 =
                                                groups_per_segment_233249 *
                                                segred_group_sizze_212159;
                                        
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegRed-large");
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "num_segments",
                                                    (long long) (partition_sizze_203667 *
                                                                 n_p_203574 *
                                                                 s_n_m_203726),
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "segment_size",
                                                    (long long) q_s_203575,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "virt_num_groups",
                                                    (long long) virt_num_groups_233251,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "num_groups",
                                                    (long long) num_groups_212160,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "group_size",
                                                    (long long) segred_group_sizze_212159,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "elems_per_thread",
                                                    (long long) elements_per_thread_233250,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "groups_per_segment",
                                                    (long long) groups_per_segment_233249,
                                                    '\n');
                                        
                                        struct memblock_device
                                        segred_tmp_mem_233254;
                                        
                                        segred_tmp_mem_233254.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &segred_tmp_mem_233254,
                                                                  (int64_t) 8 *
                                                                  virt_num_groups_233251,
                                                                  "segred_tmp_mem_233254")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device
                                        mainzicounter_mem_233256 =
                                        ctx->mainzicounter_mem_233256;
                                        
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212167,
                                                                                1,
                                                                                (size_t) 1,
                                                                                NULL));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212167,
                                                                                2,
                                                                                (size_t) ((int64_t) 8 *
                                                                                          segred_group_sizze_212159),
                                                                                NULL));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212167,
                                                                                3,
                                                                                sizeof(n_p_203574),
                                                                                &n_p_203574));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212167,
                                                                                4,
                                                                                sizeof(q_s_203575),
                                                                                &q_s_203575));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212167,
                                                                                5,
                                                                                sizeof(partition_sizze_203667),
                                                                                &partition_sizze_203667));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212167,
                                                                                6,
                                                                                sizeof(defunc_0_f_res_203721),
                                                                                &defunc_0_f_res_203721));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212167,
                                                                                7,
                                                                                sizeof(s_n_m_203726),
                                                                                &s_n_m_203726));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212167,
                                                                                8,
                                                                                sizeof(num_groups_212160),
                                                                                &num_groups_212160));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212167,
                                                                                9,
                                                                                sizeof(groups_per_segment_233249),
                                                                                &groups_per_segment_233249));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212167,
                                                                                10,
                                                                                sizeof(elements_per_thread_233250),
                                                                                &elements_per_thread_233250));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212167,
                                                                                11,
                                                                                sizeof(virt_num_groups_233251),
                                                                                &virt_num_groups_233251));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212167,
                                                                                12,
                                                                                sizeof(threads_per_segment_233253),
                                                                                &threads_per_segment_233253));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212167,
                                                                                13,
                                                                                sizeof(ext_mem_229372.mem),
                                                                                &ext_mem_229372.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212167,
                                                                                14,
                                                                                sizeof(ext_mem_229373.mem),
                                                                                &ext_mem_229373.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212167,
                                                                                15,
                                                                                sizeof(ext_mem_229470.mem),
                                                                                &ext_mem_229470.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212167,
                                                                                16,
                                                                                sizeof(ext_mem_229471.mem),
                                                                                &ext_mem_229471.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212167,
                                                                                17,
                                                                                sizeof(mem_229634.mem),
                                                                                &mem_229634.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212167,
                                                                                18,
                                                                                sizeof(mem_229639.mem),
                                                                                &mem_229639.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212167,
                                                                                19,
                                                                                sizeof(mem_229811.mem),
                                                                                &mem_229811.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212167,
                                                                                20,
                                                                                sizeof(mem_229816.mem),
                                                                                &mem_229816.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212167,
                                                                                21,
                                                                                sizeof(mem_229822.mem),
                                                                                &mem_229822.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212167,
                                                                                22,
                                                                                sizeof(segred_tmp_mem_233254.mem),
                                                                                &segred_tmp_mem_233254.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212167,
                                                                                23,
                                                                                sizeof(mainzicounter_mem_233256.mem),
                                                                                &mainzicounter_mem_233256.mem));
                                        if (1 * ((size_t) num_groups_212160 *
                                                 (size_t) segred_group_sizze_212159) !=
                                            0) {
                                            const size_t
                                            global_work_sizze_237063[1] =
                                            {(size_t) num_groups_212160 *
                                            (size_t) segred_group_sizze_212159};
                                            const size_t
                                            local_work_sizze_237067[1] =
                                            {(size_t) segred_group_sizze_212159};
                                            int64_t time_start_237064 = 0,
                                                    time_end_237065 = 0;
                                            
                                            if (ctx->debugging) {
                                                fprintf(ctx->log,
                                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                        "main.segred_large_212167",
                                                        global_work_sizze_237063[0],
                                                        local_work_sizze_237067[0],
                                                        (int) (0 + 1 +
                                                               (int64_t) 8 *
                                                               segred_group_sizze_212159));
                                                time_start_237064 =
                                                    get_wall_time();
                                            }
                                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                            ctx->mainzisegred_large_212167,
                                                                                            1,
                                                                                            NULL,
                                                                                            global_work_sizze_237063,
                                                                                            local_work_sizze_237067,
                                                                                            0,
                                                                                            NULL,
                                                                                            ctx->profiling_paused ||
                                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                      &ctx->mainzisegred_large_212167_runs,
                                                                                                                                      &ctx->mainzisegred_large_212167_total_runtime)));
                                            if (ctx->debugging) {
                                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                time_end_237065 =
                                                    get_wall_time();
                                                
                                                long time_diff_237066 =
                                                     time_end_237065 -
                                                     time_start_237064;
                                                
                                                fprintf(ctx->log,
                                                        "kernel %s runtime: %ldus\n",
                                                        "main.segred_large_212167",
                                                        time_diff_237066);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_unref_device(ctx,
                                                                  &segred_tmp_mem_233254,
                                                                  "segred_tmp_mem_233254") !=
                                            0)
                                            return 1;
                                    }
                                    if (memblock_unref_device(ctx, &mem_229811,
                                                              "mem_229811") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229816,
                                                              "mem_229816") !=
                                        0)
                                        return 1;
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_229823,
                                                            &mem_229822,
                                                            "mem_229822") != 0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229822,
                                                              "mem_229822") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229816,
                                                              "mem_229816") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229811,
                                                              "mem_229811") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229805,
                                                              "mem_229805") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229799,
                                                              "mem_229799") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229795,
                                                              "mem_229795") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_set_device(ctx, &ext_mem_229824,
                                                        &ext_mem_229823,
                                                        "ext_mem_229823") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229823,
                                                          "ext_mem_229823") !=
                                    0)
                                    return 1;
                            }
                            if (memblock_set_device(ctx, &ext_mem_229831,
                                                    &ext_mem_229824,
                                                    "ext_mem_229824") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229824,
                                                      "ext_mem_229824") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_229838,
                                                &ext_mem_229831,
                                                "ext_mem_229831") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229831,
                                                  "ext_mem_229831") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_230528,
                                            &ext_mem_229838,
                                            "ext_mem_229838") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_230527, &mem_229644,
                                            "mem_229644") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229838,
                                              "ext_mem_229838") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229644, "mem_229644") !=
                        0)
                        return 1;
                } else {
                    bool match_lit_204426 = (int64_t) 1 == d_s_203578;
                    struct memblock_device ext_mem_230526;
                    
                    ext_mem_230526.references = NULL;
                    
                    struct memblock_device ext_mem_230525;
                    
                    ext_mem_230525.references = NULL;
                    if (match_lit_204426) {
                        bool suff_outer_par_212219;
                        
                        suff_outer_par_212219 =
                            *ctx->tuning_params.mainzisuff_outer_par_11 <=
                            partition_sizze_203667;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_11",
                                    (long) partition_sizze_203667,
                                    suff_outer_par_212219 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_212349;
                        
                        segmap_group_sizze_212349 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_212223;
                        
                        int64_t num_groups_212350;
                        int32_t max_num_groups_233298;
                        
                        max_num_groups_233298 =
                            *ctx->tuning_params.mainzisegmap_num_groups_212225;
                        num_groups_212350 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(partition_sizze_203667,
                                                                                 segmap_group_sizze_212349),
                                                                       sext_i32_i64(max_num_groups_233298))));
                        
                        int64_t segmap_group_sizze_213786;
                        
                        segmap_group_sizze_213786 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_212479;
                        
                        int64_t num_groups_213787;
                        int32_t max_num_groups_233299;
                        
                        max_num_groups_233299 =
                            *ctx->tuning_params.mainzisegmap_num_groups_212481;
                        num_groups_213787 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(binop_x_229310,
                                                                                 segmap_group_sizze_213786),
                                                                       sext_i32_i64(max_num_groups_233299))));
                        
                        bool suff_outer_par_213791;
                        
                        suff_outer_par_213791 =
                            *ctx->tuning_params.mainzisuff_outer_par_12 <=
                            binop_x_229310;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_12",
                                    (long) binop_x_229310,
                                    suff_outer_par_213791 ? "true" : "false");
                        
                        int64_t one_intra_par_min_213792 = q_s_203575 *
                                s_n_m_203726;
                        int64_t intra_avail_par_213794 = smin64(s_n_m_203726,
                                                                one_intra_par_min_213792);
                        int64_t computed_group_sizze_213795 =
                                smax64(s_n_m_203726, one_intra_par_min_213792);
                        bool fits_213799 = sle64(computed_group_sizze_213795,
                                                 max_group_sizze_206977);
                        bool suff_intra_par_213801;
                        
                        suff_intra_par_213801 =
                            *ctx->tuning_params.mainzisuff_intra_par_13 <=
                            intra_avail_par_213794;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_intra_par_13",
                                    (long) intra_avail_par_213794,
                                    suff_intra_par_213801 ? "true" : "false");
                        
                        bool intra_suff_and_fits_213802 = fits_213799 &&
                             suff_intra_par_213801;
                        int64_t segmap_group_sizze_214071;
                        
                        segmap_group_sizze_214071 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_212912;
                        
                        bool suff_outer_par_214076;
                        
                        suff_outer_par_214076 =
                            *ctx->tuning_params.mainzisuff_outer_par_14 <=
                            nest_sizze_208938;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_14",
                                    (long) nest_sizze_208938,
                                    suff_outer_par_214076 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_214194;
                        
                        segmap_group_sizze_214194 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_213247;
                        
                        int64_t nest_sizze_214216 = q_s_203575 *
                                nest_sizze_208938;
                        int64_t segred_group_sizze_214217;
                        
                        segred_group_sizze_214217 =
                            *ctx->tuning_params.mainzisegred_group_sizze_213183;
                        
                        int64_t num_groups_214218;
                        int32_t max_num_groups_233300;
                        
                        max_num_groups_233300 =
                            *ctx->tuning_params.mainzisegred_num_groups_213185;
                        num_groups_214218 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_214216,
                                                                                 segred_group_sizze_214217),
                                                                       sext_i32_i64(max_num_groups_233300))));
                        
                        int64_t segmap_group_sizze_214276;
                        
                        segmap_group_sizze_214276 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_213144;
                        
                        int64_t segred_group_sizze_214312;
                        
                        segred_group_sizze_214312 =
                            *ctx->tuning_params.mainzisegred_group_sizze_213050;
                        
                        int64_t num_groups_214313;
                        int32_t max_num_groups_233301;
                        
                        max_num_groups_233301 =
                            *ctx->tuning_params.mainzisegred_num_groups_213052;
                        num_groups_214313 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_214216,
                                                                                 segred_group_sizze_214312),
                                                                       sext_i32_i64(max_num_groups_233301))));
                        
                        int64_t bytes_229841 = (int64_t) 8 * nest_sizze_208938;
                        int64_t bytes_229848 = (int64_t) 8 * nest_sizze_207253;
                        int64_t binop_x_229959 = partition_sizze_203667 *
                                s_n_m_203726;
                        int64_t binop_x_229960 = n_p_203574 * binop_x_229959;
                        int64_t bytes_229961 = (int64_t) 8 * binop_x_229960;
                        int64_t binop_x_229967 = partition_sizze_203667 *
                                defunc_0_f_res_203721;
                        int64_t binop_x_229968 = n_p_203574 * binop_x_229967;
                        int64_t bytes_229969 = (int64_t) 8 * binop_x_229968;
                        int64_t bytes_230023 = smax64((int64_t) 0,
                                                      s_n_m_203726);
                        int64_t bytes_230084 = smax64((int64_t) 0,
                                                      binop_x_229403);
                        int64_t num_threads_232231 = segmap_group_sizze_212349 *
                                num_groups_212350;
                        int64_t total_sizze_232232 = bytes_229396 *
                                num_threads_232231;
                        int64_t total_sizze_232233 = bytes_229396 *
                                num_threads_232231;
                        int64_t num_threads_232234 = segmap_group_sizze_213786 *
                                num_groups_213787;
                        int64_t total_sizze_232235 = bytes_229419 *
                                num_threads_232234;
                        int64_t total_sizze_232236 = bytes_229419 *
                                num_threads_232234;
                        struct memblock_device ext_mem_230165;
                        
                        ext_mem_230165.references = NULL;
                        
                        struct memblock_device ext_mem_230164;
                        
                        ext_mem_230164.references = NULL;
                        
                        int32_t local_memory_capacity_233672;
                        
                        local_memory_capacity_233672 =
                            ctx->opencl.max_local_memory;
                        if (sle64((int64_t) 0,
                                  sext_i32_i64(local_memory_capacity_233672)) &&
                            suff_outer_par_212219) {
                            struct memblock_device mem_229842;
                            
                            mem_229842.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229842,
                                                      bytes_229841,
                                                      "mem_229842")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_229842,
                                                                      (int64_t) 0,
                                                                      ext_mem_229470,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203574 *
                                                                      s_n_m_203726,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229842,
                                                          "mem_229842") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230164,
                                                          "ext_mem_230164") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230165,
                                                          "ext_mem_230165") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229845;
                            
                            mem_229845.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229845,
                                                      binop_y_229332,
                                                      "mem_229845")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_229845,
                                                                      (int64_t) 0,
                                                                      ext_mem_229372,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203574,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229845,
                                                          "mem_229845") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229842,
                                                          "mem_229842") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230164,
                                                          "ext_mem_230164") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230165,
                                                          "ext_mem_230165") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229849;
                            
                            mem_229849.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229849,
                                                      bytes_229848,
                                                      "mem_229849")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_229849,
                                                                      (int64_t) 0,
                                                                      mem_229639,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203574 *
                                                                      defunc_0_f_res_203721,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229849,
                                                          "mem_229849") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229845,
                                                          "mem_229845") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229842,
                                                          "mem_229842") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230164,
                                                          "ext_mem_230164") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230165,
                                                          "ext_mem_230165") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229853;
                            
                            mem_229853.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229853,
                                                      bytes_229841,
                                                      "mem_229853")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_229853,
                                                                      (int64_t) 0,
                                                                      ext_mem_229471,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203574 *
                                                                      s_n_m_203726,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229853,
                                                          "mem_229853") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229849,
                                                          "mem_229849") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229845,
                                                          "mem_229845") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229842,
                                                          "mem_229842") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230164,
                                                          "ext_mem_230164") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230165,
                                                          "ext_mem_230165") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229857;
                            
                            mem_229857.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229857,
                                                      bytes_229848,
                                                      "mem_229857")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_229857,
                                                                      (int64_t) 0,
                                                                      mem_229634,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203574 *
                                                                      defunc_0_f_res_203721,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229857,
                                                          "mem_229857") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229853,
                                                          "mem_229853") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229849,
                                                          "mem_229849") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229845,
                                                          "mem_229845") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229842,
                                                          "mem_229842") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230164,
                                                          "ext_mem_230164") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230165,
                                                          "ext_mem_230165") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229861;
                            
                            mem_229861.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229861,
                                                      bytes_229848,
                                                      "mem_229861")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_229861,
                                                                      (int64_t) 0,
                                                                      ext_mem_229373,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203574 *
                                                                      defunc_0_f_res_203721,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229861,
                                                          "mem_229861") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229857,
                                                          "mem_229857") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229853,
                                                          "mem_229853") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229849,
                                                          "mem_229849") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229845,
                                                          "mem_229845") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229842,
                                                          "mem_229842") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230164,
                                                          "ext_mem_230164") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230165,
                                                          "ext_mem_230165") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229954;
                            
                            mem_229954.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229954,
                                                      bytes_229841,
                                                      "mem_229954")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229958;
                            
                            mem_229958.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229958,
                                                      bytes_229841,
                                                      "mem_229958")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232103;
                            
                            color_232103.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232103,
                                                      total_sizze_232232,
                                                      "color_232103")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232104;
                            
                            color_232104.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232104,
                                                      total_sizze_232233,
                                                      "color_232104")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212355,
                                                                    1,
                                                                    sizeof(n_p_203574),
                                                                    &n_p_203574));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212355,
                                                                    2,
                                                                    sizeof(q_s_203575),
                                                                    &q_s_203575));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212355,
                                                                    3,
                                                                    sizeof(jump_s_203581),
                                                                    &jump_s_203581));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212355,
                                                                    4,
                                                                    sizeof(partition_sizze_203667),
                                                                    &partition_sizze_203667));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212355,
                                                                    5,
                                                                    sizeof(defunc_0_f_res_203721),
                                                                    &defunc_0_f_res_203721));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212355,
                                                                    6,
                                                                    sizeof(pad_css_len_203722),
                                                                    &pad_css_len_203722));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212355,
                                                                    7,
                                                                    sizeof(s_n_m_203726),
                                                                    &s_n_m_203726));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212355,
                                                                    8,
                                                                    sizeof(num_groups_212350),
                                                                    &num_groups_212350));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212355,
                                                                    9,
                                                                    sizeof(num_threads_232231),
                                                                    &num_threads_232231));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212355,
                                                                    10,
                                                                    sizeof(mem_229842.mem),
                                                                    &mem_229842.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212355,
                                                                    11,
                                                                    sizeof(mem_229845.mem),
                                                                    &mem_229845.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212355,
                                                                    12,
                                                                    sizeof(mem_229849.mem),
                                                                    &mem_229849.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212355,
                                                                    13,
                                                                    sizeof(mem_229853.mem),
                                                                    &mem_229853.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212355,
                                                                    14,
                                                                    sizeof(mem_229857.mem),
                                                                    &mem_229857.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212355,
                                                                    15,
                                                                    sizeof(mem_229861.mem),
                                                                    &mem_229861.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212355,
                                                                    16,
                                                                    sizeof(mem_229954.mem),
                                                                    &mem_229954.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212355,
                                                                    17,
                                                                    sizeof(mem_229958.mem),
                                                                    &mem_229958.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212355,
                                                                    18,
                                                                    sizeof(color_232103.mem),
                                                                    &color_232103.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212355,
                                                                    19,
                                                                    sizeof(color_232104.mem),
                                                                    &color_232104.mem));
                            if (1 * ((size_t) num_groups_212350 *
                                     (size_t) segmap_group_sizze_212349) != 0) {
                                const size_t global_work_sizze_237068[1] =
                                             {(size_t) num_groups_212350 *
                                             (size_t) segmap_group_sizze_212349};
                                const size_t local_work_sizze_237072[1] =
                                             {(size_t) segmap_group_sizze_212349};
                                int64_t time_start_237069 = 0, time_end_237070 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                            "main.segmap_212355",
                                            global_work_sizze_237068[0],
                                            local_work_sizze_237072[0],
                                            (int) 0);
                                    time_start_237069 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_212355,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237068,
                                                                                local_work_sizze_237072,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_212355_runs,
                                                                                                                          &ctx->mainzisegmap_212355_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237070 = get_wall_time();
                                    
                                    long time_diff_237071 = time_end_237070 -
                                         time_start_237069;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_212355",
                                            time_diff_237071);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_229842,
                                                      "mem_229842") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229845,
                                                      "mem_229845") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229849,
                                                      "mem_229849") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229853,
                                                      "mem_229853") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229857,
                                                      "mem_229857") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229861,
                                                      "mem_229861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232103,
                                                      "color_232103") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232104,
                                                      "color_232104") != 0)
                                return 1;
                            
                            struct memblock_device mem_230156;
                            
                            mem_230156.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230156,
                                                      bytes_229405,
                                                      "mem_230156")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230156,
                                                                      (int64_t) 0,
                                                                      mem_229954,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203667,
                                                                      n_p_203574 *
                                                                      s_n_m_203726) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230156,
                                                          "mem_230156") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232104,
                                                          "color_232104") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232103,
                                                          "color_232103") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229958,
                                                          "mem_229958") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229954,
                                                          "mem_229954") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229861,
                                                          "mem_229861") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229857,
                                                          "mem_229857") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229853,
                                                          "mem_229853") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229849,
                                                          "mem_229849") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229845,
                                                          "mem_229845") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229842,
                                                          "mem_229842") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230164,
                                                          "ext_mem_230164") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230165,
                                                          "ext_mem_230165") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_229954,
                                                      "mem_229954") != 0)
                                return 1;
                            
                            struct memblock_device mem_230162;
                            
                            mem_230162.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230162,
                                                      bytes_229405,
                                                      "mem_230162")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230162,
                                                                      (int64_t) 0,
                                                                      mem_229958,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203667,
                                                                      n_p_203574 *
                                                                      s_n_m_203726) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230162,
                                                          "mem_230162") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230156,
                                                          "mem_230156") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232104,
                                                          "color_232104") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232103,
                                                          "color_232103") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229958,
                                                          "mem_229958") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229954,
                                                          "mem_229954") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229861,
                                                          "mem_229861") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229857,
                                                          "mem_229857") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229853,
                                                          "mem_229853") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229849,
                                                          "mem_229849") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229845,
                                                          "mem_229845") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229842,
                                                          "mem_229842") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230164,
                                                          "ext_mem_230164") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230165,
                                                          "ext_mem_230165") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_229958,
                                                      "mem_229958") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230165,
                                                    &mem_230156,
                                                    "mem_230156") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230164,
                                                    &mem_230162,
                                                    "mem_230162") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230162,
                                                      "mem_230162") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230156,
                                                      "mem_230156") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232104,
                                                      "color_232104") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232103,
                                                      "color_232103") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229958,
                                                      "mem_229958") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229954,
                                                      "mem_229954") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229861,
                                                      "mem_229861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229857,
                                                      "mem_229857") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229853,
                                                      "mem_229853") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229849,
                                                      "mem_229849") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229845,
                                                      "mem_229845") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229842,
                                                      "mem_229842") != 0)
                                return 1;
                        } else {
                            struct memblock_device ext_mem_230151;
                            
                            ext_mem_230151.references = NULL;
                            
                            struct memblock_device ext_mem_230150;
                            
                            ext_mem_230150.references = NULL;
                            
                            int32_t local_memory_capacity_233671;
                            
                            local_memory_capacity_233671 =
                                ctx->opencl.max_local_memory;
                            if (sle64((int64_t) 0,
                                      sext_i32_i64(local_memory_capacity_233671)) &&
                                suff_outer_par_213791) {
                                struct memblock_device mem_229962;
                                
                                mem_229962.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_229962,
                                                          bytes_229961,
                                                          "mem_229962")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                          mem_229962,
                                                                          (int64_t) 0,
                                                                          ext_mem_229471,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          s_n_m_203726,
                                                                          partition_sizze_203667 *
                                                                          n_p_203574) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_229962,
                                                              "mem_229962") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230150,
                                                              "ext_mem_230150") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230151,
                                                              "ext_mem_230151") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230164,
                                                              "ext_mem_230164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230165,
                                                              "ext_mem_230165") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230525,
                                                              "ext_mem_230525") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230526,
                                                              "ext_mem_230526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230527,
                                                              "ext_mem_230527") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230528,
                                                              "ext_mem_230528") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230594,
                                                              "ext_mem_230594") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230595,
                                                              "ext_mem_230595") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229623,
                                                              "mem_param_229623") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229615,
                                                              "mem_param_229615") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231625,
                                                              "ext_mem_231625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231626,
                                                              "ext_mem_231626") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229601,
                                                              "mem_param_229601") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229593,
                                                              "mem_param_229593") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229585,
                                                              "mem_param_229585") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231968,
                                                              "ext_mem_231968") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231969,
                                                              "ext_mem_231969") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231970,
                                                              "ext_mem_231970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230659,
                                                              "mem_230659") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230642,
                                                              "mem_230642") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230625,
                                                              "mem_230625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230608,
                                                              "mem_230608") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229639,
                                                              "mem_229639") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229634,
                                                              "mem_229634") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229628,
                                                              "mem_229628") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229577,
                                                              "mem_229577") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229573,
                                                              "mem_229573") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229568,
                                                              "ext_mem_229568") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229569,
                                                              "ext_mem_229569") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229519,
                                                              "ext_mem_229519") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229520,
                                                              "ext_mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229470,
                                                              "ext_mem_229470") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229471,
                                                              "ext_mem_229471") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229372,
                                                              "ext_mem_229372") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229373,
                                                              "ext_mem_229373") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229314,
                                                              "mem_229314") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229308,
                                                              "mem_229308") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229304,
                                                              "ext_mem_229304") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229305,
                                                              "ext_mem_229305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229272,
                                                              "mem_229272") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229269,
                                                              "mem_229269") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232074,
                                                              "color_232074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229265,
                                                              "mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229263,
                                                              "mem_229263") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229260,
                                                              "mem_229260") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229242,
                                                              "mem_229242") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232361,
                                                              "mem_out_232361") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232360,
                                                              "mem_out_232360") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232359,
                                                              "mem_out_232359") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_229966;
                                
                                mem_229966.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_229966,
                                                          bytes_229961,
                                                          "mem_229966")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_229966,
                                                                          (int64_t) 0,
                                                                          ext_mem_229470,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          s_n_m_203726,
                                                                          partition_sizze_203667 *
                                                                          n_p_203574) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_229966,
                                                              "mem_229966") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229962,
                                                              "mem_229962") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230150,
                                                              "ext_mem_230150") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230151,
                                                              "ext_mem_230151") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230164,
                                                              "ext_mem_230164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230165,
                                                              "ext_mem_230165") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230525,
                                                              "ext_mem_230525") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230526,
                                                              "ext_mem_230526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230527,
                                                              "ext_mem_230527") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230528,
                                                              "ext_mem_230528") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230594,
                                                              "ext_mem_230594") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230595,
                                                              "ext_mem_230595") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229623,
                                                              "mem_param_229623") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229615,
                                                              "mem_param_229615") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231625,
                                                              "ext_mem_231625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231626,
                                                              "ext_mem_231626") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229601,
                                                              "mem_param_229601") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229593,
                                                              "mem_param_229593") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229585,
                                                              "mem_param_229585") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231968,
                                                              "ext_mem_231968") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231969,
                                                              "ext_mem_231969") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231970,
                                                              "ext_mem_231970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230659,
                                                              "mem_230659") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230642,
                                                              "mem_230642") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230625,
                                                              "mem_230625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230608,
                                                              "mem_230608") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229639,
                                                              "mem_229639") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229634,
                                                              "mem_229634") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229628,
                                                              "mem_229628") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229577,
                                                              "mem_229577") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229573,
                                                              "mem_229573") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229568,
                                                              "ext_mem_229568") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229569,
                                                              "ext_mem_229569") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229519,
                                                              "ext_mem_229519") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229520,
                                                              "ext_mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229470,
                                                              "ext_mem_229470") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229471,
                                                              "ext_mem_229471") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229372,
                                                              "ext_mem_229372") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229373,
                                                              "ext_mem_229373") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229314,
                                                              "mem_229314") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229308,
                                                              "mem_229308") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229304,
                                                              "ext_mem_229304") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229305,
                                                              "ext_mem_229305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229272,
                                                              "mem_229272") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229269,
                                                              "mem_229269") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232074,
                                                              "color_232074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229265,
                                                              "mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229263,
                                                              "mem_229263") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229260,
                                                              "mem_229260") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229242,
                                                              "mem_229242") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232361,
                                                              "mem_out_232361") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232360,
                                                              "mem_out_232360") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232359,
                                                              "mem_out_232359") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_229970;
                                
                                mem_229970.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_229970,
                                                          bytes_229969,
                                                          "mem_229970")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                          mem_229970,
                                                                          (int64_t) 0,
                                                                          ext_mem_229373,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          defunc_0_f_res_203721,
                                                                          partition_sizze_203667 *
                                                                          n_p_203574) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_229970,
                                                              "mem_229970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229966,
                                                              "mem_229966") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229962,
                                                              "mem_229962") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230150,
                                                              "ext_mem_230150") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230151,
                                                              "ext_mem_230151") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230164,
                                                              "ext_mem_230164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230165,
                                                              "ext_mem_230165") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230525,
                                                              "ext_mem_230525") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230526,
                                                              "ext_mem_230526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230527,
                                                              "ext_mem_230527") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230528,
                                                              "ext_mem_230528") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230594,
                                                              "ext_mem_230594") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230595,
                                                              "ext_mem_230595") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229623,
                                                              "mem_param_229623") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229615,
                                                              "mem_param_229615") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231625,
                                                              "ext_mem_231625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231626,
                                                              "ext_mem_231626") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229601,
                                                              "mem_param_229601") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229593,
                                                              "mem_param_229593") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229585,
                                                              "mem_param_229585") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231968,
                                                              "ext_mem_231968") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231969,
                                                              "ext_mem_231969") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231970,
                                                              "ext_mem_231970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230659,
                                                              "mem_230659") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230642,
                                                              "mem_230642") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230625,
                                                              "mem_230625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230608,
                                                              "mem_230608") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229639,
                                                              "mem_229639") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229634,
                                                              "mem_229634") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229628,
                                                              "mem_229628") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229577,
                                                              "mem_229577") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229573,
                                                              "mem_229573") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229568,
                                                              "ext_mem_229568") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229569,
                                                              "ext_mem_229569") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229519,
                                                              "ext_mem_229519") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229520,
                                                              "ext_mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229470,
                                                              "ext_mem_229470") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229471,
                                                              "ext_mem_229471") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229372,
                                                              "ext_mem_229372") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229373,
                                                              "ext_mem_229373") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229314,
                                                              "mem_229314") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229308,
                                                              "mem_229308") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229304,
                                                              "ext_mem_229304") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229305,
                                                              "ext_mem_229305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229272,
                                                              "mem_229272") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229269,
                                                              "mem_229269") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232074,
                                                              "color_232074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229265,
                                                              "mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229263,
                                                              "mem_229263") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229260,
                                                              "mem_229260") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229242,
                                                              "mem_229242") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232361,
                                                              "mem_out_232361") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232360,
                                                              "mem_out_232360") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232359,
                                                              "mem_out_232359") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_229974;
                                
                                mem_229974.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_229974,
                                                          bytes_229969,
                                                          "mem_229974")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_229974,
                                                                          (int64_t) 0,
                                                                          mem_229639,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          defunc_0_f_res_203721,
                                                                          partition_sizze_203667 *
                                                                          n_p_203574) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_229974,
                                                              "mem_229974") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229970,
                                                              "mem_229970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229966,
                                                              "mem_229966") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229962,
                                                              "mem_229962") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230150,
                                                              "ext_mem_230150") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230151,
                                                              "ext_mem_230151") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230164,
                                                              "ext_mem_230164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230165,
                                                              "ext_mem_230165") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230525,
                                                              "ext_mem_230525") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230526,
                                                              "ext_mem_230526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230527,
                                                              "ext_mem_230527") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230528,
                                                              "ext_mem_230528") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230594,
                                                              "ext_mem_230594") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230595,
                                                              "ext_mem_230595") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229623,
                                                              "mem_param_229623") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229615,
                                                              "mem_param_229615") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231625,
                                                              "ext_mem_231625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231626,
                                                              "ext_mem_231626") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229601,
                                                              "mem_param_229601") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229593,
                                                              "mem_param_229593") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229585,
                                                              "mem_param_229585") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231968,
                                                              "ext_mem_231968") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231969,
                                                              "ext_mem_231969") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231970,
                                                              "ext_mem_231970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230659,
                                                              "mem_230659") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230642,
                                                              "mem_230642") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230625,
                                                              "mem_230625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230608,
                                                              "mem_230608") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229639,
                                                              "mem_229639") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229634,
                                                              "mem_229634") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229628,
                                                              "mem_229628") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229577,
                                                              "mem_229577") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229573,
                                                              "mem_229573") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229568,
                                                              "ext_mem_229568") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229569,
                                                              "ext_mem_229569") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229519,
                                                              "ext_mem_229519") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229520,
                                                              "ext_mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229470,
                                                              "ext_mem_229470") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229471,
                                                              "ext_mem_229471") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229372,
                                                              "ext_mem_229372") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229373,
                                                              "ext_mem_229373") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229314,
                                                              "mem_229314") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229308,
                                                              "mem_229308") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229304,
                                                              "ext_mem_229304") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229305,
                                                              "ext_mem_229305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229272,
                                                              "mem_229272") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229269,
                                                              "mem_229269") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232074,
                                                              "color_232074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229265,
                                                              "mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229263,
                                                              "mem_229263") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229260,
                                                              "mem_229260") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229242,
                                                              "mem_229242") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232361,
                                                              "mem_out_232361") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232360,
                                                              "mem_out_232360") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232359,
                                                              "mem_out_232359") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_229978;
                                
                                mem_229978.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_229978,
                                                          bytes_229969,
                                                          "mem_229978")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_229978,
                                                                          (int64_t) 0,
                                                                          mem_229634,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          defunc_0_f_res_203721,
                                                                          partition_sizze_203667 *
                                                                          n_p_203574) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_229978,
                                                              "mem_229978") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229974,
                                                              "mem_229974") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229970,
                                                              "mem_229970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229966,
                                                              "mem_229966") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229962,
                                                              "mem_229962") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230150,
                                                              "ext_mem_230150") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230151,
                                                              "ext_mem_230151") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230164,
                                                              "ext_mem_230164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230165,
                                                              "ext_mem_230165") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230525,
                                                              "ext_mem_230525") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230526,
                                                              "ext_mem_230526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230527,
                                                              "ext_mem_230527") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230528,
                                                              "ext_mem_230528") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230594,
                                                              "ext_mem_230594") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230595,
                                                              "ext_mem_230595") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229623,
                                                              "mem_param_229623") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229615,
                                                              "mem_param_229615") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231625,
                                                              "ext_mem_231625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231626,
                                                              "ext_mem_231626") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229601,
                                                              "mem_param_229601") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229593,
                                                              "mem_param_229593") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229585,
                                                              "mem_param_229585") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231968,
                                                              "ext_mem_231968") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231969,
                                                              "ext_mem_231969") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231970,
                                                              "ext_mem_231970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230659,
                                                              "mem_230659") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230642,
                                                              "mem_230642") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230625,
                                                              "mem_230625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230608,
                                                              "mem_230608") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229639,
                                                              "mem_229639") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229634,
                                                              "mem_229634") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229628,
                                                              "mem_229628") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229577,
                                                              "mem_229577") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229573,
                                                              "mem_229573") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229568,
                                                              "ext_mem_229568") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229569,
                                                              "ext_mem_229569") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229519,
                                                              "ext_mem_229519") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229520,
                                                              "ext_mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229470,
                                                              "ext_mem_229470") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229471,
                                                              "ext_mem_229471") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229372,
                                                              "ext_mem_229372") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229373,
                                                              "ext_mem_229373") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229314,
                                                              "mem_229314") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229308,
                                                              "mem_229308") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229304,
                                                              "ext_mem_229304") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229305,
                                                              "ext_mem_229305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229272,
                                                              "mem_229272") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229269,
                                                              "mem_229269") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232074,
                                                              "color_232074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229265,
                                                              "mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229263,
                                                              "mem_229263") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229260,
                                                              "mem_229260") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229242,
                                                              "mem_229242") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232361,
                                                              "mem_out_232361") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232360,
                                                              "mem_out_232360") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232359,
                                                              "mem_out_232359") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230013;
                                
                                mem_230013.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230013,
                                                          bytes_229961,
                                                          "mem_230013")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230017;
                                
                                mem_230017.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230017,
                                                          bytes_229961,
                                                          "mem_230017")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device color_232105;
                                
                                color_232105.references = NULL;
                                if (memblock_alloc_device(ctx, &color_232105,
                                                          total_sizze_232235,
                                                          "color_232105")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device color_232106;
                                
                                color_232106.references = NULL;
                                if (memblock_alloc_device(ctx, &color_232106,
                                                          total_sizze_232236,
                                                          "color_232106")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213809,
                                                                        1,
                                                                        sizeof(n_p_203574),
                                                                        &n_p_203574));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213809,
                                                                        2,
                                                                        sizeof(q_s_203575),
                                                                        &q_s_203575));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213809,
                                                                        3,
                                                                        sizeof(jump_s_203581),
                                                                        &jump_s_203581));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213809,
                                                                        4,
                                                                        sizeof(partition_sizze_203667),
                                                                        &partition_sizze_203667));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213809,
                                                                        5,
                                                                        sizeof(defunc_0_f_res_203721),
                                                                        &defunc_0_f_res_203721));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213809,
                                                                        6,
                                                                        sizeof(pad_css_len_203722),
                                                                        &pad_css_len_203722));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213809,
                                                                        7,
                                                                        sizeof(s_n_m_203726),
                                                                        &s_n_m_203726));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213809,
                                                                        8,
                                                                        sizeof(num_groups_213787),
                                                                        &num_groups_213787));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213809,
                                                                        9,
                                                                        sizeof(num_threads_232234),
                                                                        &num_threads_232234));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213809,
                                                                        10,
                                                                        sizeof(ext_mem_229372.mem),
                                                                        &ext_mem_229372.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213809,
                                                                        11,
                                                                        sizeof(mem_229962.mem),
                                                                        &mem_229962.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213809,
                                                                        12,
                                                                        sizeof(mem_229966.mem),
                                                                        &mem_229966.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213809,
                                                                        13,
                                                                        sizeof(mem_229970.mem),
                                                                        &mem_229970.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213809,
                                                                        14,
                                                                        sizeof(mem_229974.mem),
                                                                        &mem_229974.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213809,
                                                                        15,
                                                                        sizeof(mem_229978.mem),
                                                                        &mem_229978.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213809,
                                                                        16,
                                                                        sizeof(mem_230013.mem),
                                                                        &mem_230013.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213809,
                                                                        17,
                                                                        sizeof(mem_230017.mem),
                                                                        &mem_230017.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213809,
                                                                        18,
                                                                        sizeof(color_232105.mem),
                                                                        &color_232105.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213809,
                                                                        19,
                                                                        sizeof(color_232106.mem),
                                                                        &color_232106.mem));
                                if (1 * ((size_t) num_groups_213787 *
                                         (size_t) segmap_group_sizze_213786) !=
                                    0) {
                                    const size_t global_work_sizze_237073[1] =
                                                 {(size_t) num_groups_213787 *
                                                 (size_t) segmap_group_sizze_213786};
                                    const size_t local_work_sizze_237077[1] =
                                                 {(size_t) segmap_group_sizze_213786};
                                    int64_t time_start_237074 = 0,
                                            time_end_237075 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                "main.segmap_213809",
                                                global_work_sizze_237073[0],
                                                local_work_sizze_237077[0],
                                                (int) 0);
                                        time_start_237074 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegmap_213809,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237073,
                                                                                    local_work_sizze_237077,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegmap_213809_runs,
                                                                                                                              &ctx->mainzisegmap_213809_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237075 = get_wall_time();
                                        
                                        long time_diff_237076 =
                                             time_end_237075 -
                                             time_start_237074;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segmap_213809",
                                                time_diff_237076);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx, &mem_229962,
                                                          "mem_229962") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229966,
                                                          "mem_229966") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229970,
                                                          "mem_229970") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229974,
                                                          "mem_229974") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229978,
                                                          "mem_229978") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232105,
                                                          "color_232105") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232106,
                                                          "color_232106") != 0)
                                    return 1;
                                
                                struct memblock_device mem_230142;
                                
                                mem_230142.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230142,
                                                          bytes_229405,
                                                          "mem_230142")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_230142,
                                                                          (int64_t) 0,
                                                                          mem_230013,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          partition_sizze_203667 *
                                                                          n_p_203574,
                                                                          s_n_m_203726) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230142,
                                                              "mem_230142") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232106,
                                                              "color_232106") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232105,
                                                              "color_232105") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230017,
                                                              "mem_230017") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230013,
                                                              "mem_230013") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229978,
                                                              "mem_229978") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229974,
                                                              "mem_229974") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229970,
                                                              "mem_229970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229966,
                                                              "mem_229966") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229962,
                                                              "mem_229962") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230150,
                                                              "ext_mem_230150") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230151,
                                                              "ext_mem_230151") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230164,
                                                              "ext_mem_230164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230165,
                                                              "ext_mem_230165") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230525,
                                                              "ext_mem_230525") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230526,
                                                              "ext_mem_230526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230527,
                                                              "ext_mem_230527") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230528,
                                                              "ext_mem_230528") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230594,
                                                              "ext_mem_230594") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230595,
                                                              "ext_mem_230595") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229623,
                                                              "mem_param_229623") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229615,
                                                              "mem_param_229615") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231625,
                                                              "ext_mem_231625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231626,
                                                              "ext_mem_231626") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229601,
                                                              "mem_param_229601") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229593,
                                                              "mem_param_229593") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229585,
                                                              "mem_param_229585") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231968,
                                                              "ext_mem_231968") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231969,
                                                              "ext_mem_231969") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231970,
                                                              "ext_mem_231970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230659,
                                                              "mem_230659") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230642,
                                                              "mem_230642") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230625,
                                                              "mem_230625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230608,
                                                              "mem_230608") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229639,
                                                              "mem_229639") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229634,
                                                              "mem_229634") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229628,
                                                              "mem_229628") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229577,
                                                              "mem_229577") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229573,
                                                              "mem_229573") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229568,
                                                              "ext_mem_229568") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229569,
                                                              "ext_mem_229569") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229519,
                                                              "ext_mem_229519") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229520,
                                                              "ext_mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229470,
                                                              "ext_mem_229470") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229471,
                                                              "ext_mem_229471") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229372,
                                                              "ext_mem_229372") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229373,
                                                              "ext_mem_229373") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229314,
                                                              "mem_229314") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229308,
                                                              "mem_229308") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229304,
                                                              "ext_mem_229304") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229305,
                                                              "ext_mem_229305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229272,
                                                              "mem_229272") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229269,
                                                              "mem_229269") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232074,
                                                              "color_232074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229265,
                                                              "mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229263,
                                                              "mem_229263") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229260,
                                                              "mem_229260") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229242,
                                                              "mem_229242") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232361,
                                                              "mem_out_232361") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232360,
                                                              "mem_out_232360") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232359,
                                                              "mem_out_232359") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                if (memblock_unref_device(ctx, &mem_230013,
                                                          "mem_230013") != 0)
                                    return 1;
                                
                                struct memblock_device mem_230148;
                                
                                mem_230148.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230148,
                                                          bytes_229405,
                                                          "mem_230148")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_230148,
                                                                          (int64_t) 0,
                                                                          mem_230017,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          partition_sizze_203667 *
                                                                          n_p_203574,
                                                                          s_n_m_203726) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230148,
                                                              "mem_230148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230142,
                                                              "mem_230142") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232106,
                                                              "color_232106") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232105,
                                                              "color_232105") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230017,
                                                              "mem_230017") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230013,
                                                              "mem_230013") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229978,
                                                              "mem_229978") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229974,
                                                              "mem_229974") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229970,
                                                              "mem_229970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229966,
                                                              "mem_229966") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229962,
                                                              "mem_229962") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230150,
                                                              "ext_mem_230150") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230151,
                                                              "ext_mem_230151") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230164,
                                                              "ext_mem_230164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230165,
                                                              "ext_mem_230165") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230525,
                                                              "ext_mem_230525") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230526,
                                                              "ext_mem_230526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230527,
                                                              "ext_mem_230527") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230528,
                                                              "ext_mem_230528") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230594,
                                                              "ext_mem_230594") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230595,
                                                              "ext_mem_230595") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229623,
                                                              "mem_param_229623") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229615,
                                                              "mem_param_229615") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231625,
                                                              "ext_mem_231625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231626,
                                                              "ext_mem_231626") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229601,
                                                              "mem_param_229601") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229593,
                                                              "mem_param_229593") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229585,
                                                              "mem_param_229585") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231968,
                                                              "ext_mem_231968") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231969,
                                                              "ext_mem_231969") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231970,
                                                              "ext_mem_231970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230659,
                                                              "mem_230659") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230642,
                                                              "mem_230642") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230625,
                                                              "mem_230625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230608,
                                                              "mem_230608") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229639,
                                                              "mem_229639") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229634,
                                                              "mem_229634") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229628,
                                                              "mem_229628") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229577,
                                                              "mem_229577") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229573,
                                                              "mem_229573") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229568,
                                                              "ext_mem_229568") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229569,
                                                              "ext_mem_229569") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229519,
                                                              "ext_mem_229519") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229520,
                                                              "ext_mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229470,
                                                              "ext_mem_229470") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229471,
                                                              "ext_mem_229471") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229372,
                                                              "ext_mem_229372") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229373,
                                                              "ext_mem_229373") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229314,
                                                              "mem_229314") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229308,
                                                              "mem_229308") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229304,
                                                              "ext_mem_229304") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229305,
                                                              "ext_mem_229305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229272,
                                                              "mem_229272") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229269,
                                                              "mem_229269") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232074,
                                                              "color_232074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229265,
                                                              "mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229263,
                                                              "mem_229263") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229260,
                                                              "mem_229260") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229242,
                                                              "mem_229242") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232361,
                                                              "mem_out_232361") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232360,
                                                              "mem_out_232360") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232359,
                                                              "mem_out_232359") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                if (memblock_unref_device(ctx, &mem_230017,
                                                          "mem_230017") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230151,
                                                        &mem_230142,
                                                        "mem_230142") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230150,
                                                        &mem_230148,
                                                        "mem_230148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230148,
                                                          "mem_230148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230142,
                                                          "mem_230142") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232106,
                                                          "color_232106") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232105,
                                                          "color_232105") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230017,
                                                          "mem_230017") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230013,
                                                          "mem_230013") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229978,
                                                          "mem_229978") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229974,
                                                          "mem_229974") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229970,
                                                          "mem_229970") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229966,
                                                          "mem_229966") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229962,
                                                          "mem_229962") != 0)
                                    return 1;
                            } else {
                                struct memblock_device ext_mem_230137;
                                
                                ext_mem_230137.references = NULL;
                                
                                struct memblock_device ext_mem_230136;
                                
                                ext_mem_230136.references = NULL;
                                
                                int32_t local_memory_capacity_233670;
                                
                                local_memory_capacity_233670 =
                                    ctx->opencl.max_local_memory;
                                if (sle64(bytes_229419 + srem64((int64_t) 8 -
                                                                srem64(bytes_229419,
                                                                       (int64_t) 8),
                                                                (int64_t) 8) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_230023 + srem64((int64_t) 8 -
                                                                 srem64(bytes_230023,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          ((int64_t) 8 * (s_n_m_203726 *
                                                          q_s_203575) +
                                           srem64((int64_t) 8 -
                                                  srem64((int64_t) 8 *
                                                         (s_n_m_203726 *
                                                          q_s_203575),
                                                         (int64_t) 8),
                                                  (int64_t) 8)) + ((int64_t) 8 *
                                                                   (s_n_m_203726 *
                                                                    q_s_203575) +
                                                                   srem64((int64_t) 8 -
                                                                          srem64((int64_t) 8 *
                                                                                 (s_n_m_203726 *
                                                                                  q_s_203575),
                                                                                 (int64_t) 8),
                                                                          (int64_t) 8)) +
                                          ((int64_t) 8 * (s_n_m_203726 *
                                                          q_s_203575) +
                                           srem64((int64_t) 8 -
                                                  srem64((int64_t) 8 *
                                                         (s_n_m_203726 *
                                                          q_s_203575),
                                                         (int64_t) 8),
                                                  (int64_t) 8)) + ((int64_t) 8 *
                                                                   (s_n_m_203726 *
                                                                    q_s_203575) +
                                                                   srem64((int64_t) 8 -
                                                                          srem64((int64_t) 8 *
                                                                                 (s_n_m_203726 *
                                                                                  q_s_203575),
                                                                                 (int64_t) 8),
                                                                          (int64_t) 8)) +
                                          ((int64_t) 8 * (s_n_m_203726 *
                                                          q_s_203575) +
                                           srem64((int64_t) 8 -
                                                  srem64((int64_t) 8 *
                                                         (s_n_m_203726 *
                                                          q_s_203575),
                                                         (int64_t) 8),
                                                  (int64_t) 8)),
                                          sext_i32_i64(local_memory_capacity_233670)) &&
                                    intra_suff_and_fits_213802) {
                                    struct memblock_device mem_230059;
                                    
                                    mem_230059.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_230059,
                                                              bytes_229405,
                                                              "mem_230059")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device mem_230064;
                                    
                                    mem_230064.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_230064,
                                                              bytes_229405,
                                                              "mem_230064")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                                                            1,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      (s_n_m_203726 *
                                                                                       q_s_203575)),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      (s_n_m_203726 *
                                                                                       q_s_203575)),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                                                            3,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      (s_n_m_203726 *
                                                                                       q_s_203575)),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                                                            4,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      (s_n_m_203726 *
                                                                                       q_s_203575)),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                                                            5,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      (s_n_m_203726 *
                                                                                       q_s_203575)),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                                                            6,
                                                                            (size_t) bytes_230023,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                                                            7,
                                                                            (size_t) bytes_229419,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                                                            8,
                                                                            (size_t) bytes_229419,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                                                            9,
                                                                            (size_t) bytes_229419,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                                                            10,
                                                                            (size_t) bytes_229419,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                                                            11,
                                                                            (size_t) bytes_229419,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                                                            12,
                                                                            (size_t) bytes_229419,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                                                            13,
                                                                            (size_t) bytes_229419,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                                                            14,
                                                                            sizeof(n_p_203574),
                                                                            &n_p_203574));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                                                            15,
                                                                            sizeof(q_s_203575),
                                                                            &q_s_203575));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                                                            16,
                                                                            sizeof(jump_s_203581),
                                                                            &jump_s_203581));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                                                            17,
                                                                            sizeof(partition_sizze_203667),
                                                                            &partition_sizze_203667));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                                                            18,
                                                                            sizeof(defunc_0_f_res_203721),
                                                                            &defunc_0_f_res_203721));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                                                            19,
                                                                            sizeof(pad_css_len_203722),
                                                                            &pad_css_len_203722));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                                                            20,
                                                                            sizeof(s_n_m_203726),
                                                                            &s_n_m_203726));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                                                            21,
                                                                            sizeof(computed_group_sizze_213795),
                                                                            &computed_group_sizze_213795));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                                                            22,
                                                                            sizeof(ext_mem_229372.mem),
                                                                            &ext_mem_229372.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                                                            23,
                                                                            sizeof(ext_mem_229373.mem),
                                                                            &ext_mem_229373.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                                                            24,
                                                                            sizeof(ext_mem_229470.mem),
                                                                            &ext_mem_229470.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                                                            25,
                                                                            sizeof(ext_mem_229471.mem),
                                                                            &ext_mem_229471.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                                                            26,
                                                                            sizeof(mem_229634.mem),
                                                                            &mem_229634.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                                                            27,
                                                                            sizeof(mem_229639.mem),
                                                                            &mem_229639.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                                                            28,
                                                                            sizeof(mem_230059.mem),
                                                                            &mem_230059.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213926,
                                                                            29,
                                                                            sizeof(mem_230064.mem),
                                                                            &mem_230064.mem));
                                    if (1 * ((size_t) binop_x_229310 *
                                             (size_t) computed_group_sizze_213795) !=
                                        0) {
                                        const size_t global_work_sizze_237078[1]
                                                     =
                                                     {(size_t) binop_x_229310 *
                                                     (size_t) computed_group_sizze_213795};
                                        const size_t local_work_sizze_237082[1]
                                                     =
                                                     {(size_t) computed_group_sizze_213795};
                                        int64_t time_start_237079 = 0,
                                                time_end_237080 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                    "main.segmap_intragroup_213926",
                                                    global_work_sizze_237078[0],
                                                    local_work_sizze_237082[0],
                                                    (int) (0 + (int64_t) 8 *
                                                           (s_n_m_203726 *
                                                            q_s_203575) +
                                                           (int64_t) 8 *
                                                           (s_n_m_203726 *
                                                            q_s_203575) +
                                                           (int64_t) 8 *
                                                           (s_n_m_203726 *
                                                            q_s_203575) +
                                                           (int64_t) 8 *
                                                           (s_n_m_203726 *
                                                            q_s_203575) +
                                                           (int64_t) 8 *
                                                           (s_n_m_203726 *
                                                            q_s_203575) +
                                                           bytes_230023 +
                                                           bytes_229419 +
                                                           bytes_229419 +
                                                           bytes_229419 +
                                                           bytes_229419 +
                                                           bytes_229419 +
                                                           bytes_229419 +
                                                           bytes_229419));
                                            time_start_237079 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegmap_intragroup_213926,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237078,
                                                                                        local_work_sizze_237082,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegmap_intragroup_213926_runs,
                                                                                                                                  &ctx->mainzisegmap_intragroup_213926_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237080 = get_wall_time();
                                            
                                            long time_diff_237081 =
                                                 time_end_237080 -
                                                 time_start_237079;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segmap_intragroup_213926",
                                                    time_diff_237081);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230137,
                                                            &mem_230059,
                                                            "mem_230059") != 0)
                                        return 1;
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230136,
                                                            &mem_230064,
                                                            "mem_230064") != 0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230064,
                                                              "mem_230064") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230059,
                                                              "mem_230059") !=
                                        0)
                                        return 1;
                                } else {
                                    int64_t segmap_usable_groups_214072 =
                                            sdiv_up64(nest_sizze_208938,
                                                      segmap_group_sizze_214071);
                                    struct memblock_device ext_mem_230135;
                                    
                                    ext_mem_230135.references = NULL;
                                    
                                    struct memblock_device ext_mem_230134;
                                    
                                    ext_mem_230134.references = NULL;
                                    
                                    int32_t local_memory_capacity_233669;
                                    
                                    local_memory_capacity_233669 =
                                        ctx->opencl.max_local_memory;
                                    if (sle64((int64_t) 0,
                                              sext_i32_i64(local_memory_capacity_233669)) &&
                                        suff_outer_par_214076) {
                                        struct memblock_device mem_230070;
                                        
                                        mem_230070.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230070,
                                                                  bytes_229405,
                                                                  "mem_230070")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230075;
                                        
                                        mem_230075.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230075,
                                                                  bytes_229405,
                                                                  "mem_230075")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegMap");
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214084,
                                                                                1,
                                                                                sizeof(n_p_203574),
                                                                                &n_p_203574));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214084,
                                                                                2,
                                                                                sizeof(q_s_203575),
                                                                                &q_s_203575));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214084,
                                                                                3,
                                                                                sizeof(jump_s_203581),
                                                                                &jump_s_203581));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214084,
                                                                                4,
                                                                                sizeof(partition_sizze_203667),
                                                                                &partition_sizze_203667));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214084,
                                                                                5,
                                                                                sizeof(defunc_0_f_res_203721),
                                                                                &defunc_0_f_res_203721));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214084,
                                                                                6,
                                                                                sizeof(pad_css_len_203722),
                                                                                &pad_css_len_203722));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214084,
                                                                                7,
                                                                                sizeof(s_n_m_203726),
                                                                                &s_n_m_203726));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214084,
                                                                                8,
                                                                                sizeof(ext_mem_229372.mem),
                                                                                &ext_mem_229372.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214084,
                                                                                9,
                                                                                sizeof(ext_mem_229373.mem),
                                                                                &ext_mem_229373.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214084,
                                                                                10,
                                                                                sizeof(ext_mem_229470.mem),
                                                                                &ext_mem_229470.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214084,
                                                                                11,
                                                                                sizeof(ext_mem_229471.mem),
                                                                                &ext_mem_229471.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214084,
                                                                                12,
                                                                                sizeof(mem_229634.mem),
                                                                                &mem_229634.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214084,
                                                                                13,
                                                                                sizeof(mem_229639.mem),
                                                                                &mem_229639.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214084,
                                                                                14,
                                                                                sizeof(mem_230070.mem),
                                                                                &mem_230070.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214084,
                                                                                15,
                                                                                sizeof(mem_230075.mem),
                                                                                &mem_230075.mem));
                                        if (1 *
                                            ((size_t) segmap_usable_groups_214072 *
                                             (size_t) segmap_group_sizze_214071) !=
                                            0) {
                                            const size_t
                                            global_work_sizze_237083[1] =
                                            {(size_t) segmap_usable_groups_214072 *
                                            (size_t) segmap_group_sizze_214071};
                                            const size_t
                                            local_work_sizze_237087[1] =
                                            {(size_t) segmap_group_sizze_214071};
                                            int64_t time_start_237084 = 0,
                                                    time_end_237085 = 0;
                                            
                                            if (ctx->debugging) {
                                                fprintf(ctx->log,
                                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                        "main.segmap_214084",
                                                        global_work_sizze_237083[0],
                                                        local_work_sizze_237087[0],
                                                        (int) 0);
                                                time_start_237084 =
                                                    get_wall_time();
                                            }
                                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                            ctx->mainzisegmap_214084,
                                                                                            1,
                                                                                            NULL,
                                                                                            global_work_sizze_237083,
                                                                                            local_work_sizze_237087,
                                                                                            0,
                                                                                            NULL,
                                                                                            ctx->profiling_paused ||
                                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                      &ctx->mainzisegmap_214084_runs,
                                                                                                                                      &ctx->mainzisegmap_214084_total_runtime)));
                                            if (ctx->debugging) {
                                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                time_end_237085 =
                                                    get_wall_time();
                                                
                                                long time_diff_237086 =
                                                     time_end_237085 -
                                                     time_start_237084;
                                                
                                                fprintf(ctx->log,
                                                        "kernel %s runtime: %ldus\n",
                                                        "main.segmap_214084",
                                                        time_diff_237086);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230135,
                                                                &mem_230070,
                                                                "mem_230070") !=
                                            0)
                                            return 1;
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230134,
                                                                &mem_230075,
                                                                "mem_230075") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230075,
                                                                  "mem_230075") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230070,
                                                                  "mem_230070") !=
                                            0)
                                            return 1;
                                    } else {
                                        int64_t segmap_usable_groups_214195 =
                                                sdiv_up64(nest_sizze_208938,
                                                          segmap_group_sizze_214194);
                                        struct memblock_device mem_230081;
                                        
                                        mem_230081.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230081,
                                                                  bytes_229405,
                                                                  "mem_230081")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230085;
                                        
                                        mem_230085.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230085,
                                                                  bytes_230084,
                                                                  "mem_230085")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegMap");
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214201,
                                                                                1,
                                                                                sizeof(n_p_203574),
                                                                                &n_p_203574));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214201,
                                                                                2,
                                                                                sizeof(jump_s_203581),
                                                                                &jump_s_203581));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214201,
                                                                                3,
                                                                                sizeof(partition_sizze_203667),
                                                                                &partition_sizze_203667));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214201,
                                                                                4,
                                                                                sizeof(defunc_0_f_res_203721),
                                                                                &defunc_0_f_res_203721));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214201,
                                                                                5,
                                                                                sizeof(pad_css_len_203722),
                                                                                &pad_css_len_203722));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214201,
                                                                                6,
                                                                                sizeof(s_n_m_203726),
                                                                                &s_n_m_203726));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214201,
                                                                                7,
                                                                                sizeof(mem_230081.mem),
                                                                                &mem_230081.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214201,
                                                                                8,
                                                                                sizeof(mem_230085.mem),
                                                                                &mem_230085.mem));
                                        if (1 *
                                            ((size_t) segmap_usable_groups_214195 *
                                             (size_t) segmap_group_sizze_214194) !=
                                            0) {
                                            const size_t
                                            global_work_sizze_237088[1] =
                                            {(size_t) segmap_usable_groups_214195 *
                                            (size_t) segmap_group_sizze_214194};
                                            const size_t
                                            local_work_sizze_237092[1] =
                                            {(size_t) segmap_group_sizze_214194};
                                            int64_t time_start_237089 = 0,
                                                    time_end_237090 = 0;
                                            
                                            if (ctx->debugging) {
                                                fprintf(ctx->log,
                                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                        "main.segmap_214201",
                                                        global_work_sizze_237088[0],
                                                        local_work_sizze_237092[0],
                                                        (int) 0);
                                                time_start_237089 =
                                                    get_wall_time();
                                            }
                                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                            ctx->mainzisegmap_214201,
                                                                                            1,
                                                                                            NULL,
                                                                                            global_work_sizze_237088,
                                                                                            local_work_sizze_237092,
                                                                                            0,
                                                                                            NULL,
                                                                                            ctx->profiling_paused ||
                                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                      &ctx->mainzisegmap_214201_runs,
                                                                                                                                      &ctx->mainzisegmap_214201_total_runtime)));
                                            if (ctx->debugging) {
                                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                time_end_237090 =
                                                    get_wall_time();
                                                
                                                long time_diff_237091 =
                                                     time_end_237090 -
                                                     time_start_237089;
                                                
                                                fprintf(ctx->log,
                                                        "kernel %s runtime: %ldus\n",
                                                        "main.segmap_214201",
                                                        time_diff_237091);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230085,
                                                                  "mem_230085") !=
                                            0)
                                            return 1;
                                        
                                        struct memblock_device mem_230091;
                                        
                                        mem_230091.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230091,
                                                                  bytes_229405,
                                                                  "mem_230091")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230096;
                                        
                                        mem_230096.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230096,
                                                                  bytes_229405,
                                                                  "mem_230096")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230101;
                                        
                                        mem_230101.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230101,
                                                                  bytes_229405,
                                                                  "mem_230101")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (slt64(q_s_203575 * (int64_t) 2,
                                                  segred_group_sizze_214217)) {
                                            int64_t
                                            segment_sizze_nonzzero_233463 =
                                            smax64((int64_t) 1, q_s_203575);
                                            int64_t num_threads_233464 =
                                                    num_groups_214218 *
                                                    segred_group_sizze_214217;
                                            
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n",
                                                        "\n# SegRed-small");
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_segments",
                                                        (long long) (partition_sizze_203667 *
                                                                     n_p_203574 *
                                                                     s_n_m_203726),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203575,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segments_per_group",
                                                        (long long) squot64(segred_group_sizze_214217,
                                                                            segment_sizze_nonzzero_233463),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "required_groups",
                                                        (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                                           n_p_203574 *
                                                                                           s_n_m_203726,
                                                                                           squot64(segred_group_sizze_214217,
                                                                                                   segment_sizze_nonzzero_233463))),
                                                        '\n');
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214227,
                                                                                    1,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_214217),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214227,
                                                                                    2,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_214217),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214227,
                                                                                    3,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_214217),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214227,
                                                                                    4,
                                                                                    sizeof(n_p_203574),
                                                                                    &n_p_203574));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214227,
                                                                                    5,
                                                                                    sizeof(q_s_203575),
                                                                                    &q_s_203575));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214227,
                                                                                    6,
                                                                                    sizeof(partition_sizze_203667),
                                                                                    &partition_sizze_203667));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214227,
                                                                                    7,
                                                                                    sizeof(defunc_0_f_res_203721),
                                                                                    &defunc_0_f_res_203721));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214227,
                                                                                    8,
                                                                                    sizeof(s_n_m_203726),
                                                                                    &s_n_m_203726));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214227,
                                                                                    9,
                                                                                    sizeof(num_groups_214218),
                                                                                    &num_groups_214218));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214227,
                                                                                    10,
                                                                                    sizeof(segment_sizze_nonzzero_233463),
                                                                                    &segment_sizze_nonzzero_233463));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214227,
                                                                                    11,
                                                                                    sizeof(ext_mem_229372.mem),
                                                                                    &ext_mem_229372.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214227,
                                                                                    12,
                                                                                    sizeof(ext_mem_229373.mem),
                                                                                    &ext_mem_229373.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214227,
                                                                                    13,
                                                                                    sizeof(ext_mem_229470.mem),
                                                                                    &ext_mem_229470.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214227,
                                                                                    14,
                                                                                    sizeof(ext_mem_229471.mem),
                                                                                    &ext_mem_229471.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214227,
                                                                                    15,
                                                                                    sizeof(mem_229639.mem),
                                                                                    &mem_229639.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214227,
                                                                                    16,
                                                                                    sizeof(mem_230081.mem),
                                                                                    &mem_230081.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214227,
                                                                                    17,
                                                                                    sizeof(mem_230091.mem),
                                                                                    &mem_230091.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214227,
                                                                                    18,
                                                                                    sizeof(mem_230096.mem),
                                                                                    &mem_230096.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214227,
                                                                                    19,
                                                                                    sizeof(mem_230101.mem),
                                                                                    &mem_230101.mem));
                                            if (1 *
                                                ((size_t) num_groups_214218 *
                                                 (size_t) segred_group_sizze_214217) !=
                                                0) {
                                                const size_t
                                                global_work_sizze_237093[1] =
                                                {(size_t) num_groups_214218 *
                                                (size_t) segred_group_sizze_214217};
                                                const size_t
                                                local_work_sizze_237097[1] =
                                                {(size_t) segred_group_sizze_214217};
                                                int64_t time_start_237094 = 0,
                                                        time_end_237095 = 0;
                                                
                                                if (ctx->debugging) {
                                                    fprintf(ctx->log,
                                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                            "main.segred_small_214227",
                                                            global_work_sizze_237093[0],
                                                            local_work_sizze_237097[0],
                                                            (int) (0 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_214217 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_214217 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_214217));
                                                    time_start_237094 =
                                                        get_wall_time();
                                                }
                                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                                ctx->mainzisegred_small_214227,
                                                                                                1,
                                                                                                NULL,
                                                                                                global_work_sizze_237093,
                                                                                                local_work_sizze_237097,
                                                                                                0,
                                                                                                NULL,
                                                                                                ctx->profiling_paused ||
                                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                          &ctx->mainzisegred_small_214227_runs,
                                                                                                                                          &ctx->mainzisegred_small_214227_total_runtime)));
                                                if (ctx->debugging) {
                                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                    time_end_237095 =
                                                        get_wall_time();
                                                    
                                                    long time_diff_237096 =
                                                         time_end_237095 -
                                                         time_start_237094;
                                                    
                                                    fprintf(ctx->log,
                                                            "kernel %s runtime: %ldus\n",
                                                            "main.segred_small_214227",
                                                            time_diff_237096);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                        } else {
                                            int64_t groups_per_segment_233506 =
                                                    sdiv_up64(num_groups_214218,
                                                              smax64((int64_t) 1,
                                                                     partition_sizze_203667 *
                                                                     n_p_203574 *
                                                                     s_n_m_203726));
                                            int64_t elements_per_thread_233507 =
                                                    sdiv_up64(q_s_203575,
                                                              segred_group_sizze_214217 *
                                                              groups_per_segment_233506);
                                            int64_t virt_num_groups_233508 =
                                                    groups_per_segment_233506 *
                                                    (partition_sizze_203667 *
                                                     n_p_203574 * s_n_m_203726);
                                            int64_t num_threads_233509 =
                                                    num_groups_214218 *
                                                    segred_group_sizze_214217;
                                            int64_t threads_per_segment_233510 =
                                                    groups_per_segment_233506 *
                                                    segred_group_sizze_214217;
                                            
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n",
                                                        "\n# SegRed-large");
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_segments",
                                                        (long long) (partition_sizze_203667 *
                                                                     n_p_203574 *
                                                                     s_n_m_203726),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203575,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "virt_num_groups",
                                                        (long long) virt_num_groups_233508,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_groups",
                                                        (long long) num_groups_214218,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "group_size",
                                                        (long long) segred_group_sizze_214217,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "elems_per_thread",
                                                        (long long) elements_per_thread_233507,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "groups_per_segment",
                                                        (long long) groups_per_segment_233506,
                                                        '\n');
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233511;
                                            
                                            segred_tmp_mem_233511.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233511,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233508,
                                                                      "segred_tmp_mem_233511")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233513;
                                            
                                            segred_tmp_mem_233513.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233513,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233508,
                                                                      "segred_tmp_mem_233513")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233515;
                                            
                                            segred_tmp_mem_233515.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233515,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233508,
                                                                      "segred_tmp_mem_233515")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            mainzicounter_mem_233517 =
                                            ctx->mainzicounter_mem_233517;
                                            
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214227,
                                                                                    1,
                                                                                    (size_t) 1,
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214227,
                                                                                    2,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_214217),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214227,
                                                                                    3,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_214217),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214227,
                                                                                    4,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_214217),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214227,
                                                                                    5,
                                                                                    sizeof(n_p_203574),
                                                                                    &n_p_203574));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214227,
                                                                                    6,
                                                                                    sizeof(q_s_203575),
                                                                                    &q_s_203575));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214227,
                                                                                    7,
                                                                                    sizeof(partition_sizze_203667),
                                                                                    &partition_sizze_203667));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214227,
                                                                                    8,
                                                                                    sizeof(defunc_0_f_res_203721),
                                                                                    &defunc_0_f_res_203721));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214227,
                                                                                    9,
                                                                                    sizeof(s_n_m_203726),
                                                                                    &s_n_m_203726));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214227,
                                                                                    10,
                                                                                    sizeof(num_groups_214218),
                                                                                    &num_groups_214218));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214227,
                                                                                    11,
                                                                                    sizeof(groups_per_segment_233506),
                                                                                    &groups_per_segment_233506));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214227,
                                                                                    12,
                                                                                    sizeof(elements_per_thread_233507),
                                                                                    &elements_per_thread_233507));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214227,
                                                                                    13,
                                                                                    sizeof(virt_num_groups_233508),
                                                                                    &virt_num_groups_233508));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214227,
                                                                                    14,
                                                                                    sizeof(threads_per_segment_233510),
                                                                                    &threads_per_segment_233510));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214227,
                                                                                    15,
                                                                                    sizeof(ext_mem_229372.mem),
                                                                                    &ext_mem_229372.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214227,
                                                                                    16,
                                                                                    sizeof(ext_mem_229373.mem),
                                                                                    &ext_mem_229373.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214227,
                                                                                    17,
                                                                                    sizeof(ext_mem_229470.mem),
                                                                                    &ext_mem_229470.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214227,
                                                                                    18,
                                                                                    sizeof(ext_mem_229471.mem),
                                                                                    &ext_mem_229471.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214227,
                                                                                    19,
                                                                                    sizeof(mem_229639.mem),
                                                                                    &mem_229639.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214227,
                                                                                    20,
                                                                                    sizeof(mem_230081.mem),
                                                                                    &mem_230081.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214227,
                                                                                    21,
                                                                                    sizeof(mem_230091.mem),
                                                                                    &mem_230091.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214227,
                                                                                    22,
                                                                                    sizeof(mem_230096.mem),
                                                                                    &mem_230096.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214227,
                                                                                    23,
                                                                                    sizeof(mem_230101.mem),
                                                                                    &mem_230101.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214227,
                                                                                    24,
                                                                                    sizeof(segred_tmp_mem_233511.mem),
                                                                                    &segred_tmp_mem_233511.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214227,
                                                                                    25,
                                                                                    sizeof(segred_tmp_mem_233513.mem),
                                                                                    &segred_tmp_mem_233513.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214227,
                                                                                    26,
                                                                                    sizeof(segred_tmp_mem_233515.mem),
                                                                                    &segred_tmp_mem_233515.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214227,
                                                                                    27,
                                                                                    sizeof(mainzicounter_mem_233517.mem),
                                                                                    &mainzicounter_mem_233517.mem));
                                            if (1 *
                                                ((size_t) num_groups_214218 *
                                                 (size_t) segred_group_sizze_214217) !=
                                                0) {
                                                const size_t
                                                global_work_sizze_237099[1] =
                                                {(size_t) num_groups_214218 *
                                                (size_t) segred_group_sizze_214217};
                                                const size_t
                                                local_work_sizze_237103[1] =
                                                {(size_t) segred_group_sizze_214217};
                                                int64_t time_start_237100 = 0,
                                                        time_end_237101 = 0;
                                                
                                                if (ctx->debugging) {
                                                    fprintf(ctx->log,
                                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                            "main.segred_large_214227",
                                                            global_work_sizze_237099[0],
                                                            local_work_sizze_237103[0],
                                                            (int) (0 + 1 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_214217 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_214217 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_214217));
                                                    time_start_237100 =
                                                        get_wall_time();
                                                }
                                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                                ctx->mainzisegred_large_214227,
                                                                                                1,
                                                                                                NULL,
                                                                                                global_work_sizze_237099,
                                                                                                local_work_sizze_237103,
                                                                                                0,
                                                                                                NULL,
                                                                                                ctx->profiling_paused ||
                                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                          &ctx->mainzisegred_large_214227_runs,
                                                                                                                                          &ctx->mainzisegred_large_214227_total_runtime)));
                                                if (ctx->debugging) {
                                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                    time_end_237101 =
                                                        get_wall_time();
                                                    
                                                    long time_diff_237102 =
                                                         time_end_237101 -
                                                         time_start_237100;
                                                    
                                                    fprintf(ctx->log,
                                                            "kernel %s runtime: %ldus\n",
                                                            "main.segred_large_214227",
                                                            time_diff_237102);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233515,
                                                                      "segred_tmp_mem_233515") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233513,
                                                                      "segred_tmp_mem_233513") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233511,
                                                                      "segred_tmp_mem_233511") !=
                                                0)
                                                return 1;
                                        }
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230081,
                                                                  "mem_230081") !=
                                            0)
                                            return 1;
                                        
                                        int64_t segmap_usable_groups_214277 =
                                                sdiv_up64(nest_sizze_208938,
                                                          segmap_group_sizze_214276);
                                        struct memblock_device mem_230107;
                                        
                                        mem_230107.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230107,
                                                                  bytes_229405,
                                                                  "mem_230107")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230112;
                                        
                                        mem_230112.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230112,
                                                                  bytes_229405,
                                                                  "mem_230112")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230117;
                                        
                                        mem_230117.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230117,
                                                                  bytes_229405,
                                                                  "mem_230117")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230122;
                                        
                                        mem_230122.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230122,
                                                                  bytes_229405,
                                                                  "mem_230122")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegMap");
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214285,
                                                                                1,
                                                                                sizeof(n_p_203574),
                                                                                &n_p_203574));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214285,
                                                                                2,
                                                                                sizeof(jump_s_203581),
                                                                                &jump_s_203581));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214285,
                                                                                3,
                                                                                sizeof(partition_sizze_203667),
                                                                                &partition_sizze_203667));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214285,
                                                                                4,
                                                                                sizeof(defunc_0_f_res_203721),
                                                                                &defunc_0_f_res_203721));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214285,
                                                                                5,
                                                                                sizeof(pad_css_len_203722),
                                                                                &pad_css_len_203722));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214285,
                                                                                6,
                                                                                sizeof(s_n_m_203726),
                                                                                &s_n_m_203726));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214285,
                                                                                7,
                                                                                sizeof(mem_230091.mem),
                                                                                &mem_230091.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214285,
                                                                                8,
                                                                                sizeof(mem_230096.mem),
                                                                                &mem_230096.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214285,
                                                                                9,
                                                                                sizeof(mem_230101.mem),
                                                                                &mem_230101.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214285,
                                                                                10,
                                                                                sizeof(mem_230107.mem),
                                                                                &mem_230107.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214285,
                                                                                11,
                                                                                sizeof(mem_230112.mem),
                                                                                &mem_230112.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214285,
                                                                                12,
                                                                                sizeof(mem_230117.mem),
                                                                                &mem_230117.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214285,
                                                                                13,
                                                                                sizeof(mem_230122.mem),
                                                                                &mem_230122.mem));
                                        if (1 *
                                            ((size_t) segmap_usable_groups_214277 *
                                             (size_t) segmap_group_sizze_214276) !=
                                            0) {
                                            const size_t
                                            global_work_sizze_237104[1] =
                                            {(size_t) segmap_usable_groups_214277 *
                                            (size_t) segmap_group_sizze_214276};
                                            const size_t
                                            local_work_sizze_237108[1] =
                                            {(size_t) segmap_group_sizze_214276};
                                            int64_t time_start_237105 = 0,
                                                    time_end_237106 = 0;
                                            
                                            if (ctx->debugging) {
                                                fprintf(ctx->log,
                                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                        "main.segmap_214285",
                                                        global_work_sizze_237104[0],
                                                        local_work_sizze_237108[0],
                                                        (int) 0);
                                                time_start_237105 =
                                                    get_wall_time();
                                            }
                                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                            ctx->mainzisegmap_214285,
                                                                                            1,
                                                                                            NULL,
                                                                                            global_work_sizze_237104,
                                                                                            local_work_sizze_237108,
                                                                                            0,
                                                                                            NULL,
                                                                                            ctx->profiling_paused ||
                                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                      &ctx->mainzisegmap_214285_runs,
                                                                                                                                      &ctx->mainzisegmap_214285_total_runtime)));
                                            if (ctx->debugging) {
                                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                time_end_237106 =
                                                    get_wall_time();
                                                
                                                long time_diff_237107 =
                                                     time_end_237106 -
                                                     time_start_237105;
                                                
                                                fprintf(ctx->log,
                                                        "kernel %s runtime: %ldus\n",
                                                        "main.segmap_214285",
                                                        time_diff_237107);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230091,
                                                                  "mem_230091") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230096,
                                                                  "mem_230096") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230101,
                                                                  "mem_230101") !=
                                            0)
                                            return 1;
                                        
                                        struct memblock_device mem_230128;
                                        
                                        mem_230128.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230128,
                                                                  bytes_229405,
                                                                  "mem_230128")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230133;
                                        
                                        mem_230133.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230133,
                                                                  bytes_229405,
                                                                  "mem_230133")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (slt64(q_s_203575 * (int64_t) 2,
                                                  segred_group_sizze_214312)) {
                                            int64_t
                                            segment_sizze_nonzzero_233579 =
                                            smax64((int64_t) 1, q_s_203575);
                                            int64_t num_threads_233580 =
                                                    num_groups_214313 *
                                                    segred_group_sizze_214312;
                                            
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n",
                                                        "\n# SegRed-small");
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_segments",
                                                        (long long) (partition_sizze_203667 *
                                                                     n_p_203574 *
                                                                     s_n_m_203726),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203575,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segments_per_group",
                                                        (long long) squot64(segred_group_sizze_214312,
                                                                            segment_sizze_nonzzero_233579),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "required_groups",
                                                        (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                                           n_p_203574 *
                                                                                           s_n_m_203726,
                                                                                           squot64(segred_group_sizze_214312,
                                                                                                   segment_sizze_nonzzero_233579))),
                                                        '\n');
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214321,
                                                                                    1,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_214312),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214321,
                                                                                    2,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_214312),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214321,
                                                                                    3,
                                                                                    sizeof(n_p_203574),
                                                                                    &n_p_203574));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214321,
                                                                                    4,
                                                                                    sizeof(q_s_203575),
                                                                                    &q_s_203575));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214321,
                                                                                    5,
                                                                                    sizeof(partition_sizze_203667),
                                                                                    &partition_sizze_203667));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214321,
                                                                                    6,
                                                                                    sizeof(defunc_0_f_res_203721),
                                                                                    &defunc_0_f_res_203721));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214321,
                                                                                    7,
                                                                                    sizeof(s_n_m_203726),
                                                                                    &s_n_m_203726));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214321,
                                                                                    8,
                                                                                    sizeof(num_groups_214313),
                                                                                    &num_groups_214313));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214321,
                                                                                    9,
                                                                                    sizeof(segment_sizze_nonzzero_233579),
                                                                                    &segment_sizze_nonzzero_233579));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214321,
                                                                                    10,
                                                                                    sizeof(ext_mem_229372.mem),
                                                                                    &ext_mem_229372.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214321,
                                                                                    11,
                                                                                    sizeof(ext_mem_229373.mem),
                                                                                    &ext_mem_229373.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214321,
                                                                                    12,
                                                                                    sizeof(ext_mem_229470.mem),
                                                                                    &ext_mem_229470.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214321,
                                                                                    13,
                                                                                    sizeof(ext_mem_229471.mem),
                                                                                    &ext_mem_229471.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214321,
                                                                                    14,
                                                                                    sizeof(mem_229634.mem),
                                                                                    &mem_229634.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214321,
                                                                                    15,
                                                                                    sizeof(mem_229639.mem),
                                                                                    &mem_229639.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214321,
                                                                                    16,
                                                                                    sizeof(mem_230107.mem),
                                                                                    &mem_230107.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214321,
                                                                                    17,
                                                                                    sizeof(mem_230112.mem),
                                                                                    &mem_230112.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214321,
                                                                                    18,
                                                                                    sizeof(mem_230117.mem),
                                                                                    &mem_230117.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214321,
                                                                                    19,
                                                                                    sizeof(mem_230122.mem),
                                                                                    &mem_230122.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214321,
                                                                                    20,
                                                                                    sizeof(mem_230128.mem),
                                                                                    &mem_230128.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214321,
                                                                                    21,
                                                                                    sizeof(mem_230133.mem),
                                                                                    &mem_230133.mem));
                                            if (1 *
                                                ((size_t) num_groups_214313 *
                                                 (size_t) segred_group_sizze_214312) !=
                                                0) {
                                                const size_t
                                                global_work_sizze_237109[1] =
                                                {(size_t) num_groups_214313 *
                                                (size_t) segred_group_sizze_214312};
                                                const size_t
                                                local_work_sizze_237113[1] =
                                                {(size_t) segred_group_sizze_214312};
                                                int64_t time_start_237110 = 0,
                                                        time_end_237111 = 0;
                                                
                                                if (ctx->debugging) {
                                                    fprintf(ctx->log,
                                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                            "main.segred_small_214321",
                                                            global_work_sizze_237109[0],
                                                            local_work_sizze_237113[0],
                                                            (int) (0 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_214312 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_214312));
                                                    time_start_237110 =
                                                        get_wall_time();
                                                }
                                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                                ctx->mainzisegred_small_214321,
                                                                                                1,
                                                                                                NULL,
                                                                                                global_work_sizze_237109,
                                                                                                local_work_sizze_237113,
                                                                                                0,
                                                                                                NULL,
                                                                                                ctx->profiling_paused ||
                                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                          &ctx->mainzisegred_small_214321_runs,
                                                                                                                                          &ctx->mainzisegred_small_214321_total_runtime)));
                                                if (ctx->debugging) {
                                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                    time_end_237111 =
                                                        get_wall_time();
                                                    
                                                    long time_diff_237112 =
                                                         time_end_237111 -
                                                         time_start_237110;
                                                    
                                                    fprintf(ctx->log,
                                                            "kernel %s runtime: %ldus\n",
                                                            "main.segred_small_214321",
                                                            time_diff_237112);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                        } else {
                                            int64_t groups_per_segment_233616 =
                                                    sdiv_up64(num_groups_214313,
                                                              smax64((int64_t) 1,
                                                                     partition_sizze_203667 *
                                                                     n_p_203574 *
                                                                     s_n_m_203726));
                                            int64_t elements_per_thread_233617 =
                                                    sdiv_up64(q_s_203575,
                                                              segred_group_sizze_214312 *
                                                              groups_per_segment_233616);
                                            int64_t virt_num_groups_233618 =
                                                    groups_per_segment_233616 *
                                                    (partition_sizze_203667 *
                                                     n_p_203574 * s_n_m_203726);
                                            int64_t num_threads_233619 =
                                                    num_groups_214313 *
                                                    segred_group_sizze_214312;
                                            int64_t threads_per_segment_233620 =
                                                    groups_per_segment_233616 *
                                                    segred_group_sizze_214312;
                                            
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n",
                                                        "\n# SegRed-large");
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_segments",
                                                        (long long) (partition_sizze_203667 *
                                                                     n_p_203574 *
                                                                     s_n_m_203726),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203575,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "virt_num_groups",
                                                        (long long) virt_num_groups_233618,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_groups",
                                                        (long long) num_groups_214313,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "group_size",
                                                        (long long) segred_group_sizze_214312,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "elems_per_thread",
                                                        (long long) elements_per_thread_233617,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "groups_per_segment",
                                                        (long long) groups_per_segment_233616,
                                                        '\n');
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233621;
                                            
                                            segred_tmp_mem_233621.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233621,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233618,
                                                                      "segred_tmp_mem_233621")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233623;
                                            
                                            segred_tmp_mem_233623.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233623,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233618,
                                                                      "segred_tmp_mem_233623")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            mainzicounter_mem_233625 =
                                            ctx->mainzicounter_mem_233625;
                                            
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214321,
                                                                                    1,
                                                                                    (size_t) 1,
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214321,
                                                                                    2,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_214312),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214321,
                                                                                    3,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_214312),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214321,
                                                                                    4,
                                                                                    sizeof(n_p_203574),
                                                                                    &n_p_203574));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214321,
                                                                                    5,
                                                                                    sizeof(q_s_203575),
                                                                                    &q_s_203575));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214321,
                                                                                    6,
                                                                                    sizeof(partition_sizze_203667),
                                                                                    &partition_sizze_203667));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214321,
                                                                                    7,
                                                                                    sizeof(defunc_0_f_res_203721),
                                                                                    &defunc_0_f_res_203721));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214321,
                                                                                    8,
                                                                                    sizeof(s_n_m_203726),
                                                                                    &s_n_m_203726));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214321,
                                                                                    9,
                                                                                    sizeof(num_groups_214313),
                                                                                    &num_groups_214313));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214321,
                                                                                    10,
                                                                                    sizeof(groups_per_segment_233616),
                                                                                    &groups_per_segment_233616));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214321,
                                                                                    11,
                                                                                    sizeof(elements_per_thread_233617),
                                                                                    &elements_per_thread_233617));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214321,
                                                                                    12,
                                                                                    sizeof(virt_num_groups_233618),
                                                                                    &virt_num_groups_233618));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214321,
                                                                                    13,
                                                                                    sizeof(threads_per_segment_233620),
                                                                                    &threads_per_segment_233620));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214321,
                                                                                    14,
                                                                                    sizeof(ext_mem_229372.mem),
                                                                                    &ext_mem_229372.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214321,
                                                                                    15,
                                                                                    sizeof(ext_mem_229373.mem),
                                                                                    &ext_mem_229373.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214321,
                                                                                    16,
                                                                                    sizeof(ext_mem_229470.mem),
                                                                                    &ext_mem_229470.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214321,
                                                                                    17,
                                                                                    sizeof(ext_mem_229471.mem),
                                                                                    &ext_mem_229471.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214321,
                                                                                    18,
                                                                                    sizeof(mem_229634.mem),
                                                                                    &mem_229634.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214321,
                                                                                    19,
                                                                                    sizeof(mem_229639.mem),
                                                                                    &mem_229639.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214321,
                                                                                    20,
                                                                                    sizeof(mem_230107.mem),
                                                                                    &mem_230107.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214321,
                                                                                    21,
                                                                                    sizeof(mem_230112.mem),
                                                                                    &mem_230112.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214321,
                                                                                    22,
                                                                                    sizeof(mem_230117.mem),
                                                                                    &mem_230117.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214321,
                                                                                    23,
                                                                                    sizeof(mem_230122.mem),
                                                                                    &mem_230122.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214321,
                                                                                    24,
                                                                                    sizeof(mem_230128.mem),
                                                                                    &mem_230128.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214321,
                                                                                    25,
                                                                                    sizeof(mem_230133.mem),
                                                                                    &mem_230133.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214321,
                                                                                    26,
                                                                                    sizeof(segred_tmp_mem_233621.mem),
                                                                                    &segred_tmp_mem_233621.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214321,
                                                                                    27,
                                                                                    sizeof(segred_tmp_mem_233623.mem),
                                                                                    &segred_tmp_mem_233623.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214321,
                                                                                    28,
                                                                                    sizeof(mainzicounter_mem_233625.mem),
                                                                                    &mainzicounter_mem_233625.mem));
                                            if (1 *
                                                ((size_t) num_groups_214313 *
                                                 (size_t) segred_group_sizze_214312) !=
                                                0) {
                                                const size_t
                                                global_work_sizze_237115[1] =
                                                {(size_t) num_groups_214313 *
                                                (size_t) segred_group_sizze_214312};
                                                const size_t
                                                local_work_sizze_237119[1] =
                                                {(size_t) segred_group_sizze_214312};
                                                int64_t time_start_237116 = 0,
                                                        time_end_237117 = 0;
                                                
                                                if (ctx->debugging) {
                                                    fprintf(ctx->log,
                                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                            "main.segred_large_214321",
                                                            global_work_sizze_237115[0],
                                                            local_work_sizze_237119[0],
                                                            (int) (0 + 1 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_214312 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_214312));
                                                    time_start_237116 =
                                                        get_wall_time();
                                                }
                                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                                ctx->mainzisegred_large_214321,
                                                                                                1,
                                                                                                NULL,
                                                                                                global_work_sizze_237115,
                                                                                                local_work_sizze_237119,
                                                                                                0,
                                                                                                NULL,
                                                                                                ctx->profiling_paused ||
                                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                          &ctx->mainzisegred_large_214321_runs,
                                                                                                                                          &ctx->mainzisegred_large_214321_total_runtime)));
                                                if (ctx->debugging) {
                                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                    time_end_237117 =
                                                        get_wall_time();
                                                    
                                                    long time_diff_237118 =
                                                         time_end_237117 -
                                                         time_start_237116;
                                                    
                                                    fprintf(ctx->log,
                                                            "kernel %s runtime: %ldus\n",
                                                            "main.segred_large_214321",
                                                            time_diff_237118);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233623,
                                                                      "segred_tmp_mem_233623") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233621,
                                                                      "segred_tmp_mem_233621") !=
                                                0)
                                                return 1;
                                        }
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230107,
                                                                  "mem_230107") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230112,
                                                                  "mem_230112") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230117,
                                                                  "mem_230117") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230122,
                                                                  "mem_230122") !=
                                            0)
                                            return 1;
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230135,
                                                                &mem_230128,
                                                                "mem_230128") !=
                                            0)
                                            return 1;
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230134,
                                                                &mem_230133,
                                                                "mem_230133") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230133,
                                                                  "mem_230133") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230128,
                                                                  "mem_230128") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230122,
                                                                  "mem_230122") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230117,
                                                                  "mem_230117") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230112,
                                                                  "mem_230112") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230107,
                                                                  "mem_230107") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230101,
                                                                  "mem_230101") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230096,
                                                                  "mem_230096") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230091,
                                                                  "mem_230091") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230085,
                                                                  "mem_230085") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230081,
                                                                  "mem_230081") !=
                                            0)
                                            return 1;
                                    }
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230137,
                                                            &ext_mem_230135,
                                                            "ext_mem_230135") !=
                                        0)
                                        return 1;
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230136,
                                                            &ext_mem_230134,
                                                            "ext_mem_230134") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230134,
                                                              "ext_mem_230134") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230135,
                                                              "ext_mem_230135") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_set_device(ctx, &ext_mem_230151,
                                                        &ext_mem_230137,
                                                        "ext_mem_230137") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230150,
                                                        &ext_mem_230136,
                                                        "ext_mem_230136") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230136,
                                                          "ext_mem_230136") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230137,
                                                          "ext_mem_230137") !=
                                    0)
                                    return 1;
                            }
                            if (memblock_set_device(ctx, &ext_mem_230165,
                                                    &ext_mem_230151,
                                                    "ext_mem_230151") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230164,
                                                    &ext_mem_230150,
                                                    "ext_mem_230150") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230150,
                                                      "ext_mem_230150") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230151,
                                                      "ext_mem_230151") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_230526,
                                                &ext_mem_230165,
                                                "ext_mem_230165") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230525,
                                                &ext_mem_230164,
                                                "ext_mem_230164") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230164,
                                                  "ext_mem_230164") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230165,
                                                  "ext_mem_230165") != 0)
                            return 1;
                    } else {
                        bool suff_outer_par_214392;
                        
                        suff_outer_par_214392 =
                            *ctx->tuning_params.mainzisuff_outer_par_15 <=
                            partition_sizze_203667;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_15",
                                    (long) partition_sizze_203667,
                                    suff_outer_par_214392 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_214554;
                        
                        segmap_group_sizze_214554 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_214396;
                        
                        int64_t num_groups_214555;
                        int32_t max_num_groups_233673;
                        
                        max_num_groups_233673 =
                            *ctx->tuning_params.mainzisegmap_num_groups_214398;
                        num_groups_214555 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(partition_sizze_203667,
                                                                                 segmap_group_sizze_214554),
                                                                       sext_i32_i64(max_num_groups_233673))));
                        
                        int64_t segmap_group_sizze_216329;
                        
                        segmap_group_sizze_216329 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_214716;
                        
                        int64_t num_groups_216330;
                        int32_t max_num_groups_233674;
                        
                        max_num_groups_233674 =
                            *ctx->tuning_params.mainzisegmap_num_groups_214718;
                        num_groups_216330 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(binop_x_229310,
                                                                                 segmap_group_sizze_216329),
                                                                       sext_i32_i64(max_num_groups_233674))));
                        
                        bool suff_outer_par_216334;
                        
                        suff_outer_par_216334 =
                            *ctx->tuning_params.mainzisuff_outer_par_16 <=
                            binop_x_229310;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_16",
                                    (long) binop_x_229310,
                                    suff_outer_par_216334 ? "true" : "false");
                        
                        int64_t one_intra_par_min_216335 = q_s_203575 *
                                s_n_m_203726;
                        int64_t intra_avail_par_216337 = smin64(s_n_m_203726,
                                                                one_intra_par_min_216335);
                        int64_t computed_group_sizze_216338 =
                                smax64(s_n_m_203726, one_intra_par_min_216335);
                        bool fits_216342 = sle64(computed_group_sizze_216338,
                                                 max_group_sizze_206977);
                        bool suff_intra_par_216344;
                        
                        suff_intra_par_216344 =
                            *ctx->tuning_params.mainzisuff_intra_par_17 <=
                            intra_avail_par_216337;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_intra_par_17",
                                    (long) intra_avail_par_216337,
                                    suff_intra_par_216344 ? "true" : "false");
                        
                        bool intra_suff_and_fits_216345 = fits_216342 &&
                             suff_intra_par_216344;
                        int64_t segmap_group_sizze_216684;
                        
                        segmap_group_sizze_216684 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_215257;
                        
                        bool suff_outer_par_216689;
                        
                        suff_outer_par_216689 =
                            *ctx->tuning_params.mainzisuff_outer_par_18 <=
                            nest_sizze_208938;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_18",
                                    (long) nest_sizze_208938,
                                    suff_outer_par_216689 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_216839;
                        
                        segmap_group_sizze_216839 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_215674;
                        
                        int64_t nest_sizze_216861 = q_s_203575 *
                                nest_sizze_208938;
                        int64_t segred_group_sizze_216862;
                        
                        segred_group_sizze_216862 =
                            *ctx->tuning_params.mainzisegred_group_sizze_215602;
                        
                        int64_t num_groups_216863;
                        int32_t max_num_groups_233675;
                        
                        max_num_groups_233675 =
                            *ctx->tuning_params.mainzisegred_num_groups_215604;
                        num_groups_216863 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_216861,
                                                                                 segred_group_sizze_216862),
                                                                       sext_i32_i64(max_num_groups_233675))));
                        
                        int64_t segmap_group_sizze_216931;
                        
                        segmap_group_sizze_216931 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_215544;
                        
                        int64_t segred_group_sizze_216988;
                        
                        segred_group_sizze_216988 =
                            *ctx->tuning_params.mainzisegred_group_sizze_215433;
                        
                        int64_t num_groups_216989;
                        int32_t max_num_groups_233676;
                        
                        max_num_groups_233676 =
                            *ctx->tuning_params.mainzisegred_num_groups_215435;
                        num_groups_216989 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_216861,
                                                                                 segred_group_sizze_216988),
                                                                       sext_i32_i64(max_num_groups_233676))));
                        
                        int64_t bytes_230168 = (int64_t) 8 * nest_sizze_208938;
                        int64_t bytes_230175 = (int64_t) 8 * nest_sizze_207253;
                        int64_t binop_x_230286 = partition_sizze_203667 *
                                s_n_m_203726;
                        int64_t binop_x_230287 = n_p_203574 * binop_x_230286;
                        int64_t bytes_230288 = (int64_t) 8 * binop_x_230287;
                        int64_t binop_x_230294 = partition_sizze_203667 *
                                defunc_0_f_res_203721;
                        int64_t binop_x_230295 = n_p_203574 * binop_x_230294;
                        int64_t bytes_230296 = (int64_t) 8 * binop_x_230295;
                        int64_t bytes_230350 = smax64((int64_t) 0,
                                                      s_n_m_203726);
                        int64_t bytes_230423 = smax64((int64_t) 0,
                                                      binop_x_229403);
                        int64_t num_threads_232243 = segmap_group_sizze_214554 *
                                num_groups_214555;
                        int64_t total_sizze_232244 = bytes_229396 *
                                num_threads_232243;
                        int64_t total_sizze_232245 = bytes_229396 *
                                num_threads_232243;
                        int64_t num_threads_232246 = segmap_group_sizze_216329 *
                                num_groups_216330;
                        int64_t total_sizze_232247 = bytes_229419 *
                                num_threads_232246;
                        int64_t total_sizze_232248 = bytes_229419 *
                                num_threads_232246;
                        struct memblock_device ext_mem_230524;
                        
                        ext_mem_230524.references = NULL;
                        
                        struct memblock_device ext_mem_230523;
                        
                        ext_mem_230523.references = NULL;
                        
                        int32_t local_memory_capacity_234097;
                        
                        local_memory_capacity_234097 =
                            ctx->opencl.max_local_memory;
                        if (sle64((int64_t) 0,
                                  sext_i32_i64(local_memory_capacity_234097)) &&
                            suff_outer_par_214392) {
                            struct memblock_device mem_230169;
                            
                            mem_230169.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230169,
                                                      bytes_230168,
                                                      "mem_230169")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230169,
                                                                      (int64_t) 0,
                                                                      ext_mem_229470,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203574 *
                                                                      s_n_m_203726,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230169,
                                                          "mem_230169") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230523,
                                                          "ext_mem_230523") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230524,
                                                          "ext_mem_230524") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230172;
                            
                            mem_230172.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230172,
                                                      binop_y_229332,
                                                      "mem_230172")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_230172,
                                                                      (int64_t) 0,
                                                                      ext_mem_229372,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203574,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230172,
                                                          "mem_230172") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230169,
                                                          "mem_230169") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230523,
                                                          "ext_mem_230523") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230524,
                                                          "ext_mem_230524") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230176;
                            
                            mem_230176.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230176,
                                                      bytes_230175,
                                                      "mem_230176")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230176,
                                                                      (int64_t) 0,
                                                                      mem_229639,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203574 *
                                                                      defunc_0_f_res_203721,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230176,
                                                          "mem_230176") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230172,
                                                          "mem_230172") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230169,
                                                          "mem_230169") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230523,
                                                          "ext_mem_230523") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230524,
                                                          "ext_mem_230524") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230180;
                            
                            mem_230180.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230180,
                                                      bytes_230168,
                                                      "mem_230180")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_230180,
                                                                      (int64_t) 0,
                                                                      ext_mem_229471,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203574 *
                                                                      s_n_m_203726,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230180,
                                                          "mem_230180") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230176,
                                                          "mem_230176") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230172,
                                                          "mem_230172") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230169,
                                                          "mem_230169") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230523,
                                                          "ext_mem_230523") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230524,
                                                          "ext_mem_230524") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230184;
                            
                            mem_230184.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230184,
                                                      bytes_230175,
                                                      "mem_230184")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230184,
                                                                      (int64_t) 0,
                                                                      mem_229634,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203574 *
                                                                      defunc_0_f_res_203721,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230184,
                                                          "mem_230184") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230180,
                                                          "mem_230180") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230176,
                                                          "mem_230176") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230172,
                                                          "mem_230172") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230169,
                                                          "mem_230169") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230523,
                                                          "ext_mem_230523") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230524,
                                                          "ext_mem_230524") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230188;
                            
                            mem_230188.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230188,
                                                      bytes_230175,
                                                      "mem_230188")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_230188,
                                                                      (int64_t) 0,
                                                                      ext_mem_229373,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203574 *
                                                                      defunc_0_f_res_203721,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230188,
                                                          "mem_230188") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230184,
                                                          "mem_230184") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230180,
                                                          "mem_230180") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230176,
                                                          "mem_230176") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230172,
                                                          "mem_230172") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230169,
                                                          "mem_230169") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230523,
                                                          "ext_mem_230523") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230524,
                                                          "ext_mem_230524") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230281;
                            
                            mem_230281.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230281,
                                                      bytes_230168,
                                                      "mem_230281")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230285;
                            
                            mem_230285.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230285,
                                                      bytes_230168,
                                                      "mem_230285")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232115;
                            
                            color_232115.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232115,
                                                      total_sizze_232244,
                                                      "color_232115")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232116;
                            
                            color_232116.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232116,
                                                      total_sizze_232245,
                                                      "color_232116")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214560,
                                                                    1,
                                                                    sizeof(n_p_203574),
                                                                    &n_p_203574));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214560,
                                                                    2,
                                                                    sizeof(q_s_203575),
                                                                    &q_s_203575));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214560,
                                                                    3,
                                                                    sizeof(jump_s_203581),
                                                                    &jump_s_203581));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214560,
                                                                    4,
                                                                    sizeof(partition_sizze_203667),
                                                                    &partition_sizze_203667));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214560,
                                                                    5,
                                                                    sizeof(defunc_0_f_res_203721),
                                                                    &defunc_0_f_res_203721));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214560,
                                                                    6,
                                                                    sizeof(pad_css_len_203722),
                                                                    &pad_css_len_203722));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214560,
                                                                    7,
                                                                    sizeof(s_n_m_203726),
                                                                    &s_n_m_203726));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214560,
                                                                    8,
                                                                    sizeof(num_groups_214555),
                                                                    &num_groups_214555));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214560,
                                                                    9,
                                                                    sizeof(num_threads_232243),
                                                                    &num_threads_232243));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214560,
                                                                    10,
                                                                    sizeof(mem_230169.mem),
                                                                    &mem_230169.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214560,
                                                                    11,
                                                                    sizeof(mem_230172.mem),
                                                                    &mem_230172.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214560,
                                                                    12,
                                                                    sizeof(mem_230176.mem),
                                                                    &mem_230176.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214560,
                                                                    13,
                                                                    sizeof(mem_230180.mem),
                                                                    &mem_230180.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214560,
                                                                    14,
                                                                    sizeof(mem_230184.mem),
                                                                    &mem_230184.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214560,
                                                                    15,
                                                                    sizeof(mem_230188.mem),
                                                                    &mem_230188.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214560,
                                                                    16,
                                                                    sizeof(mem_230281.mem),
                                                                    &mem_230281.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214560,
                                                                    17,
                                                                    sizeof(mem_230285.mem),
                                                                    &mem_230285.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214560,
                                                                    18,
                                                                    sizeof(color_232115.mem),
                                                                    &color_232115.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214560,
                                                                    19,
                                                                    sizeof(color_232116.mem),
                                                                    &color_232116.mem));
                            if (1 * ((size_t) num_groups_214555 *
                                     (size_t) segmap_group_sizze_214554) != 0) {
                                const size_t global_work_sizze_237120[1] =
                                             {(size_t) num_groups_214555 *
                                             (size_t) segmap_group_sizze_214554};
                                const size_t local_work_sizze_237124[1] =
                                             {(size_t) segmap_group_sizze_214554};
                                int64_t time_start_237121 = 0, time_end_237122 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                            "main.segmap_214560",
                                            global_work_sizze_237120[0],
                                            local_work_sizze_237124[0],
                                            (int) 0);
                                    time_start_237121 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_214560,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237120,
                                                                                local_work_sizze_237124,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_214560_runs,
                                                                                                                          &ctx->mainzisegmap_214560_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237122 = get_wall_time();
                                    
                                    long time_diff_237123 = time_end_237122 -
                                         time_start_237121;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_214560",
                                            time_diff_237123);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_230169,
                                                      "mem_230169") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230172,
                                                      "mem_230172") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230176,
                                                      "mem_230176") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230180,
                                                      "mem_230180") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230184,
                                                      "mem_230184") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230188,
                                                      "mem_230188") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232115,
                                                      "color_232115") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232116,
                                                      "color_232116") != 0)
                                return 1;
                            
                            struct memblock_device mem_230515;
                            
                            mem_230515.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230515,
                                                      bytes_229405,
                                                      "mem_230515")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230515,
                                                                      (int64_t) 0,
                                                                      mem_230281,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203667,
                                                                      n_p_203574 *
                                                                      s_n_m_203726) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230515,
                                                          "mem_230515") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232116,
                                                          "color_232116") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232115,
                                                          "color_232115") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230285,
                                                          "mem_230285") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230281,
                                                          "mem_230281") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230188,
                                                          "mem_230188") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230184,
                                                          "mem_230184") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230180,
                                                          "mem_230180") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230176,
                                                          "mem_230176") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230172,
                                                          "mem_230172") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230169,
                                                          "mem_230169") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230523,
                                                          "ext_mem_230523") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230524,
                                                          "ext_mem_230524") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_230281,
                                                      "mem_230281") != 0)
                                return 1;
                            
                            struct memblock_device mem_230521;
                            
                            mem_230521.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230521,
                                                      bytes_229405,
                                                      "mem_230521")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230521,
                                                                      (int64_t) 0,
                                                                      mem_230285,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203667,
                                                                      n_p_203574 *
                                                                      s_n_m_203726) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230521,
                                                          "mem_230521") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230515,
                                                          "mem_230515") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232116,
                                                          "color_232116") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232115,
                                                          "color_232115") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230285,
                                                          "mem_230285") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230281,
                                                          "mem_230281") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230188,
                                                          "mem_230188") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230184,
                                                          "mem_230184") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230180,
                                                          "mem_230180") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230176,
                                                          "mem_230176") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230172,
                                                          "mem_230172") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230169,
                                                          "mem_230169") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230523,
                                                          "ext_mem_230523") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230524,
                                                          "ext_mem_230524") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_230285,
                                                      "mem_230285") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230524,
                                                    &mem_230515,
                                                    "mem_230515") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230523,
                                                    &mem_230521,
                                                    "mem_230521") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230521,
                                                      "mem_230521") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230515,
                                                      "mem_230515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232116,
                                                      "color_232116") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232115,
                                                      "color_232115") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230285,
                                                      "mem_230285") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230281,
                                                      "mem_230281") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230188,
                                                      "mem_230188") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230184,
                                                      "mem_230184") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230180,
                                                      "mem_230180") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230176,
                                                      "mem_230176") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230172,
                                                      "mem_230172") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230169,
                                                      "mem_230169") != 0)
                                return 1;
                        } else {
                            struct memblock_device ext_mem_230510;
                            
                            ext_mem_230510.references = NULL;
                            
                            struct memblock_device ext_mem_230509;
                            
                            ext_mem_230509.references = NULL;
                            
                            int32_t local_memory_capacity_234096;
                            
                            local_memory_capacity_234096 =
                                ctx->opencl.max_local_memory;
                            if (sle64((int64_t) 0,
                                      sext_i32_i64(local_memory_capacity_234096)) &&
                                suff_outer_par_216334) {
                                struct memblock_device mem_230289;
                                
                                mem_230289.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230289,
                                                          bytes_230288,
                                                          "mem_230289")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                          mem_230289,
                                                                          (int64_t) 0,
                                                                          ext_mem_229471,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          s_n_m_203726,
                                                                          partition_sizze_203667 *
                                                                          n_p_203574) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230289,
                                                              "mem_230289") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230509,
                                                              "ext_mem_230509") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230510,
                                                              "ext_mem_230510") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230523,
                                                              "ext_mem_230523") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230524,
                                                              "ext_mem_230524") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230525,
                                                              "ext_mem_230525") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230526,
                                                              "ext_mem_230526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230527,
                                                              "ext_mem_230527") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230528,
                                                              "ext_mem_230528") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230594,
                                                              "ext_mem_230594") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230595,
                                                              "ext_mem_230595") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229623,
                                                              "mem_param_229623") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229615,
                                                              "mem_param_229615") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231625,
                                                              "ext_mem_231625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231626,
                                                              "ext_mem_231626") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229601,
                                                              "mem_param_229601") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229593,
                                                              "mem_param_229593") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229585,
                                                              "mem_param_229585") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231968,
                                                              "ext_mem_231968") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231969,
                                                              "ext_mem_231969") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231970,
                                                              "ext_mem_231970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230659,
                                                              "mem_230659") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230642,
                                                              "mem_230642") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230625,
                                                              "mem_230625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230608,
                                                              "mem_230608") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229639,
                                                              "mem_229639") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229634,
                                                              "mem_229634") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229628,
                                                              "mem_229628") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229577,
                                                              "mem_229577") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229573,
                                                              "mem_229573") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229568,
                                                              "ext_mem_229568") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229569,
                                                              "ext_mem_229569") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229519,
                                                              "ext_mem_229519") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229520,
                                                              "ext_mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229470,
                                                              "ext_mem_229470") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229471,
                                                              "ext_mem_229471") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229372,
                                                              "ext_mem_229372") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229373,
                                                              "ext_mem_229373") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229314,
                                                              "mem_229314") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229308,
                                                              "mem_229308") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229304,
                                                              "ext_mem_229304") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229305,
                                                              "ext_mem_229305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229272,
                                                              "mem_229272") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229269,
                                                              "mem_229269") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232074,
                                                              "color_232074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229265,
                                                              "mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229263,
                                                              "mem_229263") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229260,
                                                              "mem_229260") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229242,
                                                              "mem_229242") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232361,
                                                              "mem_out_232361") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232360,
                                                              "mem_out_232360") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232359,
                                                              "mem_out_232359") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230293;
                                
                                mem_230293.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230293,
                                                          bytes_230288,
                                                          "mem_230293")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_230293,
                                                                          (int64_t) 0,
                                                                          ext_mem_229470,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          s_n_m_203726,
                                                                          partition_sizze_203667 *
                                                                          n_p_203574) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230293,
                                                              "mem_230293") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230289,
                                                              "mem_230289") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230509,
                                                              "ext_mem_230509") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230510,
                                                              "ext_mem_230510") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230523,
                                                              "ext_mem_230523") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230524,
                                                              "ext_mem_230524") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230525,
                                                              "ext_mem_230525") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230526,
                                                              "ext_mem_230526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230527,
                                                              "ext_mem_230527") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230528,
                                                              "ext_mem_230528") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230594,
                                                              "ext_mem_230594") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230595,
                                                              "ext_mem_230595") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229623,
                                                              "mem_param_229623") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229615,
                                                              "mem_param_229615") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231625,
                                                              "ext_mem_231625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231626,
                                                              "ext_mem_231626") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229601,
                                                              "mem_param_229601") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229593,
                                                              "mem_param_229593") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229585,
                                                              "mem_param_229585") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231968,
                                                              "ext_mem_231968") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231969,
                                                              "ext_mem_231969") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231970,
                                                              "ext_mem_231970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230659,
                                                              "mem_230659") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230642,
                                                              "mem_230642") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230625,
                                                              "mem_230625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230608,
                                                              "mem_230608") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229639,
                                                              "mem_229639") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229634,
                                                              "mem_229634") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229628,
                                                              "mem_229628") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229577,
                                                              "mem_229577") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229573,
                                                              "mem_229573") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229568,
                                                              "ext_mem_229568") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229569,
                                                              "ext_mem_229569") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229519,
                                                              "ext_mem_229519") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229520,
                                                              "ext_mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229470,
                                                              "ext_mem_229470") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229471,
                                                              "ext_mem_229471") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229372,
                                                              "ext_mem_229372") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229373,
                                                              "ext_mem_229373") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229314,
                                                              "mem_229314") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229308,
                                                              "mem_229308") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229304,
                                                              "ext_mem_229304") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229305,
                                                              "ext_mem_229305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229272,
                                                              "mem_229272") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229269,
                                                              "mem_229269") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232074,
                                                              "color_232074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229265,
                                                              "mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229263,
                                                              "mem_229263") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229260,
                                                              "mem_229260") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229242,
                                                              "mem_229242") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232361,
                                                              "mem_out_232361") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232360,
                                                              "mem_out_232360") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232359,
                                                              "mem_out_232359") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230297;
                                
                                mem_230297.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230297,
                                                          bytes_230296,
                                                          "mem_230297")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                          mem_230297,
                                                                          (int64_t) 0,
                                                                          ext_mem_229373,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          defunc_0_f_res_203721,
                                                                          partition_sizze_203667 *
                                                                          n_p_203574) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230297,
                                                              "mem_230297") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230293,
                                                              "mem_230293") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230289,
                                                              "mem_230289") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230509,
                                                              "ext_mem_230509") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230510,
                                                              "ext_mem_230510") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230523,
                                                              "ext_mem_230523") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230524,
                                                              "ext_mem_230524") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230525,
                                                              "ext_mem_230525") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230526,
                                                              "ext_mem_230526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230527,
                                                              "ext_mem_230527") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230528,
                                                              "ext_mem_230528") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230594,
                                                              "ext_mem_230594") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230595,
                                                              "ext_mem_230595") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229623,
                                                              "mem_param_229623") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229615,
                                                              "mem_param_229615") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231625,
                                                              "ext_mem_231625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231626,
                                                              "ext_mem_231626") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229601,
                                                              "mem_param_229601") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229593,
                                                              "mem_param_229593") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229585,
                                                              "mem_param_229585") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231968,
                                                              "ext_mem_231968") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231969,
                                                              "ext_mem_231969") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231970,
                                                              "ext_mem_231970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230659,
                                                              "mem_230659") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230642,
                                                              "mem_230642") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230625,
                                                              "mem_230625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230608,
                                                              "mem_230608") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229639,
                                                              "mem_229639") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229634,
                                                              "mem_229634") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229628,
                                                              "mem_229628") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229577,
                                                              "mem_229577") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229573,
                                                              "mem_229573") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229568,
                                                              "ext_mem_229568") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229569,
                                                              "ext_mem_229569") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229519,
                                                              "ext_mem_229519") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229520,
                                                              "ext_mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229470,
                                                              "ext_mem_229470") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229471,
                                                              "ext_mem_229471") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229372,
                                                              "ext_mem_229372") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229373,
                                                              "ext_mem_229373") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229314,
                                                              "mem_229314") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229308,
                                                              "mem_229308") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229304,
                                                              "ext_mem_229304") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229305,
                                                              "ext_mem_229305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229272,
                                                              "mem_229272") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229269,
                                                              "mem_229269") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232074,
                                                              "color_232074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229265,
                                                              "mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229263,
                                                              "mem_229263") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229260,
                                                              "mem_229260") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229242,
                                                              "mem_229242") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232361,
                                                              "mem_out_232361") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232360,
                                                              "mem_out_232360") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232359,
                                                              "mem_out_232359") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230301;
                                
                                mem_230301.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230301,
                                                          bytes_230296,
                                                          "mem_230301")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_230301,
                                                                          (int64_t) 0,
                                                                          mem_229639,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          defunc_0_f_res_203721,
                                                                          partition_sizze_203667 *
                                                                          n_p_203574) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230301,
                                                              "mem_230301") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230297,
                                                              "mem_230297") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230293,
                                                              "mem_230293") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230289,
                                                              "mem_230289") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230509,
                                                              "ext_mem_230509") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230510,
                                                              "ext_mem_230510") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230523,
                                                              "ext_mem_230523") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230524,
                                                              "ext_mem_230524") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230525,
                                                              "ext_mem_230525") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230526,
                                                              "ext_mem_230526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230527,
                                                              "ext_mem_230527") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230528,
                                                              "ext_mem_230528") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230594,
                                                              "ext_mem_230594") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230595,
                                                              "ext_mem_230595") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229623,
                                                              "mem_param_229623") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229615,
                                                              "mem_param_229615") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231625,
                                                              "ext_mem_231625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231626,
                                                              "ext_mem_231626") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229601,
                                                              "mem_param_229601") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229593,
                                                              "mem_param_229593") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229585,
                                                              "mem_param_229585") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231968,
                                                              "ext_mem_231968") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231969,
                                                              "ext_mem_231969") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231970,
                                                              "ext_mem_231970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230659,
                                                              "mem_230659") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230642,
                                                              "mem_230642") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230625,
                                                              "mem_230625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230608,
                                                              "mem_230608") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229639,
                                                              "mem_229639") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229634,
                                                              "mem_229634") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229628,
                                                              "mem_229628") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229577,
                                                              "mem_229577") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229573,
                                                              "mem_229573") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229568,
                                                              "ext_mem_229568") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229569,
                                                              "ext_mem_229569") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229519,
                                                              "ext_mem_229519") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229520,
                                                              "ext_mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229470,
                                                              "ext_mem_229470") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229471,
                                                              "ext_mem_229471") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229372,
                                                              "ext_mem_229372") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229373,
                                                              "ext_mem_229373") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229314,
                                                              "mem_229314") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229308,
                                                              "mem_229308") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229304,
                                                              "ext_mem_229304") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229305,
                                                              "ext_mem_229305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229272,
                                                              "mem_229272") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229269,
                                                              "mem_229269") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232074,
                                                              "color_232074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229265,
                                                              "mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229263,
                                                              "mem_229263") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229260,
                                                              "mem_229260") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229242,
                                                              "mem_229242") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232361,
                                                              "mem_out_232361") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232360,
                                                              "mem_out_232360") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232359,
                                                              "mem_out_232359") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230305;
                                
                                mem_230305.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230305,
                                                          bytes_230296,
                                                          "mem_230305")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_230305,
                                                                          (int64_t) 0,
                                                                          mem_229634,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          defunc_0_f_res_203721,
                                                                          partition_sizze_203667 *
                                                                          n_p_203574) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230305,
                                                              "mem_230305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230301,
                                                              "mem_230301") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230297,
                                                              "mem_230297") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230293,
                                                              "mem_230293") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230289,
                                                              "mem_230289") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230509,
                                                              "ext_mem_230509") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230510,
                                                              "ext_mem_230510") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230523,
                                                              "ext_mem_230523") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230524,
                                                              "ext_mem_230524") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230525,
                                                              "ext_mem_230525") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230526,
                                                              "ext_mem_230526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230527,
                                                              "ext_mem_230527") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230528,
                                                              "ext_mem_230528") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230594,
                                                              "ext_mem_230594") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230595,
                                                              "ext_mem_230595") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229623,
                                                              "mem_param_229623") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229615,
                                                              "mem_param_229615") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231625,
                                                              "ext_mem_231625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231626,
                                                              "ext_mem_231626") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229601,
                                                              "mem_param_229601") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229593,
                                                              "mem_param_229593") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229585,
                                                              "mem_param_229585") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231968,
                                                              "ext_mem_231968") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231969,
                                                              "ext_mem_231969") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231970,
                                                              "ext_mem_231970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230659,
                                                              "mem_230659") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230642,
                                                              "mem_230642") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230625,
                                                              "mem_230625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230608,
                                                              "mem_230608") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229639,
                                                              "mem_229639") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229634,
                                                              "mem_229634") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229628,
                                                              "mem_229628") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229577,
                                                              "mem_229577") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229573,
                                                              "mem_229573") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229568,
                                                              "ext_mem_229568") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229569,
                                                              "ext_mem_229569") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229519,
                                                              "ext_mem_229519") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229520,
                                                              "ext_mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229470,
                                                              "ext_mem_229470") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229471,
                                                              "ext_mem_229471") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229372,
                                                              "ext_mem_229372") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229373,
                                                              "ext_mem_229373") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229314,
                                                              "mem_229314") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229308,
                                                              "mem_229308") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229304,
                                                              "ext_mem_229304") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229305,
                                                              "ext_mem_229305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229272,
                                                              "mem_229272") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229269,
                                                              "mem_229269") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232074,
                                                              "color_232074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229265,
                                                              "mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229263,
                                                              "mem_229263") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229260,
                                                              "mem_229260") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229242,
                                                              "mem_229242") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232361,
                                                              "mem_out_232361") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232360,
                                                              "mem_out_232360") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232359,
                                                              "mem_out_232359") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230340;
                                
                                mem_230340.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230340,
                                                          bytes_230288,
                                                          "mem_230340")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230344;
                                
                                mem_230344.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230344,
                                                          bytes_230288,
                                                          "mem_230344")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device color_232117;
                                
                                color_232117.references = NULL;
                                if (memblock_alloc_device(ctx, &color_232117,
                                                          total_sizze_232247,
                                                          "color_232117")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device color_232118;
                                
                                color_232118.references = NULL;
                                if (memblock_alloc_device(ctx, &color_232118,
                                                          total_sizze_232248,
                                                          "color_232118")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216352,
                                                                        1,
                                                                        sizeof(n_p_203574),
                                                                        &n_p_203574));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216352,
                                                                        2,
                                                                        sizeof(q_s_203575),
                                                                        &q_s_203575));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216352,
                                                                        3,
                                                                        sizeof(jump_s_203581),
                                                                        &jump_s_203581));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216352,
                                                                        4,
                                                                        sizeof(partition_sizze_203667),
                                                                        &partition_sizze_203667));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216352,
                                                                        5,
                                                                        sizeof(defunc_0_f_res_203721),
                                                                        &defunc_0_f_res_203721));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216352,
                                                                        6,
                                                                        sizeof(pad_css_len_203722),
                                                                        &pad_css_len_203722));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216352,
                                                                        7,
                                                                        sizeof(s_n_m_203726),
                                                                        &s_n_m_203726));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216352,
                                                                        8,
                                                                        sizeof(num_groups_216330),
                                                                        &num_groups_216330));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216352,
                                                                        9,
                                                                        sizeof(num_threads_232246),
                                                                        &num_threads_232246));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216352,
                                                                        10,
                                                                        sizeof(ext_mem_229372.mem),
                                                                        &ext_mem_229372.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216352,
                                                                        11,
                                                                        sizeof(mem_230289.mem),
                                                                        &mem_230289.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216352,
                                                                        12,
                                                                        sizeof(mem_230293.mem),
                                                                        &mem_230293.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216352,
                                                                        13,
                                                                        sizeof(mem_230297.mem),
                                                                        &mem_230297.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216352,
                                                                        14,
                                                                        sizeof(mem_230301.mem),
                                                                        &mem_230301.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216352,
                                                                        15,
                                                                        sizeof(mem_230305.mem),
                                                                        &mem_230305.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216352,
                                                                        16,
                                                                        sizeof(mem_230340.mem),
                                                                        &mem_230340.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216352,
                                                                        17,
                                                                        sizeof(mem_230344.mem),
                                                                        &mem_230344.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216352,
                                                                        18,
                                                                        sizeof(color_232117.mem),
                                                                        &color_232117.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216352,
                                                                        19,
                                                                        sizeof(color_232118.mem),
                                                                        &color_232118.mem));
                                if (1 * ((size_t) num_groups_216330 *
                                         (size_t) segmap_group_sizze_216329) !=
                                    0) {
                                    const size_t global_work_sizze_237125[1] =
                                                 {(size_t) num_groups_216330 *
                                                 (size_t) segmap_group_sizze_216329};
                                    const size_t local_work_sizze_237129[1] =
                                                 {(size_t) segmap_group_sizze_216329};
                                    int64_t time_start_237126 = 0,
                                            time_end_237127 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                "main.segmap_216352",
                                                global_work_sizze_237125[0],
                                                local_work_sizze_237129[0],
                                                (int) 0);
                                        time_start_237126 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegmap_216352,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237125,
                                                                                    local_work_sizze_237129,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegmap_216352_runs,
                                                                                                                              &ctx->mainzisegmap_216352_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237127 = get_wall_time();
                                        
                                        long time_diff_237128 =
                                             time_end_237127 -
                                             time_start_237126;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segmap_216352",
                                                time_diff_237128);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx, &mem_230289,
                                                          "mem_230289") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230293,
                                                          "mem_230293") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230297,
                                                          "mem_230297") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230301,
                                                          "mem_230301") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230305,
                                                          "mem_230305") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232117,
                                                          "color_232117") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232118,
                                                          "color_232118") != 0)
                                    return 1;
                                
                                struct memblock_device mem_230501;
                                
                                mem_230501.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230501,
                                                          bytes_229405,
                                                          "mem_230501")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_230501,
                                                                          (int64_t) 0,
                                                                          mem_230340,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          partition_sizze_203667 *
                                                                          n_p_203574,
                                                                          s_n_m_203726) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230501,
                                                              "mem_230501") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232118,
                                                              "color_232118") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232117,
                                                              "color_232117") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230344,
                                                              "mem_230344") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230340,
                                                              "mem_230340") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230305,
                                                              "mem_230305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230301,
                                                              "mem_230301") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230297,
                                                              "mem_230297") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230293,
                                                              "mem_230293") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230289,
                                                              "mem_230289") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230509,
                                                              "ext_mem_230509") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230510,
                                                              "ext_mem_230510") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230523,
                                                              "ext_mem_230523") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230524,
                                                              "ext_mem_230524") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230525,
                                                              "ext_mem_230525") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230526,
                                                              "ext_mem_230526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230527,
                                                              "ext_mem_230527") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230528,
                                                              "ext_mem_230528") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230594,
                                                              "ext_mem_230594") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230595,
                                                              "ext_mem_230595") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229623,
                                                              "mem_param_229623") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229615,
                                                              "mem_param_229615") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231625,
                                                              "ext_mem_231625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231626,
                                                              "ext_mem_231626") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229601,
                                                              "mem_param_229601") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229593,
                                                              "mem_param_229593") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229585,
                                                              "mem_param_229585") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231968,
                                                              "ext_mem_231968") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231969,
                                                              "ext_mem_231969") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231970,
                                                              "ext_mem_231970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230659,
                                                              "mem_230659") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230642,
                                                              "mem_230642") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230625,
                                                              "mem_230625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230608,
                                                              "mem_230608") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229639,
                                                              "mem_229639") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229634,
                                                              "mem_229634") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229628,
                                                              "mem_229628") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229577,
                                                              "mem_229577") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229573,
                                                              "mem_229573") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229568,
                                                              "ext_mem_229568") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229569,
                                                              "ext_mem_229569") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229519,
                                                              "ext_mem_229519") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229520,
                                                              "ext_mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229470,
                                                              "ext_mem_229470") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229471,
                                                              "ext_mem_229471") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229372,
                                                              "ext_mem_229372") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229373,
                                                              "ext_mem_229373") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229314,
                                                              "mem_229314") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229308,
                                                              "mem_229308") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229304,
                                                              "ext_mem_229304") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229305,
                                                              "ext_mem_229305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229272,
                                                              "mem_229272") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229269,
                                                              "mem_229269") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232074,
                                                              "color_232074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229265,
                                                              "mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229263,
                                                              "mem_229263") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229260,
                                                              "mem_229260") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229242,
                                                              "mem_229242") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232361,
                                                              "mem_out_232361") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232360,
                                                              "mem_out_232360") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232359,
                                                              "mem_out_232359") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                if (memblock_unref_device(ctx, &mem_230340,
                                                          "mem_230340") != 0)
                                    return 1;
                                
                                struct memblock_device mem_230507;
                                
                                mem_230507.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230507,
                                                          bytes_229405,
                                                          "mem_230507")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_230507,
                                                                          (int64_t) 0,
                                                                          mem_230344,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          partition_sizze_203667 *
                                                                          n_p_203574,
                                                                          s_n_m_203726) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230507,
                                                              "mem_230507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230501,
                                                              "mem_230501") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232118,
                                                              "color_232118") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232117,
                                                              "color_232117") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230344,
                                                              "mem_230344") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230340,
                                                              "mem_230340") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230305,
                                                              "mem_230305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230301,
                                                              "mem_230301") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230297,
                                                              "mem_230297") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230293,
                                                              "mem_230293") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230289,
                                                              "mem_230289") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230509,
                                                              "ext_mem_230509") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230510,
                                                              "ext_mem_230510") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230523,
                                                              "ext_mem_230523") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230524,
                                                              "ext_mem_230524") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230525,
                                                              "ext_mem_230525") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230526,
                                                              "ext_mem_230526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230527,
                                                              "ext_mem_230527") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230528,
                                                              "ext_mem_230528") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230594,
                                                              "ext_mem_230594") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230595,
                                                              "ext_mem_230595") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229623,
                                                              "mem_param_229623") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229615,
                                                              "mem_param_229615") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231625,
                                                              "ext_mem_231625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231626,
                                                              "ext_mem_231626") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229601,
                                                              "mem_param_229601") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229593,
                                                              "mem_param_229593") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229585,
                                                              "mem_param_229585") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231968,
                                                              "ext_mem_231968") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231969,
                                                              "ext_mem_231969") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231970,
                                                              "ext_mem_231970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230659,
                                                              "mem_230659") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230642,
                                                              "mem_230642") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230625,
                                                              "mem_230625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230608,
                                                              "mem_230608") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229639,
                                                              "mem_229639") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229634,
                                                              "mem_229634") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229628,
                                                              "mem_229628") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229577,
                                                              "mem_229577") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229573,
                                                              "mem_229573") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229568,
                                                              "ext_mem_229568") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229569,
                                                              "ext_mem_229569") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229519,
                                                              "ext_mem_229519") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229520,
                                                              "ext_mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229470,
                                                              "ext_mem_229470") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229471,
                                                              "ext_mem_229471") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229372,
                                                              "ext_mem_229372") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229373,
                                                              "ext_mem_229373") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229314,
                                                              "mem_229314") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229308,
                                                              "mem_229308") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229304,
                                                              "ext_mem_229304") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229305,
                                                              "ext_mem_229305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229272,
                                                              "mem_229272") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229269,
                                                              "mem_229269") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232074,
                                                              "color_232074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229265,
                                                              "mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229263,
                                                              "mem_229263") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229260,
                                                              "mem_229260") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229242,
                                                              "mem_229242") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232361,
                                                              "mem_out_232361") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232360,
                                                              "mem_out_232360") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232359,
                                                              "mem_out_232359") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                if (memblock_unref_device(ctx, &mem_230344,
                                                          "mem_230344") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230510,
                                                        &mem_230501,
                                                        "mem_230501") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230509,
                                                        &mem_230507,
                                                        "mem_230507") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230507,
                                                          "mem_230507") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230501,
                                                          "mem_230501") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232118,
                                                          "color_232118") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232117,
                                                          "color_232117") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230344,
                                                          "mem_230344") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230340,
                                                          "mem_230340") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230305,
                                                          "mem_230305") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230301,
                                                          "mem_230301") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230297,
                                                          "mem_230297") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230293,
                                                          "mem_230293") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230289,
                                                          "mem_230289") != 0)
                                    return 1;
                            } else {
                                struct memblock_device ext_mem_230496;
                                
                                ext_mem_230496.references = NULL;
                                
                                struct memblock_device ext_mem_230495;
                                
                                ext_mem_230495.references = NULL;
                                
                                int32_t local_memory_capacity_234095;
                                
                                local_memory_capacity_234095 =
                                    ctx->opencl.max_local_memory;
                                if (sle64(bytes_229419 + srem64((int64_t) 8 -
                                                                srem64(bytes_229419,
                                                                       (int64_t) 8),
                                                                (int64_t) 8) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_230350 + srem64((int64_t) 8 -
                                                                 srem64(bytes_230350,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          ((int64_t) 8 * (s_n_m_203726 *
                                                          q_s_203575) +
                                           srem64((int64_t) 8 -
                                                  srem64((int64_t) 8 *
                                                         (s_n_m_203726 *
                                                          q_s_203575),
                                                         (int64_t) 8),
                                                  (int64_t) 8)) + ((int64_t) 8 *
                                                                   (s_n_m_203726 *
                                                                    q_s_203575) +
                                                                   srem64((int64_t) 8 -
                                                                          srem64((int64_t) 8 *
                                                                                 (s_n_m_203726 *
                                                                                  q_s_203575),
                                                                                 (int64_t) 8),
                                                                          (int64_t) 8)) +
                                          ((int64_t) 8 * (s_n_m_203726 *
                                                          q_s_203575) +
                                           srem64((int64_t) 8 -
                                                  srem64((int64_t) 8 *
                                                         (s_n_m_203726 *
                                                          q_s_203575),
                                                         (int64_t) 8),
                                                  (int64_t) 8)) + ((int64_t) 8 *
                                                                   (s_n_m_203726 *
                                                                    q_s_203575) +
                                                                   srem64((int64_t) 8 -
                                                                          srem64((int64_t) 8 *
                                                                                 (s_n_m_203726 *
                                                                                  q_s_203575),
                                                                                 (int64_t) 8),
                                                                          (int64_t) 8)) +
                                          ((int64_t) 8 * (s_n_m_203726 *
                                                          q_s_203575) +
                                           srem64((int64_t) 8 -
                                                  srem64((int64_t) 8 *
                                                         (s_n_m_203726 *
                                                          q_s_203575),
                                                         (int64_t) 8),
                                                  (int64_t) 8)) + ((int64_t) 8 *
                                                                   (s_n_m_203726 *
                                                                    q_s_203575) +
                                                                   srem64((int64_t) 8 -
                                                                          srem64((int64_t) 8 *
                                                                                 (s_n_m_203726 *
                                                                                  q_s_203575),
                                                                                 (int64_t) 8),
                                                                          (int64_t) 8)) +
                                          ((int64_t) 8 * (s_n_m_203726 *
                                                          q_s_203575) +
                                           srem64((int64_t) 8 -
                                                  srem64((int64_t) 8 *
                                                         (s_n_m_203726 *
                                                          q_s_203575),
                                                         (int64_t) 8),
                                                  (int64_t) 8)),
                                          sext_i32_i64(local_memory_capacity_234095)) &&
                                    intra_suff_and_fits_216345) {
                                    struct memblock_device mem_230398;
                                    
                                    mem_230398.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_230398,
                                                              bytes_229405,
                                                              "mem_230398")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device mem_230403;
                                    
                                    mem_230403.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_230403,
                                                              bytes_229405,
                                                              "mem_230403")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            1,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      (s_n_m_203726 *
                                                                                       q_s_203575)),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      (s_n_m_203726 *
                                                                                       q_s_203575)),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            3,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      (s_n_m_203726 *
                                                                                       q_s_203575)),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            4,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      (s_n_m_203726 *
                                                                                       q_s_203575)),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            5,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      (s_n_m_203726 *
                                                                                       q_s_203575)),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            6,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      (s_n_m_203726 *
                                                                                       q_s_203575)),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            7,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      (s_n_m_203726 *
                                                                                       q_s_203575)),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            8,
                                                                            (size_t) bytes_230350,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            9,
                                                                            (size_t) bytes_229419,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            10,
                                                                            (size_t) bytes_229419,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            11,
                                                                            (size_t) bytes_229419,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            12,
                                                                            (size_t) bytes_229419,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            13,
                                                                            (size_t) bytes_229419,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            14,
                                                                            (size_t) bytes_229419,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            15,
                                                                            (size_t) bytes_229419,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            16,
                                                                            (size_t) bytes_229419,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            17,
                                                                            (size_t) bytes_229419,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            18,
                                                                            (size_t) bytes_229419,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            19,
                                                                            (size_t) bytes_229419,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            20,
                                                                            sizeof(n_p_203574),
                                                                            &n_p_203574));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            21,
                                                                            sizeof(q_s_203575),
                                                                            &q_s_203575));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            22,
                                                                            sizeof(jump_s_203581),
                                                                            &jump_s_203581));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            23,
                                                                            sizeof(partition_sizze_203667),
                                                                            &partition_sizze_203667));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            24,
                                                                            sizeof(defunc_0_f_res_203721),
                                                                            &defunc_0_f_res_203721));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            25,
                                                                            sizeof(pad_css_len_203722),
                                                                            &pad_css_len_203722));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            26,
                                                                            sizeof(s_n_m_203726),
                                                                            &s_n_m_203726));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            27,
                                                                            sizeof(computed_group_sizze_216338),
                                                                            &computed_group_sizze_216338));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            28,
                                                                            sizeof(ext_mem_229372.mem),
                                                                            &ext_mem_229372.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            29,
                                                                            sizeof(ext_mem_229373.mem),
                                                                            &ext_mem_229373.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            30,
                                                                            sizeof(ext_mem_229470.mem),
                                                                            &ext_mem_229470.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            31,
                                                                            sizeof(ext_mem_229471.mem),
                                                                            &ext_mem_229471.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            32,
                                                                            sizeof(mem_229634.mem),
                                                                            &mem_229634.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            33,
                                                                            sizeof(mem_229639.mem),
                                                                            &mem_229639.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            34,
                                                                            sizeof(mem_230398.mem),
                                                                            &mem_230398.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216501,
                                                                            35,
                                                                            sizeof(mem_230403.mem),
                                                                            &mem_230403.mem));
                                    if (1 * ((size_t) binop_x_229310 *
                                             (size_t) computed_group_sizze_216338) !=
                                        0) {
                                        const size_t global_work_sizze_237130[1]
                                                     =
                                                     {(size_t) binop_x_229310 *
                                                     (size_t) computed_group_sizze_216338};
                                        const size_t local_work_sizze_237134[1]
                                                     =
                                                     {(size_t) computed_group_sizze_216338};
                                        int64_t time_start_237131 = 0,
                                                time_end_237132 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                    "main.segmap_intragroup_216501",
                                                    global_work_sizze_237130[0],
                                                    local_work_sizze_237134[0],
                                                    (int) (0 + (int64_t) 8 *
                                                           (s_n_m_203726 *
                                                            q_s_203575) +
                                                           (int64_t) 8 *
                                                           (s_n_m_203726 *
                                                            q_s_203575) +
                                                           (int64_t) 8 *
                                                           (s_n_m_203726 *
                                                            q_s_203575) +
                                                           (int64_t) 8 *
                                                           (s_n_m_203726 *
                                                            q_s_203575) +
                                                           (int64_t) 8 *
                                                           (s_n_m_203726 *
                                                            q_s_203575) +
                                                           (int64_t) 8 *
                                                           (s_n_m_203726 *
                                                            q_s_203575) +
                                                           (int64_t) 8 *
                                                           (s_n_m_203726 *
                                                            q_s_203575) +
                                                           bytes_230350 +
                                                           bytes_229419 +
                                                           bytes_229419 +
                                                           bytes_229419 +
                                                           bytes_229419 +
                                                           bytes_229419 +
                                                           bytes_229419 +
                                                           bytes_229419 +
                                                           bytes_229419 +
                                                           bytes_229419 +
                                                           bytes_229419 +
                                                           bytes_229419));
                                            time_start_237131 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegmap_intragroup_216501,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237130,
                                                                                        local_work_sizze_237134,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegmap_intragroup_216501_runs,
                                                                                                                                  &ctx->mainzisegmap_intragroup_216501_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237132 = get_wall_time();
                                            
                                            long time_diff_237133 =
                                                 time_end_237132 -
                                                 time_start_237131;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segmap_intragroup_216501",
                                                    time_diff_237133);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230496,
                                                            &mem_230398,
                                                            "mem_230398") != 0)
                                        return 1;
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230495,
                                                            &mem_230403,
                                                            "mem_230403") != 0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230403,
                                                              "mem_230403") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230398,
                                                              "mem_230398") !=
                                        0)
                                        return 1;
                                } else {
                                    int64_t segmap_usable_groups_216685 =
                                            sdiv_up64(nest_sizze_208938,
                                                      segmap_group_sizze_216684);
                                    struct memblock_device ext_mem_230494;
                                    
                                    ext_mem_230494.references = NULL;
                                    
                                    struct memblock_device ext_mem_230493;
                                    
                                    ext_mem_230493.references = NULL;
                                    
                                    int32_t local_memory_capacity_234094;
                                    
                                    local_memory_capacity_234094 =
                                        ctx->opencl.max_local_memory;
                                    if (sle64((int64_t) 0,
                                              sext_i32_i64(local_memory_capacity_234094)) &&
                                        suff_outer_par_216689) {
                                        struct memblock_device mem_230409;
                                        
                                        mem_230409.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230409,
                                                                  bytes_229405,
                                                                  "mem_230409")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230414;
                                        
                                        mem_230414.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230414,
                                                                  bytes_229405,
                                                                  "mem_230414")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegMap");
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216697,
                                                                                1,
                                                                                sizeof(n_p_203574),
                                                                                &n_p_203574));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216697,
                                                                                2,
                                                                                sizeof(q_s_203575),
                                                                                &q_s_203575));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216697,
                                                                                3,
                                                                                sizeof(jump_s_203581),
                                                                                &jump_s_203581));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216697,
                                                                                4,
                                                                                sizeof(partition_sizze_203667),
                                                                                &partition_sizze_203667));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216697,
                                                                                5,
                                                                                sizeof(defunc_0_f_res_203721),
                                                                                &defunc_0_f_res_203721));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216697,
                                                                                6,
                                                                                sizeof(pad_css_len_203722),
                                                                                &pad_css_len_203722));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216697,
                                                                                7,
                                                                                sizeof(s_n_m_203726),
                                                                                &s_n_m_203726));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216697,
                                                                                8,
                                                                                sizeof(ext_mem_229372.mem),
                                                                                &ext_mem_229372.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216697,
                                                                                9,
                                                                                sizeof(ext_mem_229373.mem),
                                                                                &ext_mem_229373.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216697,
                                                                                10,
                                                                                sizeof(ext_mem_229470.mem),
                                                                                &ext_mem_229470.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216697,
                                                                                11,
                                                                                sizeof(ext_mem_229471.mem),
                                                                                &ext_mem_229471.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216697,
                                                                                12,
                                                                                sizeof(mem_229634.mem),
                                                                                &mem_229634.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216697,
                                                                                13,
                                                                                sizeof(mem_229639.mem),
                                                                                &mem_229639.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216697,
                                                                                14,
                                                                                sizeof(mem_230409.mem),
                                                                                &mem_230409.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216697,
                                                                                15,
                                                                                sizeof(mem_230414.mem),
                                                                                &mem_230414.mem));
                                        if (1 *
                                            ((size_t) segmap_usable_groups_216685 *
                                             (size_t) segmap_group_sizze_216684) !=
                                            0) {
                                            const size_t
                                            global_work_sizze_237135[1] =
                                            {(size_t) segmap_usable_groups_216685 *
                                            (size_t) segmap_group_sizze_216684};
                                            const size_t
                                            local_work_sizze_237139[1] =
                                            {(size_t) segmap_group_sizze_216684};
                                            int64_t time_start_237136 = 0,
                                                    time_end_237137 = 0;
                                            
                                            if (ctx->debugging) {
                                                fprintf(ctx->log,
                                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                        "main.segmap_216697",
                                                        global_work_sizze_237135[0],
                                                        local_work_sizze_237139[0],
                                                        (int) 0);
                                                time_start_237136 =
                                                    get_wall_time();
                                            }
                                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                            ctx->mainzisegmap_216697,
                                                                                            1,
                                                                                            NULL,
                                                                                            global_work_sizze_237135,
                                                                                            local_work_sizze_237139,
                                                                                            0,
                                                                                            NULL,
                                                                                            ctx->profiling_paused ||
                                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                      &ctx->mainzisegmap_216697_runs,
                                                                                                                                      &ctx->mainzisegmap_216697_total_runtime)));
                                            if (ctx->debugging) {
                                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                time_end_237137 =
                                                    get_wall_time();
                                                
                                                long time_diff_237138 =
                                                     time_end_237137 -
                                                     time_start_237136;
                                                
                                                fprintf(ctx->log,
                                                        "kernel %s runtime: %ldus\n",
                                                        "main.segmap_216697",
                                                        time_diff_237138);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230494,
                                                                &mem_230409,
                                                                "mem_230409") !=
                                            0)
                                            return 1;
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230493,
                                                                &mem_230414,
                                                                "mem_230414") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230414,
                                                                  "mem_230414") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230409,
                                                                  "mem_230409") !=
                                            0)
                                            return 1;
                                    } else {
                                        int64_t segmap_usable_groups_216840 =
                                                sdiv_up64(nest_sizze_208938,
                                                          segmap_group_sizze_216839);
                                        struct memblock_device mem_230420;
                                        
                                        mem_230420.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230420,
                                                                  bytes_229405,
                                                                  "mem_230420")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230424;
                                        
                                        mem_230424.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230424,
                                                                  bytes_230423,
                                                                  "mem_230424")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegMap");
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216846,
                                                                                1,
                                                                                sizeof(n_p_203574),
                                                                                &n_p_203574));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216846,
                                                                                2,
                                                                                sizeof(jump_s_203581),
                                                                                &jump_s_203581));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216846,
                                                                                3,
                                                                                sizeof(partition_sizze_203667),
                                                                                &partition_sizze_203667));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216846,
                                                                                4,
                                                                                sizeof(defunc_0_f_res_203721),
                                                                                &defunc_0_f_res_203721));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216846,
                                                                                5,
                                                                                sizeof(pad_css_len_203722),
                                                                                &pad_css_len_203722));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216846,
                                                                                6,
                                                                                sizeof(s_n_m_203726),
                                                                                &s_n_m_203726));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216846,
                                                                                7,
                                                                                sizeof(mem_230420.mem),
                                                                                &mem_230420.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216846,
                                                                                8,
                                                                                sizeof(mem_230424.mem),
                                                                                &mem_230424.mem));
                                        if (1 *
                                            ((size_t) segmap_usable_groups_216840 *
                                             (size_t) segmap_group_sizze_216839) !=
                                            0) {
                                            const size_t
                                            global_work_sizze_237140[1] =
                                            {(size_t) segmap_usable_groups_216840 *
                                            (size_t) segmap_group_sizze_216839};
                                            const size_t
                                            local_work_sizze_237144[1] =
                                            {(size_t) segmap_group_sizze_216839};
                                            int64_t time_start_237141 = 0,
                                                    time_end_237142 = 0;
                                            
                                            if (ctx->debugging) {
                                                fprintf(ctx->log,
                                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                        "main.segmap_216846",
                                                        global_work_sizze_237140[0],
                                                        local_work_sizze_237144[0],
                                                        (int) 0);
                                                time_start_237141 =
                                                    get_wall_time();
                                            }
                                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                            ctx->mainzisegmap_216846,
                                                                                            1,
                                                                                            NULL,
                                                                                            global_work_sizze_237140,
                                                                                            local_work_sizze_237144,
                                                                                            0,
                                                                                            NULL,
                                                                                            ctx->profiling_paused ||
                                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                      &ctx->mainzisegmap_216846_runs,
                                                                                                                                      &ctx->mainzisegmap_216846_total_runtime)));
                                            if (ctx->debugging) {
                                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                time_end_237142 =
                                                    get_wall_time();
                                                
                                                long time_diff_237143 =
                                                     time_end_237142 -
                                                     time_start_237141;
                                                
                                                fprintf(ctx->log,
                                                        "kernel %s runtime: %ldus\n",
                                                        "main.segmap_216846",
                                                        time_diff_237143);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230424,
                                                                  "mem_230424") !=
                                            0)
                                            return 1;
                                        
                                        struct memblock_device mem_230430;
                                        
                                        mem_230430.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230430,
                                                                  bytes_229405,
                                                                  "mem_230430")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230435;
                                        
                                        mem_230435.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230435,
                                                                  bytes_229405,
                                                                  "mem_230435")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230440;
                                        
                                        mem_230440.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230440,
                                                                  bytes_229405,
                                                                  "mem_230440")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230445;
                                        
                                        mem_230445.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230445,
                                                                  bytes_229405,
                                                                  "mem_230445")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230450;
                                        
                                        mem_230450.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230450,
                                                                  bytes_229405,
                                                                  "mem_230450")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (slt64(q_s_203575 * (int64_t) 2,
                                                  segred_group_sizze_216862)) {
                                            int64_t
                                            segment_sizze_nonzzero_233860 =
                                            smax64((int64_t) 1, q_s_203575);
                                            int64_t num_threads_233861 =
                                                    num_groups_216863 *
                                                    segred_group_sizze_216862;
                                            
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n",
                                                        "\n# SegRed-small");
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_segments",
                                                        (long long) (partition_sizze_203667 *
                                                                     n_p_203574 *
                                                                     s_n_m_203726),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203575,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segments_per_group",
                                                        (long long) squot64(segred_group_sizze_216862,
                                                                            segment_sizze_nonzzero_233860),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "required_groups",
                                                        (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                                           n_p_203574 *
                                                                                           s_n_m_203726,
                                                                                           squot64(segred_group_sizze_216862,
                                                                                                   segment_sizze_nonzzero_233860))),
                                                        '\n');
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216874,
                                                                                    1,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_216862),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216874,
                                                                                    2,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_216862),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216874,
                                                                                    3,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_216862),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216874,
                                                                                    4,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_216862),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216874,
                                                                                    5,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_216862),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216874,
                                                                                    6,
                                                                                    sizeof(n_p_203574),
                                                                                    &n_p_203574));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216874,
                                                                                    7,
                                                                                    sizeof(q_s_203575),
                                                                                    &q_s_203575));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216874,
                                                                                    8,
                                                                                    sizeof(partition_sizze_203667),
                                                                                    &partition_sizze_203667));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216874,
                                                                                    9,
                                                                                    sizeof(defunc_0_f_res_203721),
                                                                                    &defunc_0_f_res_203721));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216874,
                                                                                    10,
                                                                                    sizeof(s_n_m_203726),
                                                                                    &s_n_m_203726));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216874,
                                                                                    11,
                                                                                    sizeof(num_groups_216863),
                                                                                    &num_groups_216863));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216874,
                                                                                    12,
                                                                                    sizeof(segment_sizze_nonzzero_233860),
                                                                                    &segment_sizze_nonzzero_233860));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216874,
                                                                                    13,
                                                                                    sizeof(ext_mem_229372.mem),
                                                                                    &ext_mem_229372.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216874,
                                                                                    14,
                                                                                    sizeof(ext_mem_229373.mem),
                                                                                    &ext_mem_229373.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216874,
                                                                                    15,
                                                                                    sizeof(ext_mem_229470.mem),
                                                                                    &ext_mem_229470.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216874,
                                                                                    16,
                                                                                    sizeof(ext_mem_229471.mem),
                                                                                    &ext_mem_229471.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216874,
                                                                                    17,
                                                                                    sizeof(mem_229639.mem),
                                                                                    &mem_229639.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216874,
                                                                                    18,
                                                                                    sizeof(mem_230420.mem),
                                                                                    &mem_230420.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216874,
                                                                                    19,
                                                                                    sizeof(mem_230430.mem),
                                                                                    &mem_230430.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216874,
                                                                                    20,
                                                                                    sizeof(mem_230435.mem),
                                                                                    &mem_230435.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216874,
                                                                                    21,
                                                                                    sizeof(mem_230440.mem),
                                                                                    &mem_230440.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216874,
                                                                                    22,
                                                                                    sizeof(mem_230445.mem),
                                                                                    &mem_230445.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216874,
                                                                                    23,
                                                                                    sizeof(mem_230450.mem),
                                                                                    &mem_230450.mem));
                                            if (1 *
                                                ((size_t) num_groups_216863 *
                                                 (size_t) segred_group_sizze_216862) !=
                                                0) {
                                                const size_t
                                                global_work_sizze_237145[1] =
                                                {(size_t) num_groups_216863 *
                                                (size_t) segred_group_sizze_216862};
                                                const size_t
                                                local_work_sizze_237149[1] =
                                                {(size_t) segred_group_sizze_216862};
                                                int64_t time_start_237146 = 0,
                                                        time_end_237147 = 0;
                                                
                                                if (ctx->debugging) {
                                                    fprintf(ctx->log,
                                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                            "main.segred_small_216874",
                                                            global_work_sizze_237145[0],
                                                            local_work_sizze_237149[0],
                                                            (int) (0 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_216862 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_216862 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_216862 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_216862 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_216862));
                                                    time_start_237146 =
                                                        get_wall_time();
                                                }
                                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                                ctx->mainzisegred_small_216874,
                                                                                                1,
                                                                                                NULL,
                                                                                                global_work_sizze_237145,
                                                                                                local_work_sizze_237149,
                                                                                                0,
                                                                                                NULL,
                                                                                                ctx->profiling_paused ||
                                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                          &ctx->mainzisegred_small_216874_runs,
                                                                                                                                          &ctx->mainzisegred_small_216874_total_runtime)));
                                                if (ctx->debugging) {
                                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                    time_end_237147 =
                                                        get_wall_time();
                                                    
                                                    long time_diff_237148 =
                                                         time_end_237147 -
                                                         time_start_237146;
                                                    
                                                    fprintf(ctx->log,
                                                            "kernel %s runtime: %ldus\n",
                                                            "main.segred_small_216874",
                                                            time_diff_237148);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                        } else {
                                            int64_t groups_per_segment_233915 =
                                                    sdiv_up64(num_groups_216863,
                                                              smax64((int64_t) 1,
                                                                     partition_sizze_203667 *
                                                                     n_p_203574 *
                                                                     s_n_m_203726));
                                            int64_t elements_per_thread_233916 =
                                                    sdiv_up64(q_s_203575,
                                                              segred_group_sizze_216862 *
                                                              groups_per_segment_233915);
                                            int64_t virt_num_groups_233917 =
                                                    groups_per_segment_233915 *
                                                    (partition_sizze_203667 *
                                                     n_p_203574 * s_n_m_203726);
                                            int64_t num_threads_233918 =
                                                    num_groups_216863 *
                                                    segred_group_sizze_216862;
                                            int64_t threads_per_segment_233919 =
                                                    groups_per_segment_233915 *
                                                    segred_group_sizze_216862;
                                            
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n",
                                                        "\n# SegRed-large");
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_segments",
                                                        (long long) (partition_sizze_203667 *
                                                                     n_p_203574 *
                                                                     s_n_m_203726),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203575,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "virt_num_groups",
                                                        (long long) virt_num_groups_233917,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_groups",
                                                        (long long) num_groups_216863,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "group_size",
                                                        (long long) segred_group_sizze_216862,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "elems_per_thread",
                                                        (long long) elements_per_thread_233916,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "groups_per_segment",
                                                        (long long) groups_per_segment_233915,
                                                        '\n');
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233920;
                                            
                                            segred_tmp_mem_233920.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233920,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233917,
                                                                      "segred_tmp_mem_233920")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233922;
                                            
                                            segred_tmp_mem_233922.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233922,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233917,
                                                                      "segred_tmp_mem_233922")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233924;
                                            
                                            segred_tmp_mem_233924.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233924,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233917,
                                                                      "segred_tmp_mem_233924")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233926;
                                            
                                            segred_tmp_mem_233926.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233926,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233917,
                                                                      "segred_tmp_mem_233926")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233928;
                                            
                                            segred_tmp_mem_233928.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233928,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233917,
                                                                      "segred_tmp_mem_233928")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            mainzicounter_mem_233930 =
                                            ctx->mainzicounter_mem_233930;
                                            
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    1,
                                                                                    (size_t) 1,
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    2,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_216862),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    3,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_216862),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    4,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_216862),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    5,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_216862),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    6,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_216862),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    7,
                                                                                    sizeof(n_p_203574),
                                                                                    &n_p_203574));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    8,
                                                                                    sizeof(q_s_203575),
                                                                                    &q_s_203575));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    9,
                                                                                    sizeof(partition_sizze_203667),
                                                                                    &partition_sizze_203667));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    10,
                                                                                    sizeof(defunc_0_f_res_203721),
                                                                                    &defunc_0_f_res_203721));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    11,
                                                                                    sizeof(s_n_m_203726),
                                                                                    &s_n_m_203726));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    12,
                                                                                    sizeof(num_groups_216863),
                                                                                    &num_groups_216863));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    13,
                                                                                    sizeof(groups_per_segment_233915),
                                                                                    &groups_per_segment_233915));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    14,
                                                                                    sizeof(elements_per_thread_233916),
                                                                                    &elements_per_thread_233916));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    15,
                                                                                    sizeof(virt_num_groups_233917),
                                                                                    &virt_num_groups_233917));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    16,
                                                                                    sizeof(threads_per_segment_233919),
                                                                                    &threads_per_segment_233919));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    17,
                                                                                    sizeof(ext_mem_229372.mem),
                                                                                    &ext_mem_229372.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    18,
                                                                                    sizeof(ext_mem_229373.mem),
                                                                                    &ext_mem_229373.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    19,
                                                                                    sizeof(ext_mem_229470.mem),
                                                                                    &ext_mem_229470.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    20,
                                                                                    sizeof(ext_mem_229471.mem),
                                                                                    &ext_mem_229471.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    21,
                                                                                    sizeof(mem_229639.mem),
                                                                                    &mem_229639.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    22,
                                                                                    sizeof(mem_230420.mem),
                                                                                    &mem_230420.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    23,
                                                                                    sizeof(mem_230430.mem),
                                                                                    &mem_230430.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    24,
                                                                                    sizeof(mem_230435.mem),
                                                                                    &mem_230435.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    25,
                                                                                    sizeof(mem_230440.mem),
                                                                                    &mem_230440.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    26,
                                                                                    sizeof(mem_230445.mem),
                                                                                    &mem_230445.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    27,
                                                                                    sizeof(mem_230450.mem),
                                                                                    &mem_230450.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    28,
                                                                                    sizeof(segred_tmp_mem_233920.mem),
                                                                                    &segred_tmp_mem_233920.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    29,
                                                                                    sizeof(segred_tmp_mem_233922.mem),
                                                                                    &segred_tmp_mem_233922.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    30,
                                                                                    sizeof(segred_tmp_mem_233924.mem),
                                                                                    &segred_tmp_mem_233924.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    31,
                                                                                    sizeof(segred_tmp_mem_233926.mem),
                                                                                    &segred_tmp_mem_233926.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    32,
                                                                                    sizeof(segred_tmp_mem_233928.mem),
                                                                                    &segred_tmp_mem_233928.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216874,
                                                                                    33,
                                                                                    sizeof(mainzicounter_mem_233930.mem),
                                                                                    &mainzicounter_mem_233930.mem));
                                            if (1 *
                                                ((size_t) num_groups_216863 *
                                                 (size_t) segred_group_sizze_216862) !=
                                                0) {
                                                const size_t
                                                global_work_sizze_237151[1] =
                                                {(size_t) num_groups_216863 *
                                                (size_t) segred_group_sizze_216862};
                                                const size_t
                                                local_work_sizze_237155[1] =
                                                {(size_t) segred_group_sizze_216862};
                                                int64_t time_start_237152 = 0,
                                                        time_end_237153 = 0;
                                                
                                                if (ctx->debugging) {
                                                    fprintf(ctx->log,
                                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                            "main.segred_large_216874",
                                                            global_work_sizze_237151[0],
                                                            local_work_sizze_237155[0],
                                                            (int) (0 + 1 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_216862 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_216862 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_216862 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_216862 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_216862));
                                                    time_start_237152 =
                                                        get_wall_time();
                                                }
                                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                                ctx->mainzisegred_large_216874,
                                                                                                1,
                                                                                                NULL,
                                                                                                global_work_sizze_237151,
                                                                                                local_work_sizze_237155,
                                                                                                0,
                                                                                                NULL,
                                                                                                ctx->profiling_paused ||
                                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                          &ctx->mainzisegred_large_216874_runs,
                                                                                                                                          &ctx->mainzisegred_large_216874_total_runtime)));
                                                if (ctx->debugging) {
                                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                    time_end_237153 =
                                                        get_wall_time();
                                                    
                                                    long time_diff_237154 =
                                                         time_end_237153 -
                                                         time_start_237152;
                                                    
                                                    fprintf(ctx->log,
                                                            "kernel %s runtime: %ldus\n",
                                                            "main.segred_large_216874",
                                                            time_diff_237154);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233928,
                                                                      "segred_tmp_mem_233928") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233926,
                                                                      "segred_tmp_mem_233926") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233924,
                                                                      "segred_tmp_mem_233924") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233922,
                                                                      "segred_tmp_mem_233922") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233920,
                                                                      "segred_tmp_mem_233920") !=
                                                0)
                                                return 1;
                                        }
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230420,
                                                                  "mem_230420") !=
                                            0)
                                            return 1;
                                        
                                        int64_t segmap_usable_groups_216932 =
                                                sdiv_up64(nest_sizze_208938,
                                                          segmap_group_sizze_216931);
                                        struct memblock_device mem_230456;
                                        
                                        mem_230456.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230456,
                                                                  bytes_229405,
                                                                  "mem_230456")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230461;
                                        
                                        mem_230461.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230461,
                                                                  bytes_229405,
                                                                  "mem_230461")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230466;
                                        
                                        mem_230466.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230466,
                                                                  bytes_229405,
                                                                  "mem_230466")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230471;
                                        
                                        mem_230471.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230471,
                                                                  bytes_229405,
                                                                  "mem_230471")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230476;
                                        
                                        mem_230476.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230476,
                                                                  bytes_229405,
                                                                  "mem_230476")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230481;
                                        
                                        mem_230481.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230481,
                                                                  bytes_229405,
                                                                  "mem_230481")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegMap");
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216942,
                                                                                1,
                                                                                sizeof(n_p_203574),
                                                                                &n_p_203574));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216942,
                                                                                2,
                                                                                sizeof(jump_s_203581),
                                                                                &jump_s_203581));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216942,
                                                                                3,
                                                                                sizeof(partition_sizze_203667),
                                                                                &partition_sizze_203667));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216942,
                                                                                4,
                                                                                sizeof(defunc_0_f_res_203721),
                                                                                &defunc_0_f_res_203721));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216942,
                                                                                5,
                                                                                sizeof(pad_css_len_203722),
                                                                                &pad_css_len_203722));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216942,
                                                                                6,
                                                                                sizeof(s_n_m_203726),
                                                                                &s_n_m_203726));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216942,
                                                                                7,
                                                                                sizeof(mem_230430.mem),
                                                                                &mem_230430.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216942,
                                                                                8,
                                                                                sizeof(mem_230435.mem),
                                                                                &mem_230435.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216942,
                                                                                9,
                                                                                sizeof(mem_230440.mem),
                                                                                &mem_230440.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216942,
                                                                                10,
                                                                                sizeof(mem_230445.mem),
                                                                                &mem_230445.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216942,
                                                                                11,
                                                                                sizeof(mem_230450.mem),
                                                                                &mem_230450.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216942,
                                                                                12,
                                                                                sizeof(mem_230456.mem),
                                                                                &mem_230456.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216942,
                                                                                13,
                                                                                sizeof(mem_230461.mem),
                                                                                &mem_230461.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216942,
                                                                                14,
                                                                                sizeof(mem_230466.mem),
                                                                                &mem_230466.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216942,
                                                                                15,
                                                                                sizeof(mem_230471.mem),
                                                                                &mem_230471.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216942,
                                                                                16,
                                                                                sizeof(mem_230476.mem),
                                                                                &mem_230476.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216942,
                                                                                17,
                                                                                sizeof(mem_230481.mem),
                                                                                &mem_230481.mem));
                                        if (1 *
                                            ((size_t) segmap_usable_groups_216932 *
                                             (size_t) segmap_group_sizze_216931) !=
                                            0) {
                                            const size_t
                                            global_work_sizze_237156[1] =
                                            {(size_t) segmap_usable_groups_216932 *
                                            (size_t) segmap_group_sizze_216931};
                                            const size_t
                                            local_work_sizze_237160[1] =
                                            {(size_t) segmap_group_sizze_216931};
                                            int64_t time_start_237157 = 0,
                                                    time_end_237158 = 0;
                                            
                                            if (ctx->debugging) {
                                                fprintf(ctx->log,
                                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                        "main.segmap_216942",
                                                        global_work_sizze_237156[0],
                                                        local_work_sizze_237160[0],
                                                        (int) 0);
                                                time_start_237157 =
                                                    get_wall_time();
                                            }
                                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                            ctx->mainzisegmap_216942,
                                                                                            1,
                                                                                            NULL,
                                                                                            global_work_sizze_237156,
                                                                                            local_work_sizze_237160,
                                                                                            0,
                                                                                            NULL,
                                                                                            ctx->profiling_paused ||
                                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                      &ctx->mainzisegmap_216942_runs,
                                                                                                                                      &ctx->mainzisegmap_216942_total_runtime)));
                                            if (ctx->debugging) {
                                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                time_end_237158 =
                                                    get_wall_time();
                                                
                                                long time_diff_237159 =
                                                     time_end_237158 -
                                                     time_start_237157;
                                                
                                                fprintf(ctx->log,
                                                        "kernel %s runtime: %ldus\n",
                                                        "main.segmap_216942",
                                                        time_diff_237159);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230430,
                                                                  "mem_230430") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230435,
                                                                  "mem_230435") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230440,
                                                                  "mem_230440") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230445,
                                                                  "mem_230445") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230450,
                                                                  "mem_230450") !=
                                            0)
                                            return 1;
                                        
                                        struct memblock_device mem_230487;
                                        
                                        mem_230487.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230487,
                                                                  bytes_229405,
                                                                  "mem_230487")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230492;
                                        
                                        mem_230492.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230492,
                                                                  bytes_229405,
                                                                  "mem_230492")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (slt64(q_s_203575 * (int64_t) 2,
                                                  segred_group_sizze_216988)) {
                                            int64_t
                                            segment_sizze_nonzzero_234004 =
                                            smax64((int64_t) 1, q_s_203575);
                                            int64_t num_threads_234005 =
                                                    num_groups_216989 *
                                                    segred_group_sizze_216988;
                                            
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n",
                                                        "\n# SegRed-small");
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_segments",
                                                        (long long) (partition_sizze_203667 *
                                                                     n_p_203574 *
                                                                     s_n_m_203726),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203575,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segments_per_group",
                                                        (long long) squot64(segred_group_sizze_216988,
                                                                            segment_sizze_nonzzero_234004),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "required_groups",
                                                        (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                                           n_p_203574 *
                                                                                           s_n_m_203726,
                                                                                           squot64(segred_group_sizze_216988,
                                                                                                   segment_sizze_nonzzero_234004))),
                                                        '\n');
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216997,
                                                                                    1,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_216988),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216997,
                                                                                    2,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_216988),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216997,
                                                                                    3,
                                                                                    sizeof(n_p_203574),
                                                                                    &n_p_203574));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216997,
                                                                                    4,
                                                                                    sizeof(q_s_203575),
                                                                                    &q_s_203575));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216997,
                                                                                    5,
                                                                                    sizeof(partition_sizze_203667),
                                                                                    &partition_sizze_203667));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216997,
                                                                                    6,
                                                                                    sizeof(defunc_0_f_res_203721),
                                                                                    &defunc_0_f_res_203721));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216997,
                                                                                    7,
                                                                                    sizeof(s_n_m_203726),
                                                                                    &s_n_m_203726));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216997,
                                                                                    8,
                                                                                    sizeof(num_groups_216989),
                                                                                    &num_groups_216989));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216997,
                                                                                    9,
                                                                                    sizeof(segment_sizze_nonzzero_234004),
                                                                                    &segment_sizze_nonzzero_234004));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216997,
                                                                                    10,
                                                                                    sizeof(ext_mem_229372.mem),
                                                                                    &ext_mem_229372.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216997,
                                                                                    11,
                                                                                    sizeof(ext_mem_229373.mem),
                                                                                    &ext_mem_229373.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216997,
                                                                                    12,
                                                                                    sizeof(ext_mem_229470.mem),
                                                                                    &ext_mem_229470.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216997,
                                                                                    13,
                                                                                    sizeof(ext_mem_229471.mem),
                                                                                    &ext_mem_229471.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216997,
                                                                                    14,
                                                                                    sizeof(mem_229634.mem),
                                                                                    &mem_229634.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216997,
                                                                                    15,
                                                                                    sizeof(mem_229639.mem),
                                                                                    &mem_229639.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216997,
                                                                                    16,
                                                                                    sizeof(mem_230456.mem),
                                                                                    &mem_230456.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216997,
                                                                                    17,
                                                                                    sizeof(mem_230461.mem),
                                                                                    &mem_230461.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216997,
                                                                                    18,
                                                                                    sizeof(mem_230466.mem),
                                                                                    &mem_230466.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216997,
                                                                                    19,
                                                                                    sizeof(mem_230471.mem),
                                                                                    &mem_230471.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216997,
                                                                                    20,
                                                                                    sizeof(mem_230476.mem),
                                                                                    &mem_230476.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216997,
                                                                                    21,
                                                                                    sizeof(mem_230481.mem),
                                                                                    &mem_230481.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216997,
                                                                                    22,
                                                                                    sizeof(mem_230487.mem),
                                                                                    &mem_230487.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216997,
                                                                                    23,
                                                                                    sizeof(mem_230492.mem),
                                                                                    &mem_230492.mem));
                                            if (1 *
                                                ((size_t) num_groups_216989 *
                                                 (size_t) segred_group_sizze_216988) !=
                                                0) {
                                                const size_t
                                                global_work_sizze_237161[1] =
                                                {(size_t) num_groups_216989 *
                                                (size_t) segred_group_sizze_216988};
                                                const size_t
                                                local_work_sizze_237165[1] =
                                                {(size_t) segred_group_sizze_216988};
                                                int64_t time_start_237162 = 0,
                                                        time_end_237163 = 0;
                                                
                                                if (ctx->debugging) {
                                                    fprintf(ctx->log,
                                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                            "main.segred_small_216997",
                                                            global_work_sizze_237161[0],
                                                            local_work_sizze_237165[0],
                                                            (int) (0 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_216988 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_216988));
                                                    time_start_237162 =
                                                        get_wall_time();
                                                }
                                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                                ctx->mainzisegred_small_216997,
                                                                                                1,
                                                                                                NULL,
                                                                                                global_work_sizze_237161,
                                                                                                local_work_sizze_237165,
                                                                                                0,
                                                                                                NULL,
                                                                                                ctx->profiling_paused ||
                                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                          &ctx->mainzisegred_small_216997_runs,
                                                                                                                                          &ctx->mainzisegred_small_216997_total_runtime)));
                                                if (ctx->debugging) {
                                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                    time_end_237163 =
                                                        get_wall_time();
                                                    
                                                    long time_diff_237164 =
                                                         time_end_237163 -
                                                         time_start_237162;
                                                    
                                                    fprintf(ctx->log,
                                                            "kernel %s runtime: %ldus\n",
                                                            "main.segred_small_216997",
                                                            time_diff_237164);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                        } else {
                                            int64_t groups_per_segment_234041 =
                                                    sdiv_up64(num_groups_216989,
                                                              smax64((int64_t) 1,
                                                                     partition_sizze_203667 *
                                                                     n_p_203574 *
                                                                     s_n_m_203726));
                                            int64_t elements_per_thread_234042 =
                                                    sdiv_up64(q_s_203575,
                                                              segred_group_sizze_216988 *
                                                              groups_per_segment_234041);
                                            int64_t virt_num_groups_234043 =
                                                    groups_per_segment_234041 *
                                                    (partition_sizze_203667 *
                                                     n_p_203574 * s_n_m_203726);
                                            int64_t num_threads_234044 =
                                                    num_groups_216989 *
                                                    segred_group_sizze_216988;
                                            int64_t threads_per_segment_234045 =
                                                    groups_per_segment_234041 *
                                                    segred_group_sizze_216988;
                                            
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n",
                                                        "\n# SegRed-large");
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_segments",
                                                        (long long) (partition_sizze_203667 *
                                                                     n_p_203574 *
                                                                     s_n_m_203726),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203575,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "virt_num_groups",
                                                        (long long) virt_num_groups_234043,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_groups",
                                                        (long long) num_groups_216989,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "group_size",
                                                        (long long) segred_group_sizze_216988,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "elems_per_thread",
                                                        (long long) elements_per_thread_234042,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "groups_per_segment",
                                                        (long long) groups_per_segment_234041,
                                                        '\n');
                                            
                                            struct memblock_device
                                            segred_tmp_mem_234046;
                                            
                                            segred_tmp_mem_234046.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_234046,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_234043,
                                                                      "segred_tmp_mem_234046")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_234048;
                                            
                                            segred_tmp_mem_234048.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_234048,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_234043,
                                                                      "segred_tmp_mem_234048")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            mainzicounter_mem_234050 =
                                            ctx->mainzicounter_mem_234050;
                                            
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    1,
                                                                                    (size_t) 1,
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    2,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_216988),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    3,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_216988),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    4,
                                                                                    sizeof(n_p_203574),
                                                                                    &n_p_203574));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    5,
                                                                                    sizeof(q_s_203575),
                                                                                    &q_s_203575));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    6,
                                                                                    sizeof(partition_sizze_203667),
                                                                                    &partition_sizze_203667));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    7,
                                                                                    sizeof(defunc_0_f_res_203721),
                                                                                    &defunc_0_f_res_203721));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    8,
                                                                                    sizeof(s_n_m_203726),
                                                                                    &s_n_m_203726));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    9,
                                                                                    sizeof(num_groups_216989),
                                                                                    &num_groups_216989));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    10,
                                                                                    sizeof(groups_per_segment_234041),
                                                                                    &groups_per_segment_234041));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    11,
                                                                                    sizeof(elements_per_thread_234042),
                                                                                    &elements_per_thread_234042));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    12,
                                                                                    sizeof(virt_num_groups_234043),
                                                                                    &virt_num_groups_234043));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    13,
                                                                                    sizeof(threads_per_segment_234045),
                                                                                    &threads_per_segment_234045));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    14,
                                                                                    sizeof(ext_mem_229372.mem),
                                                                                    &ext_mem_229372.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    15,
                                                                                    sizeof(ext_mem_229373.mem),
                                                                                    &ext_mem_229373.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    16,
                                                                                    sizeof(ext_mem_229470.mem),
                                                                                    &ext_mem_229470.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    17,
                                                                                    sizeof(ext_mem_229471.mem),
                                                                                    &ext_mem_229471.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    18,
                                                                                    sizeof(mem_229634.mem),
                                                                                    &mem_229634.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    19,
                                                                                    sizeof(mem_229639.mem),
                                                                                    &mem_229639.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    20,
                                                                                    sizeof(mem_230456.mem),
                                                                                    &mem_230456.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    21,
                                                                                    sizeof(mem_230461.mem),
                                                                                    &mem_230461.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    22,
                                                                                    sizeof(mem_230466.mem),
                                                                                    &mem_230466.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    23,
                                                                                    sizeof(mem_230471.mem),
                                                                                    &mem_230471.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    24,
                                                                                    sizeof(mem_230476.mem),
                                                                                    &mem_230476.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    25,
                                                                                    sizeof(mem_230481.mem),
                                                                                    &mem_230481.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    26,
                                                                                    sizeof(mem_230487.mem),
                                                                                    &mem_230487.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    27,
                                                                                    sizeof(mem_230492.mem),
                                                                                    &mem_230492.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    28,
                                                                                    sizeof(segred_tmp_mem_234046.mem),
                                                                                    &segred_tmp_mem_234046.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    29,
                                                                                    sizeof(segred_tmp_mem_234048.mem),
                                                                                    &segred_tmp_mem_234048.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216997,
                                                                                    30,
                                                                                    sizeof(mainzicounter_mem_234050.mem),
                                                                                    &mainzicounter_mem_234050.mem));
                                            if (1 *
                                                ((size_t) num_groups_216989 *
                                                 (size_t) segred_group_sizze_216988) !=
                                                0) {
                                                const size_t
                                                global_work_sizze_237167[1] =
                                                {(size_t) num_groups_216989 *
                                                (size_t) segred_group_sizze_216988};
                                                const size_t
                                                local_work_sizze_237171[1] =
                                                {(size_t) segred_group_sizze_216988};
                                                int64_t time_start_237168 = 0,
                                                        time_end_237169 = 0;
                                                
                                                if (ctx->debugging) {
                                                    fprintf(ctx->log,
                                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                            "main.segred_large_216997",
                                                            global_work_sizze_237167[0],
                                                            local_work_sizze_237171[0],
                                                            (int) (0 + 1 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_216988 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_216988));
                                                    time_start_237168 =
                                                        get_wall_time();
                                                }
                                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                                ctx->mainzisegred_large_216997,
                                                                                                1,
                                                                                                NULL,
                                                                                                global_work_sizze_237167,
                                                                                                local_work_sizze_237171,
                                                                                                0,
                                                                                                NULL,
                                                                                                ctx->profiling_paused ||
                                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                          &ctx->mainzisegred_large_216997_runs,
                                                                                                                                          &ctx->mainzisegred_large_216997_total_runtime)));
                                                if (ctx->debugging) {
                                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                    time_end_237169 =
                                                        get_wall_time();
                                                    
                                                    long time_diff_237170 =
                                                         time_end_237169 -
                                                         time_start_237168;
                                                    
                                                    fprintf(ctx->log,
                                                            "kernel %s runtime: %ldus\n",
                                                            "main.segred_large_216997",
                                                            time_diff_237170);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_234048,
                                                                      "segred_tmp_mem_234048") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_234046,
                                                                      "segred_tmp_mem_234046") !=
                                                0)
                                                return 1;
                                        }
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230456,
                                                                  "mem_230456") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230461,
                                                                  "mem_230461") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230466,
                                                                  "mem_230466") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230471,
                                                                  "mem_230471") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230476,
                                                                  "mem_230476") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230481,
                                                                  "mem_230481") !=
                                            0)
                                            return 1;
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230494,
                                                                &mem_230487,
                                                                "mem_230487") !=
                                            0)
                                            return 1;
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230493,
                                                                &mem_230492,
                                                                "mem_230492") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230492,
                                                                  "mem_230492") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230487,
                                                                  "mem_230487") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230481,
                                                                  "mem_230481") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230476,
                                                                  "mem_230476") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230471,
                                                                  "mem_230471") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230466,
                                                                  "mem_230466") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230461,
                                                                  "mem_230461") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230456,
                                                                  "mem_230456") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230450,
                                                                  "mem_230450") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230445,
                                                                  "mem_230445") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230440,
                                                                  "mem_230440") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230435,
                                                                  "mem_230435") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230430,
                                                                  "mem_230430") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230424,
                                                                  "mem_230424") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230420,
                                                                  "mem_230420") !=
                                            0)
                                            return 1;
                                    }
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230496,
                                                            &ext_mem_230494,
                                                            "ext_mem_230494") !=
                                        0)
                                        return 1;
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230495,
                                                            &ext_mem_230493,
                                                            "ext_mem_230493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230493,
                                                              "ext_mem_230493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230494,
                                                              "ext_mem_230494") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_set_device(ctx, &ext_mem_230510,
                                                        &ext_mem_230496,
                                                        "ext_mem_230496") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230509,
                                                        &ext_mem_230495,
                                                        "ext_mem_230495") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230495,
                                                          "ext_mem_230495") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230496,
                                                          "ext_mem_230496") !=
                                    0)
                                    return 1;
                            }
                            if (memblock_set_device(ctx, &ext_mem_230524,
                                                    &ext_mem_230510,
                                                    "ext_mem_230510") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230523,
                                                    &ext_mem_230509,
                                                    "ext_mem_230509") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230509,
                                                      "ext_mem_230509") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230510,
                                                      "ext_mem_230510") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_230526,
                                                &ext_mem_230524,
                                                "ext_mem_230524") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230525,
                                                &ext_mem_230523,
                                                "ext_mem_230523") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230523,
                                                  "ext_mem_230523") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230524,
                                                  "ext_mem_230524") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_230528,
                                            &ext_mem_230526,
                                            "ext_mem_230526") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_230527,
                                            &ext_mem_230525,
                                            "ext_mem_230525") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230525,
                                              "ext_mem_230525") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230526,
                                              "ext_mem_230526") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_230595, &ext_mem_230528,
                                        "ext_mem_230528") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_230594, &ext_mem_230527,
                                        "ext_mem_230527") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_230527,
                                          "ext_mem_230527") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_230528,
                                          "ext_mem_230528") != 0)
                    return 1;
            } else {
                bool match_lit_204707 = (int64_t) 0 == d_s_203578;
                int64_t binop_y_230536 = (int64_t) 8 * q_s_203575;
                int64_t bytes_230537 = smax64((int64_t) 0, binop_y_230536);
                struct memblock_device ext_mem_230593;
                
                ext_mem_230593.references = NULL;
                
                struct memblock_device ext_mem_230592;
                
                ext_mem_230592.references = NULL;
                if (match_lit_204707) {
                    struct memblock_device mem_230533;
                    
                    mem_230533.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_230533, bytes_229405,
                                              "mem_230533")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f64(ctx, mem_230533,
                                                      partition_sizze_203667 *
                                                      n_p_203574 * s_n_m_203726,
                                                      0.0) != 0) {
                        if (memblock_unref_device(ctx, &mem_230533,
                                                  "mem_230533") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230592,
                                                  "ext_mem_230592") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230593,
                                                  "ext_mem_230593") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230594,
                                                  "ext_mem_230594") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230595,
                                                  "ext_mem_230595") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229623,
                                                  "mem_param_229623") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229615,
                                                  "mem_param_229615") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231625,
                                                  "ext_mem_231625") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231626,
                                                  "ext_mem_231626") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229601,
                                                  "mem_param_229601") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229593,
                                                  "mem_param_229593") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229585,
                                                  "mem_param_229585") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231968,
                                                  "ext_mem_231968") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231969,
                                                  "ext_mem_231969") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231970,
                                                  "ext_mem_231970") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230659,
                                                  "mem_230659") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230642,
                                                  "mem_230642") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230625,
                                                  "mem_230625") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230608,
                                                  "mem_230608") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229639,
                                                  "mem_229639") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229634,
                                                  "mem_229634") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229628,
                                                  "mem_229628") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229577,
                                                  "mem_229577") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229573,
                                                  "mem_229573") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229568,
                                                  "ext_mem_229568") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229569,
                                                  "ext_mem_229569") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229519,
                                                  "ext_mem_229519") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229520,
                                                  "ext_mem_229520") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229470,
                                                  "ext_mem_229470") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229471,
                                                  "ext_mem_229471") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229372,
                                                  "ext_mem_229372") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229373,
                                                  "ext_mem_229373") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229314,
                                                  "mem_229314") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229308,
                                                  "mem_229308") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229304,
                                                  "ext_mem_229304") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229305,
                                                  "ext_mem_229305") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229272,
                                                  "mem_229272") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229269,
                                                  "mem_229269") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232074,
                                                  "color_232074") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229265,
                                                  "mem_229265") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229263,
                                                  "mem_229263") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229260,
                                                  "mem_229260") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229242,
                                                  "mem_229242") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232361,
                                                  "mem_out_232361") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232360,
                                                  "mem_out_232360") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232359,
                                                  "mem_out_232359") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_230544;
                    
                    mem_230544.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_230544, bytes_229405,
                                              "mem_230544")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217273,
                                                            1,
                                                            (size_t) ((int64_t) 8 *
                                                                      q_s_203575),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217273,
                                                            2,
                                                            (size_t) ((int64_t) 8 *
                                                                      q_s_203575),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217273,
                                                            3,
                                                            (size_t) bytes_230537,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217273,
                                                            4,
                                                            sizeof(n_p_203574),
                                                            &n_p_203574));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217273,
                                                            5,
                                                            sizeof(q_s_203575),
                                                            &q_s_203575));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217273,
                                                            6,
                                                            sizeof(jump_s_203581),
                                                            &jump_s_203581));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217273,
                                                            7,
                                                            sizeof(partition_sizze_203667),
                                                            &partition_sizze_203667));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217273,
                                                            8,
                                                            sizeof(defunc_0_f_res_203721),
                                                            &defunc_0_f_res_203721));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217273,
                                                            9,
                                                            sizeof(pad_css_len_203722),
                                                            &pad_css_len_203722));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217273,
                                                            10,
                                                            sizeof(s_n_m_203726),
                                                            &s_n_m_203726));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217273,
                                                            11,
                                                            sizeof(ext_mem_229372.mem),
                                                            &ext_mem_229372.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217273,
                                                            12,
                                                            sizeof(ext_mem_229373.mem),
                                                            &ext_mem_229373.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217273,
                                                            13,
                                                            sizeof(ext_mem_229470.mem),
                                                            &ext_mem_229470.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217273,
                                                            14,
                                                            sizeof(ext_mem_229471.mem),
                                                            &ext_mem_229471.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217273,
                                                            15,
                                                            sizeof(mem_229634.mem),
                                                            &mem_229634.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217273,
                                                            16,
                                                            sizeof(mem_229639.mem),
                                                            &mem_229639.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217273,
                                                            17,
                                                            sizeof(mem_230544.mem),
                                                            &mem_230544.mem));
                    if (1 * ((size_t) nest_sizze_208938 *
                             (size_t) q_s_203575) != 0) {
                        const size_t global_work_sizze_237172[1] =
                                     {(size_t) nest_sizze_208938 *
                                     (size_t) q_s_203575};
                        const size_t local_work_sizze_237176[1] =
                                     {(size_t) q_s_203575};
                        int64_t time_start_237173 = 0, time_end_237174 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.segmap_intragroup_217273",
                                    global_work_sizze_237172[0],
                                    local_work_sizze_237176[0], (int) (0 +
                                                                       (int64_t) 8 *
                                                                       q_s_203575 +
                                                                       (int64_t) 8 *
                                                                       q_s_203575 +
                                                                       bytes_230537));
                            time_start_237173 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_intragroup_217273,
                                                                        1, NULL,
                                                                        global_work_sizze_237172,
                                                                        local_work_sizze_237176,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_intragroup_217273_runs,
                                                                                                                  &ctx->mainzisegmap_intragroup_217273_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_237174 = get_wall_time();
                            
                            long time_diff_237175 = time_end_237174 -
                                 time_start_237173;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_intragroup_217273",
                                    time_diff_237175);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_set_device(ctx, &ext_mem_230593, &mem_230544,
                                            "mem_230544") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_230592, &mem_230533,
                                            "mem_230533") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230544, "mem_230544") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230533, "mem_230533") !=
                        0)
                        return 1;
                } else {
                    bool match_lit_204779 = (int64_t) 1 == d_s_203578;
                    struct memblock_device ext_mem_230591;
                    
                    ext_mem_230591.references = NULL;
                    
                    struct memblock_device ext_mem_230590;
                    
                    ext_mem_230590.references = NULL;
                    if (match_lit_204779) {
                        struct memblock_device mem_230558;
                        
                        mem_230558.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230558,
                                                  bytes_229405, "mem_230558")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230563;
                        
                        mem_230563.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230563,
                                                  bytes_229405, "mem_230563")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217594,
                                                                1,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_s_203575),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217594,
                                                                2,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_s_203575),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217594,
                                                                3,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_s_203575),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217594,
                                                                4,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_s_203575),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217594,
                                                                5,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_s_203575),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217594,
                                                                6,
                                                                (size_t) bytes_230537,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217594,
                                                                7,
                                                                (size_t) bytes_230537,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217594,
                                                                8,
                                                                sizeof(n_p_203574),
                                                                &n_p_203574));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217594,
                                                                9,
                                                                sizeof(q_s_203575),
                                                                &q_s_203575));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217594,
                                                                10,
                                                                sizeof(jump_s_203581),
                                                                &jump_s_203581));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217594,
                                                                11,
                                                                sizeof(partition_sizze_203667),
                                                                &partition_sizze_203667));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217594,
                                                                12,
                                                                sizeof(defunc_0_f_res_203721),
                                                                &defunc_0_f_res_203721));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217594,
                                                                13,
                                                                sizeof(pad_css_len_203722),
                                                                &pad_css_len_203722));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217594,
                                                                14,
                                                                sizeof(s_n_m_203726),
                                                                &s_n_m_203726));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217594,
                                                                15,
                                                                sizeof(ext_mem_229372.mem),
                                                                &ext_mem_229372.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217594,
                                                                16,
                                                                sizeof(ext_mem_229373.mem),
                                                                &ext_mem_229373.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217594,
                                                                17,
                                                                sizeof(ext_mem_229470.mem),
                                                                &ext_mem_229470.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217594,
                                                                18,
                                                                sizeof(ext_mem_229471.mem),
                                                                &ext_mem_229471.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217594,
                                                                19,
                                                                sizeof(mem_229634.mem),
                                                                &mem_229634.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217594,
                                                                20,
                                                                sizeof(mem_229639.mem),
                                                                &mem_229639.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217594,
                                                                21,
                                                                sizeof(mem_230558.mem),
                                                                &mem_230558.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217594,
                                                                22,
                                                                sizeof(mem_230563.mem),
                                                                &mem_230563.mem));
                        if (1 * ((size_t) nest_sizze_208938 *
                                 (size_t) q_s_203575) != 0) {
                            const size_t global_work_sizze_237177[1] =
                                         {(size_t) nest_sizze_208938 *
                                         (size_t) q_s_203575};
                            const size_t local_work_sizze_237181[1] =
                                         {(size_t) q_s_203575};
                            int64_t time_start_237178 = 0, time_end_237179 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.segmap_intragroup_217594",
                                        global_work_sizze_237177[0],
                                        local_work_sizze_237181[0], (int) (0 +
                                                                           (int64_t) 8 *
                                                                           q_s_203575 +
                                                                           (int64_t) 8 *
                                                                           q_s_203575 +
                                                                           (int64_t) 8 *
                                                                           q_s_203575 +
                                                                           (int64_t) 8 *
                                                                           q_s_203575 +
                                                                           (int64_t) 8 *
                                                                           q_s_203575 +
                                                                           bytes_230537 +
                                                                           bytes_230537));
                                time_start_237178 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_intragroup_217594,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237177,
                                                                            local_work_sizze_237181,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_intragroup_217594_runs,
                                                                                                                      &ctx->mainzisegmap_intragroup_217594_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237179 = get_wall_time();
                                
                                long time_diff_237180 = time_end_237179 -
                                     time_start_237178;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_217594",
                                        time_diff_237180);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_set_device(ctx, &ext_mem_230591,
                                                &mem_230558, "mem_230558") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230590,
                                                &mem_230563, "mem_230563") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230563,
                                                  "mem_230563") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230558,
                                                  "mem_230558") != 0)
                            return 1;
                    } else {
                        struct memblock_device mem_230584;
                        
                        mem_230584.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230584,
                                                  bytes_229405, "mem_230584")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230589;
                        
                        mem_230589.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230589,
                                                  bytes_229405, "mem_230589")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_218045,
                                                                1,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_s_203575),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_218045,
                                                                2,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_s_203575),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_218045,
                                                                3,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_s_203575),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_218045,
                                                                4,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_s_203575),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_218045,
                                                                5,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_s_203575),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_218045,
                                                                6,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_s_203575),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_218045,
                                                                7,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_s_203575),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_218045,
                                                                8,
                                                                (size_t) bytes_230537,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_218045,
                                                                9,
                                                                (size_t) bytes_230537,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_218045,
                                                                10,
                                                                (size_t) bytes_230537,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_218045,
                                                                11,
                                                                (size_t) bytes_230537,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_218045,
                                                                12,
                                                                sizeof(n_p_203574),
                                                                &n_p_203574));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_218045,
                                                                13,
                                                                sizeof(q_s_203575),
                                                                &q_s_203575));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_218045,
                                                                14,
                                                                sizeof(jump_s_203581),
                                                                &jump_s_203581));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_218045,
                                                                15,
                                                                sizeof(partition_sizze_203667),
                                                                &partition_sizze_203667));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_218045,
                                                                16,
                                                                sizeof(defunc_0_f_res_203721),
                                                                &defunc_0_f_res_203721));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_218045,
                                                                17,
                                                                sizeof(pad_css_len_203722),
                                                                &pad_css_len_203722));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_218045,
                                                                18,
                                                                sizeof(s_n_m_203726),
                                                                &s_n_m_203726));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_218045,
                                                                19,
                                                                sizeof(ext_mem_229372.mem),
                                                                &ext_mem_229372.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_218045,
                                                                20,
                                                                sizeof(ext_mem_229373.mem),
                                                                &ext_mem_229373.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_218045,
                                                                21,
                                                                sizeof(ext_mem_229470.mem),
                                                                &ext_mem_229470.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_218045,
                                                                22,
                                                                sizeof(ext_mem_229471.mem),
                                                                &ext_mem_229471.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_218045,
                                                                23,
                                                                sizeof(mem_229634.mem),
                                                                &mem_229634.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_218045,
                                                                24,
                                                                sizeof(mem_229639.mem),
                                                                &mem_229639.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_218045,
                                                                25,
                                                                sizeof(mem_230584.mem),
                                                                &mem_230584.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_218045,
                                                                26,
                                                                sizeof(mem_230589.mem),
                                                                &mem_230589.mem));
                        if (1 * ((size_t) nest_sizze_208938 *
                                 (size_t) q_s_203575) != 0) {
                            const size_t global_work_sizze_237182[1] =
                                         {(size_t) nest_sizze_208938 *
                                         (size_t) q_s_203575};
                            const size_t local_work_sizze_237186[1] =
                                         {(size_t) q_s_203575};
                            int64_t time_start_237183 = 0, time_end_237184 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.segmap_intragroup_218045",
                                        global_work_sizze_237182[0],
                                        local_work_sizze_237186[0], (int) (0 +
                                                                           (int64_t) 8 *
                                                                           q_s_203575 +
                                                                           (int64_t) 8 *
                                                                           q_s_203575 +
                                                                           (int64_t) 8 *
                                                                           q_s_203575 +
                                                                           (int64_t) 8 *
                                                                           q_s_203575 +
                                                                           (int64_t) 8 *
                                                                           q_s_203575 +
                                                                           (int64_t) 8 *
                                                                           q_s_203575 +
                                                                           (int64_t) 8 *
                                                                           q_s_203575 +
                                                                           bytes_230537 +
                                                                           bytes_230537 +
                                                                           bytes_230537 +
                                                                           bytes_230537));
                                time_start_237183 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_intragroup_218045,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237182,
                                                                            local_work_sizze_237186,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_intragroup_218045_runs,
                                                                                                                      &ctx->mainzisegmap_intragroup_218045_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237184 = get_wall_time();
                                
                                long time_diff_237185 = time_end_237184 -
                                     time_start_237183;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_218045",
                                        time_diff_237185);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_set_device(ctx, &ext_mem_230591,
                                                &mem_230584, "mem_230584") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230590,
                                                &mem_230589, "mem_230589") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230589,
                                                  "mem_230589") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230584,
                                                  "mem_230584") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_230593,
                                            &ext_mem_230591,
                                            "ext_mem_230591") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_230592,
                                            &ext_mem_230590,
                                            "ext_mem_230590") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230590,
                                              "ext_mem_230590") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230591,
                                              "ext_mem_230591") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_230595, &ext_mem_230593,
                                        "ext_mem_230593") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_230594, &ext_mem_230592,
                                        "ext_mem_230592") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_230592,
                                          "ext_mem_230592") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_230593,
                                          "ext_mem_230593") != 0)
                    return 1;
            }
            
            struct memblock_device ext_mem_230602;
            
            ext_mem_230602.references = NULL;
            if (cond_203725) {
                if (memblock_set_device(ctx, &ext_mem_230602, &ext_mem_230595,
                                        "ext_mem_230595") != 0)
                    return 1;
            } else {
                bool bounds_invalid_upwards_205061 = slt64(pad_css_len_203722,
                                                           (int64_t) 0);
                bool valid_205062 = !bounds_invalid_upwards_205061;
                bool range_valid_c_205063;
                
                if (!valid_205062) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Range ", (long long) (int64_t) 0, "..",
                                  (long long) (int64_t) 1, "..<",
                                  (long long) pad_css_len_203722,
                                  " is invalid.",
                                  "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  loess.fut:557:3-566:9\n   #4  stl.fut:220:31-96\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:219:23-221:48\n   #8  /prelude/soacs.fut:67:19-23\n   #9  /prelude/soacs.fut:67:3-37\n   #10 stl.fut:218:15-222:44\n   #11 stl.fut:415:61-429:75\n   #12 stl.fut:455:3-469:34\n   #13 stl.fut:439:1-469:34\n");
                    if (memblock_unref_device(ctx, &ext_mem_230602,
                                              "ext_mem_230602") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230594,
                                              "ext_mem_230594") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230595,
                                              "ext_mem_230595") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229623,
                                              "mem_param_229623") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229615,
                                              "mem_param_229615") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231625,
                                              "ext_mem_231625") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231626,
                                              "ext_mem_231626") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229601,
                                              "mem_param_229601") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229593,
                                              "mem_param_229593") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229585,
                                              "mem_param_229585") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231968,
                                              "ext_mem_231968") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231969,
                                              "ext_mem_231969") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231970,
                                              "ext_mem_231970") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230659, "mem_230659") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230642, "mem_230642") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230625, "mem_230625") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230608, "mem_230608") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229639, "mem_229639") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229634, "mem_229634") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229628, "mem_229628") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229577, "mem_229577") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229573, "mem_229573") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229568,
                                              "ext_mem_229568") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229569,
                                              "ext_mem_229569") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229519,
                                              "ext_mem_229519") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229520,
                                              "ext_mem_229520") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229470,
                                              "ext_mem_229470") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229471,
                                              "ext_mem_229471") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229372,
                                              "ext_mem_229372") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229373,
                                              "ext_mem_229373") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229304,
                                              "ext_mem_229304") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229305,
                                              "ext_mem_229305") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232074,
                                              "color_232074") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232361,
                                              "mem_out_232361") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232360,
                                              "mem_out_232360") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232359,
                                              "mem_out_232359") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                int64_t y_218495 = n_p_203574 * pad_css_len_203722;
                int64_t nest_sizze_218496 = partition_sizze_203667 * y_218495;
                int64_t segmap_group_sizze_218497;
                
                segmap_group_sizze_218497 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_218205;
                
                int64_t segmap_usable_groups_218498 =
                        sdiv_up64(nest_sizze_218496, segmap_group_sizze_218497);
                struct memblock_device mem_230601;
                
                mem_230601.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230601, bytes_230600,
                                          "mem_230601")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218503,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218503,
                                                        3, sizeof(n_p_203574),
                                                        &n_p_203574));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218503,
                                                        4,
                                                        sizeof(jump_s_203581),
                                                        &jump_s_203581));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218503,
                                                        5,
                                                        sizeof(partition_sizze_203667),
                                                        &partition_sizze_203667));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218503,
                                                        6,
                                                        sizeof(defunc_0_f_res_203721),
                                                        &defunc_0_f_res_203721));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218503,
                                                        7,
                                                        sizeof(pad_css_len_203722),
                                                        &pad_css_len_203722));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218503,
                                                        8, sizeof(s_n_m_203726),
                                                        &s_n_m_203726));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218503,
                                                        9,
                                                        sizeof(ext_mem_230594.mem),
                                                        &ext_mem_230594.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218503,
                                                        10,
                                                        sizeof(ext_mem_230595.mem),
                                                        &ext_mem_230595.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218503,
                                                        11,
                                                        sizeof(mem_230601.mem),
                                                        &mem_230601.mem));
                if (1 * ((size_t) segmap_usable_groups_218498 *
                         (size_t) segmap_group_sizze_218497) != 0) {
                    const size_t global_work_sizze_237187[1] =
                                 {(size_t) segmap_usable_groups_218498 *
                                 (size_t) segmap_group_sizze_218497};
                    const size_t local_work_sizze_237191[1] =
                                 {(size_t) segmap_group_sizze_218497};
                    int64_t time_start_237188 = 0, time_end_237189 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.segmap_218503",
                                global_work_sizze_237187[0],
                                local_work_sizze_237191[0], (int) 0);
                        time_start_237188 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_218503,
                                                                    1, NULL,
                                                                    global_work_sizze_237187,
                                                                    local_work_sizze_237191,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_218503_runs,
                                                                                                              &ctx->mainzisegmap_218503_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237189 = get_wall_time();
                        
                        long time_diff_237190 = time_end_237189 -
                             time_start_237188;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_218503", time_diff_237190);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_set_device(ctx, &ext_mem_230602, &mem_230601,
                                        "mem_230601") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230601, "mem_230601") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &ext_mem_230594, "ext_mem_230594") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230595, "ext_mem_230595") !=
                0)
                return 1;
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218652, 1,
                                                    sizeof(ctx->failure_is_an_option),
                                                    &ctx->failure_is_an_option));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218652, 3,
                                                    sizeof(n_p_203574),
                                                    &n_p_203574));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218652, 4,
                                                    sizeof(partition_sizze_203667),
                                                    &partition_sizze_203667));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218652, 5,
                                                    sizeof(C_len_203724),
                                                    &C_len_203724));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218652, 6,
                                                    sizeof(css_results_l_204200),
                                                    &css_results_l_204200));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218652, 7,
                                                    sizeof(ext_mem_230602.mem),
                                                    &ext_mem_230602.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218652, 8,
                                                    sizeof(mem_230608.mem),
                                                    &mem_230608.mem));
            if (1 * ((size_t) segmap_usable_groups_218648 *
                     (size_t) segmap_group_sizze_218647) != 0) {
                const size_t global_work_sizze_237192[1] =
                             {(size_t) segmap_usable_groups_218648 *
                             (size_t) segmap_group_sizze_218647};
                const size_t local_work_sizze_237196[1] =
                             {(size_t) segmap_group_sizze_218647};
                int64_t time_start_237193 = 0, time_end_237194 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                            "main.segmap_218652", global_work_sizze_237192[0],
                            local_work_sizze_237196[0], (int) 0);
                    time_start_237193 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_218652,
                                                                1, NULL,
                                                                global_work_sizze_237192,
                                                                local_work_sizze_237196,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_218652_runs,
                                                                                                          &ctx->mainzisegmap_218652_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_237194 = get_wall_time();
                    
                    long time_diff_237195 = time_end_237194 - time_start_237193;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_218652", time_diff_237195);
                }
            }
            ctx->failure_is_an_option = 1;
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_unref_device(ctx, &ext_mem_230602, "ext_mem_230602") !=
                0)
                return 1;
            
            struct memblock_device ext_mem_230620;
            
            ext_mem_230620.references = NULL;
            
            int32_t local_memory_capacity_234279;
            
            local_memory_capacity_234279 = ctx->opencl.max_local_memory;
            if (sle64((int64_t) 0,
                      sext_i32_i64(local_memory_capacity_234279)) &&
                suff_outer_par_218668) {
                struct memblock_device mem_230611;
                
                mem_230611.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230611, binop_y_230606,
                                          "mem_230611")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_230611,
                                                          (int64_t) 0,
                                                          mem_230608,
                                                          (int64_t) 0,
                                                          (int64_t) 1,
                                                          C_len_203724,
                                                          partition_sizze_203667) !=
                    0) {
                    if (memblock_unref_device(ctx, &mem_230611, "mem_230611") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230620,
                                              "ext_mem_230620") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230602,
                                              "ext_mem_230602") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230594,
                                              "ext_mem_230594") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230595,
                                              "ext_mem_230595") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229623,
                                              "mem_param_229623") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229615,
                                              "mem_param_229615") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231625,
                                              "ext_mem_231625") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231626,
                                              "ext_mem_231626") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229601,
                                              "mem_param_229601") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229593,
                                              "mem_param_229593") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229585,
                                              "mem_param_229585") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231968,
                                              "ext_mem_231968") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231969,
                                              "ext_mem_231969") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231970,
                                              "ext_mem_231970") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230659, "mem_230659") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230642, "mem_230642") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230625, "mem_230625") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230608, "mem_230608") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229639, "mem_229639") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229634, "mem_229634") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229628, "mem_229628") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229577, "mem_229577") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229573, "mem_229573") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229568,
                                              "ext_mem_229568") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229569,
                                              "ext_mem_229569") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229519,
                                              "ext_mem_229519") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229520,
                                              "ext_mem_229520") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229470,
                                              "ext_mem_229470") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229471,
                                              "ext_mem_229471") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229372,
                                              "ext_mem_229372") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229373,
                                              "ext_mem_229373") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229304,
                                              "ext_mem_229304") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229305,
                                              "ext_mem_229305") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232074,
                                              "color_232074") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232361,
                                              "mem_out_232361") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232360,
                                              "mem_out_232360") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232359,
                                              "mem_out_232359") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_230615;
                
                mem_230615.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230615, bytes_229288,
                                          "mem_230615")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218688,
                                                        1, sizeof(n_p_203574),
                                                        &n_p_203574));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218688,
                                                        2,
                                                        sizeof(partition_sizze_203667),
                                                        &partition_sizze_203667));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218688,
                                                        3,
                                                        sizeof(mem_230611.mem),
                                                        &mem_230611.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218688,
                                                        4,
                                                        sizeof(mem_230615.mem),
                                                        &mem_230615.mem));
                if (1 * ((size_t) segmap_usable_groups_218685 *
                         (size_t) segmap_group_sizze_218684) != 0) {
                    const size_t global_work_sizze_237197[1] =
                                 {(size_t) segmap_usable_groups_218685 *
                                 (size_t) segmap_group_sizze_218684};
                    const size_t local_work_sizze_237201[1] =
                                 {(size_t) segmap_group_sizze_218684};
                    int64_t time_start_237198 = 0, time_end_237199 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.segmap_218688",
                                global_work_sizze_237197[0],
                                local_work_sizze_237201[0], (int) 0);
                        time_start_237198 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_218688,
                                                                    1, NULL,
                                                                    global_work_sizze_237197,
                                                                    local_work_sizze_237201,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_218688_runs,
                                                                                                              &ctx->mainzisegmap_218688_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237199 = get_wall_time();
                        
                        long time_diff_237200 = time_end_237199 -
                             time_start_237198;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_218688", time_diff_237200);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_230611, "mem_230611") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_230620, &mem_230615,
                                        "mem_230615") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230615, "mem_230615") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230611, "mem_230611") != 0)
                    return 1;
            } else {
                struct memblock_device mem_230619;
                
                mem_230619.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230619, bytes_229288,
                                          "mem_230619")) {
                    err = 1;
                    goto cleanup;
                }
                if (slt64(n_p_203574 * (int64_t) 2,
                          segred_group_sizze_218715)) {
                    int64_t segment_sizze_nonzzero_234211 = smax64((int64_t) 1,
                                                                   n_p_203574);
                    int64_t num_threads_234212 = num_groups_218716 *
                            segred_group_sizze_218715;
                    
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegRed-small");
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                (long long) partition_sizze_203667, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) n_p_203574, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segments_per_group",
                                (long long) squot64(segred_group_sizze_218715,
                                                    segment_sizze_nonzzero_234211),
                                '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "required_groups",
                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667,
                                                                   squot64(segred_group_sizze_218715,
                                                                           segment_sizze_nonzzero_234211))),
                                '\n');
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218721,
                                                            1,
                                                            (size_t) ((int64_t) 8 *
                                                                      segred_group_sizze_218715),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218721,
                                                            2,
                                                            sizeof(n_p_203574),
                                                            &n_p_203574));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218721,
                                                            3,
                                                            sizeof(partition_sizze_203667),
                                                            &partition_sizze_203667));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218721,
                                                            4,
                                                            sizeof(C_len_203724),
                                                            &C_len_203724));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218721,
                                                            5,
                                                            sizeof(num_groups_218716),
                                                            &num_groups_218716));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218721,
                                                            6,
                                                            sizeof(segment_sizze_nonzzero_234211),
                                                            &segment_sizze_nonzzero_234211));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218721,
                                                            7,
                                                            sizeof(mem_230608.mem),
                                                            &mem_230608.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218721,
                                                            8,
                                                            sizeof(mem_230619.mem),
                                                            &mem_230619.mem));
                    if (1 * ((size_t) num_groups_218716 *
                             (size_t) segred_group_sizze_218715) != 0) {
                        const size_t global_work_sizze_237202[1] =
                                     {(size_t) num_groups_218716 *
                                     (size_t) segred_group_sizze_218715};
                        const size_t local_work_sizze_237206[1] =
                                     {(size_t) segred_group_sizze_218715};
                        int64_t time_start_237203 = 0, time_end_237204 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.segred_small_218721",
                                    global_work_sizze_237202[0],
                                    local_work_sizze_237206[0], (int) (0 +
                                                                       (int64_t) 8 *
                                                                       segred_group_sizze_218715));
                            time_start_237203 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegred_small_218721,
                                                                        1, NULL,
                                                                        global_work_sizze_237202,
                                                                        local_work_sizze_237206,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegred_small_218721_runs,
                                                                                                                  &ctx->mainzisegred_small_218721_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_237204 = get_wall_time();
                            
                            long time_diff_237205 = time_end_237204 -
                                 time_start_237203;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segred_small_218721",
                                    time_diff_237205);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                } else {
                    int64_t groups_per_segment_234238 =
                            sdiv_up64(num_groups_218716, smax64((int64_t) 1,
                                                                partition_sizze_203667));
                    int64_t elements_per_thread_234239 = sdiv_up64(n_p_203574,
                                                                   segred_group_sizze_218715 *
                                                                   groups_per_segment_234238);
                    int64_t virt_num_groups_234240 = groups_per_segment_234238 *
                            partition_sizze_203667;
                    int64_t num_threads_234241 = num_groups_218716 *
                            segred_group_sizze_218715;
                    int64_t threads_per_segment_234242 =
                            groups_per_segment_234238 *
                            segred_group_sizze_218715;
                    
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegRed-large");
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                (long long) partition_sizze_203667, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) n_p_203574, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "virt_num_groups",
                                (long long) virt_num_groups_234240, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                (long long) num_groups_218716, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "group_size",
                                (long long) segred_group_sizze_218715, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "elems_per_thread",
                                (long long) elements_per_thread_234239, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "groups_per_segment",
                                (long long) groups_per_segment_234238, '\n');
                    
                    struct memblock_device segred_tmp_mem_234243;
                    
                    segred_tmp_mem_234243.references = NULL;
                    if (memblock_alloc_device(ctx, &segred_tmp_mem_234243,
                                              (int64_t) 8 *
                                              virt_num_groups_234240,
                                              "segred_tmp_mem_234243")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mainzicounter_mem_234245 =
                                           ctx->mainzicounter_mem_234245;
                    
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218721,
                                                            1, (size_t) 1,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218721,
                                                            2,
                                                            (size_t) ((int64_t) 8 *
                                                                      segred_group_sizze_218715),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218721,
                                                            3,
                                                            sizeof(n_p_203574),
                                                            &n_p_203574));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218721,
                                                            4,
                                                            sizeof(partition_sizze_203667),
                                                            &partition_sizze_203667));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218721,
                                                            5,
                                                            sizeof(C_len_203724),
                                                            &C_len_203724));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218721,
                                                            6,
                                                            sizeof(num_groups_218716),
                                                            &num_groups_218716));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218721,
                                                            7,
                                                            sizeof(groups_per_segment_234238),
                                                            &groups_per_segment_234238));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218721,
                                                            8,
                                                            sizeof(elements_per_thread_234239),
                                                            &elements_per_thread_234239));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218721,
                                                            9,
                                                            sizeof(virt_num_groups_234240),
                                                            &virt_num_groups_234240));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218721,
                                                            10,
                                                            sizeof(threads_per_segment_234242),
                                                            &threads_per_segment_234242));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218721,
                                                            11,
                                                            sizeof(mem_230608.mem),
                                                            &mem_230608.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218721,
                                                            12,
                                                            sizeof(mem_230619.mem),
                                                            &mem_230619.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218721,
                                                            13,
                                                            sizeof(segred_tmp_mem_234243.mem),
                                                            &segred_tmp_mem_234243.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218721,
                                                            14,
                                                            sizeof(mainzicounter_mem_234245.mem),
                                                            &mainzicounter_mem_234245.mem));
                    if (1 * ((size_t) num_groups_218716 *
                             (size_t) segred_group_sizze_218715) != 0) {
                        const size_t global_work_sizze_237208[1] =
                                     {(size_t) num_groups_218716 *
                                     (size_t) segred_group_sizze_218715};
                        const size_t local_work_sizze_237212[1] =
                                     {(size_t) segred_group_sizze_218715};
                        int64_t time_start_237209 = 0, time_end_237210 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.segred_large_218721",
                                    global_work_sizze_237208[0],
                                    local_work_sizze_237212[0], (int) (0 + 1 +
                                                                       (int64_t) 8 *
                                                                       segred_group_sizze_218715));
                            time_start_237209 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegred_large_218721,
                                                                        1, NULL,
                                                                        global_work_sizze_237208,
                                                                        local_work_sizze_237212,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegred_large_218721_runs,
                                                                                                                  &ctx->mainzisegred_large_218721_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_237210 = get_wall_time();
                            
                            long time_diff_237211 = time_end_237210 -
                                 time_start_237209;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segred_large_218721",
                                    time_diff_237211);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &segred_tmp_mem_234243,
                                              "segred_tmp_mem_234243") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_230620, &mem_230619,
                                        "mem_230619") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230619, "mem_230619") != 0)
                    return 1;
            }
            if (slt64((int64_t) 0, partition_sizze_203667 *
                      lifted_single_ma_l_arg_204224)) {
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegScan");
                
                int64_t stage1_max_num_groups_234280;
                
                stage1_max_num_groups_234280 = ctx->opencl.max_group_size;
                
                int64_t stage1_num_groups_234281 =
                        smin64(stage1_max_num_groups_234280, num_groups_218768);
                int32_t num_threads_234282 =
                        sext_i64_i32(stage1_num_groups_234281 *
                        segscan_group_sizze_218767);
                
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218773,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218773,
                                                        3,
                                                        (size_t) smax64((int64_t) 1,
                                                                        (int64_t) 8 *
                                                                        segscan_group_sizze_218767),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218773,
                                                        4, sizeof(n_p_203574),
                                                        &n_p_203574));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218773,
                                                        5,
                                                        sizeof(i64_res_203589),
                                                        &i64_res_203589));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218773,
                                                        6,
                                                        sizeof(partition_sizze_203667),
                                                        &partition_sizze_203667));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218773,
                                                        7, sizeof(C_len_203724),
                                                        &C_len_203724));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218773,
                                                        8,
                                                        sizeof(lifted_single_ma_l_arg_204224),
                                                        &lifted_single_ma_l_arg_204224));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218773,
                                                        9,
                                                        sizeof(num_threads_234282),
                                                        &num_threads_234282));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218773,
                                                        10,
                                                        sizeof(mem_230608.mem),
                                                        &mem_230608.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218773,
                                                        11,
                                                        sizeof(ext_mem_230620.mem),
                                                        &ext_mem_230620.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218773,
                                                        12,
                                                        sizeof(mem_230625.mem),
                                                        &mem_230625.mem));
                if (1 * ((size_t) stage1_num_groups_234281 *
                         (size_t) segscan_group_sizze_218767) != 0) {
                    const size_t global_work_sizze_237213[1] =
                                 {(size_t) stage1_num_groups_234281 *
                                 (size_t) segscan_group_sizze_218767};
                    const size_t local_work_sizze_237217[1] =
                                 {(size_t) segscan_group_sizze_218767};
                    int64_t time_start_237214 = 0, time_end_237215 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.scan_stage1_218773",
                                global_work_sizze_237213[0],
                                local_work_sizze_237217[0], (int) (0 +
                                                                   smax64((int64_t) 1,
                                                                          (int64_t) 8 *
                                                                          segscan_group_sizze_218767)));
                        time_start_237214 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainziscan_stage1_218773,
                                                                    1, NULL,
                                                                    global_work_sizze_237213,
                                                                    local_work_sizze_237217,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainziscan_stage1_218773_runs,
                                                                                                              &ctx->mainziscan_stage1_218773_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237215 = get_wall_time();
                        
                        long time_diff_237216 = time_end_237215 -
                             time_start_237214;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.scan_stage1_218773", time_diff_237216);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c", "elems_per_group",
                            (long long) (segscan_group_sizze_218767 *
                                         sdiv_up64(partition_sizze_203667 *
                                                   lifted_single_ma_l_arg_204224,
                                                   sext_i32_i64(num_threads_234282))),
                            '\n');
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218773,
                                                        1,
                                                        (size_t) smax64((int64_t) 1,
                                                                        (int64_t) 8 *
                                                                        stage1_num_groups_234281),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218773,
                                                        2,
                                                        sizeof(partition_sizze_203667),
                                                        &partition_sizze_203667));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218773,
                                                        3,
                                                        sizeof(lifted_single_ma_l_arg_204224),
                                                        &lifted_single_ma_l_arg_204224));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218773,
                                                        4,
                                                        sizeof(stage1_num_groups_234281),
                                                        &stage1_num_groups_234281));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218773,
                                                        5,
                                                        sizeof(num_threads_234282),
                                                        &num_threads_234282));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218773,
                                                        6,
                                                        sizeof(mem_230625.mem),
                                                        &mem_230625.mem));
                if (1 * ((size_t) (int64_t) 1 *
                         (size_t) stage1_num_groups_234281) != 0) {
                    const size_t global_work_sizze_237218[1] =
                                 {(size_t) (int64_t) 1 *
                                 (size_t) stage1_num_groups_234281};
                    const size_t local_work_sizze_237222[1] =
                                 {(size_t) stage1_num_groups_234281};
                    int64_t time_start_237219 = 0, time_end_237220 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.scan_stage2_218773",
                                global_work_sizze_237218[0],
                                local_work_sizze_237222[0], (int) (0 +
                                                                   smax64((int64_t) 1,
                                                                          (int64_t) 8 *
                                                                          stage1_num_groups_234281)));
                        time_start_237219 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainziscan_stage2_218773,
                                                                    1, NULL,
                                                                    global_work_sizze_237218,
                                                                    local_work_sizze_237222,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainziscan_stage2_218773_runs,
                                                                                                              &ctx->mainziscan_stage2_218773_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237220 = get_wall_time();
                        
                        long time_diff_237221 = time_end_237220 -
                             time_start_237219;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.scan_stage2_218773", time_diff_237221);
                    }
                }
                
                int32_t required_groups_234333 =
                        sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                               lifted_single_ma_l_arg_204224,
                                               segscan_group_sizze_218767));
                
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218773,
                                                        1,
                                                        sizeof(partition_sizze_203667),
                                                        &partition_sizze_203667));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218773,
                                                        2,
                                                        sizeof(lifted_single_ma_l_arg_204224),
                                                        &lifted_single_ma_l_arg_204224));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218773,
                                                        3,
                                                        sizeof(num_groups_218768),
                                                        &num_groups_218768));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218773,
                                                        4,
                                                        sizeof(num_threads_234282),
                                                        &num_threads_234282));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218773,
                                                        5,
                                                        sizeof(required_groups_234333),
                                                        &required_groups_234333));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218773,
                                                        6,
                                                        sizeof(mem_230625.mem),
                                                        &mem_230625.mem));
                if (1 * ((size_t) num_groups_218768 *
                         (size_t) segscan_group_sizze_218767) != 0) {
                    const size_t global_work_sizze_237223[1] =
                                 {(size_t) num_groups_218768 *
                                 (size_t) segscan_group_sizze_218767};
                    const size_t local_work_sizze_237227[1] =
                                 {(size_t) segscan_group_sizze_218767};
                    int64_t time_start_237224 = 0, time_end_237225 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.scan_stage3_218773",
                                global_work_sizze_237223[0],
                                local_work_sizze_237227[0], (int) 0);
                        time_start_237224 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainziscan_stage3_218773,
                                                                    1, NULL,
                                                                    global_work_sizze_237223,
                                                                    local_work_sizze_237227,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainziscan_stage3_218773_runs,
                                                                                                              &ctx->mainziscan_stage3_218773_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237225 = get_wall_time();
                        
                        long time_diff_237226 = time_end_237225 -
                             time_start_237224;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.scan_stage3_218773", time_diff_237226);
                    }
                }
            }
            if (memblock_unref_device(ctx, &ext_mem_230620, "ext_mem_230620") !=
                0)
                return 1;
            
            struct memblock_device ext_mem_230637;
            
            ext_mem_230637.references = NULL;
            
            int32_t local_memory_capacity_234422;
            
            local_memory_capacity_234422 = ctx->opencl.max_local_memory;
            if (sle64((int64_t) 0,
                      sext_i32_i64(local_memory_capacity_234422)) &&
                suff_outer_par_218799) {
                struct memblock_device mem_230628;
                
                mem_230628.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230628, binop_y_230623,
                                          "mem_230628")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_230628,
                                                          (int64_t) 0,
                                                          mem_230625,
                                                          (int64_t) 0,
                                                          (int64_t) 1,
                                                          lifted_single_ma_l_arg_204224,
                                                          partition_sizze_203667) !=
                    0) {
                    if (memblock_unref_device(ctx, &mem_230628, "mem_230628") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230637,
                                              "ext_mem_230637") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230620,
                                              "ext_mem_230620") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230602,
                                              "ext_mem_230602") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230594,
                                              "ext_mem_230594") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230595,
                                              "ext_mem_230595") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229623,
                                              "mem_param_229623") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229615,
                                              "mem_param_229615") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231625,
                                              "ext_mem_231625") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231626,
                                              "ext_mem_231626") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229601,
                                              "mem_param_229601") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229593,
                                              "mem_param_229593") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229585,
                                              "mem_param_229585") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231968,
                                              "ext_mem_231968") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231969,
                                              "ext_mem_231969") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231970,
                                              "ext_mem_231970") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230659, "mem_230659") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230642, "mem_230642") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230625, "mem_230625") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230608, "mem_230608") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229639, "mem_229639") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229634, "mem_229634") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229628, "mem_229628") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229577, "mem_229577") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229573, "mem_229573") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229568,
                                              "ext_mem_229568") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229569,
                                              "ext_mem_229569") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229519,
                                              "ext_mem_229519") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229520,
                                              "ext_mem_229520") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229470,
                                              "ext_mem_229470") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229471,
                                              "ext_mem_229471") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229372,
                                              "ext_mem_229372") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229373,
                                              "ext_mem_229373") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229304,
                                              "ext_mem_229304") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229305,
                                              "ext_mem_229305") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232074,
                                              "color_232074") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232361,
                                              "mem_out_232361") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232360,
                                              "mem_out_232360") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232359,
                                              "mem_out_232359") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_230632;
                
                mem_230632.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230632, bytes_229288,
                                          "mem_230632")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218819,
                                                        1, sizeof(n_p_203574),
                                                        &n_p_203574));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218819,
                                                        2,
                                                        sizeof(partition_sizze_203667),
                                                        &partition_sizze_203667));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218819,
                                                        3,
                                                        sizeof(mem_230628.mem),
                                                        &mem_230628.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218819,
                                                        4,
                                                        sizeof(mem_230632.mem),
                                                        &mem_230632.mem));
                if (1 * ((size_t) segmap_usable_groups_218816 *
                         (size_t) segmap_group_sizze_218815) != 0) {
                    const size_t global_work_sizze_237228[1] =
                                 {(size_t) segmap_usable_groups_218816 *
                                 (size_t) segmap_group_sizze_218815};
                    const size_t local_work_sizze_237232[1] =
                                 {(size_t) segmap_group_sizze_218815};
                    int64_t time_start_237229 = 0, time_end_237230 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.segmap_218819",
                                global_work_sizze_237228[0],
                                local_work_sizze_237232[0], (int) 0);
                        time_start_237229 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_218819,
                                                                    1, NULL,
                                                                    global_work_sizze_237228,
                                                                    local_work_sizze_237232,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_218819_runs,
                                                                                                              &ctx->mainzisegmap_218819_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237230 = get_wall_time();
                        
                        long time_diff_237231 = time_end_237230 -
                             time_start_237229;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_218819", time_diff_237231);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_230628, "mem_230628") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_230637, &mem_230632,
                                        "mem_230632") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230632, "mem_230632") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230628, "mem_230628") != 0)
                    return 1;
            } else {
                struct memblock_device mem_230636;
                
                mem_230636.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230636, bytes_229288,
                                          "mem_230636")) {
                    err = 1;
                    goto cleanup;
                }
                if (slt64(n_p_203574 * (int64_t) 2,
                          segred_group_sizze_218846)) {
                    int64_t segment_sizze_nonzzero_234354 = smax64((int64_t) 1,
                                                                   n_p_203574);
                    int64_t num_threads_234355 = num_groups_218847 *
                            segred_group_sizze_218846;
                    
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegRed-small");
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                (long long) partition_sizze_203667, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) n_p_203574, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segments_per_group",
                                (long long) squot64(segred_group_sizze_218846,
                                                    segment_sizze_nonzzero_234354),
                                '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "required_groups",
                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667,
                                                                   squot64(segred_group_sizze_218846,
                                                                           segment_sizze_nonzzero_234354))),
                                '\n');
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218852,
                                                            1,
                                                            (size_t) ((int64_t) 8 *
                                                                      segred_group_sizze_218846),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218852,
                                                            2,
                                                            sizeof(n_p_203574),
                                                            &n_p_203574));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218852,
                                                            3,
                                                            sizeof(partition_sizze_203667),
                                                            &partition_sizze_203667));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218852,
                                                            4,
                                                            sizeof(lifted_single_ma_l_arg_204224),
                                                            &lifted_single_ma_l_arg_204224));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218852,
                                                            5,
                                                            sizeof(num_groups_218847),
                                                            &num_groups_218847));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218852,
                                                            6,
                                                            sizeof(segment_sizze_nonzzero_234354),
                                                            &segment_sizze_nonzzero_234354));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218852,
                                                            7,
                                                            sizeof(mem_230625.mem),
                                                            &mem_230625.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218852,
                                                            8,
                                                            sizeof(mem_230636.mem),
                                                            &mem_230636.mem));
                    if (1 * ((size_t) num_groups_218847 *
                             (size_t) segred_group_sizze_218846) != 0) {
                        const size_t global_work_sizze_237233[1] =
                                     {(size_t) num_groups_218847 *
                                     (size_t) segred_group_sizze_218846};
                        const size_t local_work_sizze_237237[1] =
                                     {(size_t) segred_group_sizze_218846};
                        int64_t time_start_237234 = 0, time_end_237235 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.segred_small_218852",
                                    global_work_sizze_237233[0],
                                    local_work_sizze_237237[0], (int) (0 +
                                                                       (int64_t) 8 *
                                                                       segred_group_sizze_218846));
                            time_start_237234 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegred_small_218852,
                                                                        1, NULL,
                                                                        global_work_sizze_237233,
                                                                        local_work_sizze_237237,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegred_small_218852_runs,
                                                                                                                  &ctx->mainzisegred_small_218852_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_237235 = get_wall_time();
                            
                            long time_diff_237236 = time_end_237235 -
                                 time_start_237234;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segred_small_218852",
                                    time_diff_237236);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                } else {
                    int64_t groups_per_segment_234381 =
                            sdiv_up64(num_groups_218847, smax64((int64_t) 1,
                                                                partition_sizze_203667));
                    int64_t elements_per_thread_234382 = sdiv_up64(n_p_203574,
                                                                   segred_group_sizze_218846 *
                                                                   groups_per_segment_234381);
                    int64_t virt_num_groups_234383 = groups_per_segment_234381 *
                            partition_sizze_203667;
                    int64_t num_threads_234384 = num_groups_218847 *
                            segred_group_sizze_218846;
                    int64_t threads_per_segment_234385 =
                            groups_per_segment_234381 *
                            segred_group_sizze_218846;
                    
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegRed-large");
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                (long long) partition_sizze_203667, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) n_p_203574, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "virt_num_groups",
                                (long long) virt_num_groups_234383, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                (long long) num_groups_218847, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "group_size",
                                (long long) segred_group_sizze_218846, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "elems_per_thread",
                                (long long) elements_per_thread_234382, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "groups_per_segment",
                                (long long) groups_per_segment_234381, '\n');
                    
                    struct memblock_device segred_tmp_mem_234386;
                    
                    segred_tmp_mem_234386.references = NULL;
                    if (memblock_alloc_device(ctx, &segred_tmp_mem_234386,
                                              (int64_t) 8 *
                                              virt_num_groups_234383,
                                              "segred_tmp_mem_234386")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mainzicounter_mem_234388 =
                                           ctx->mainzicounter_mem_234388;
                    
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218852,
                                                            1, (size_t) 1,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218852,
                                                            2,
                                                            (size_t) ((int64_t) 8 *
                                                                      segred_group_sizze_218846),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218852,
                                                            3,
                                                            sizeof(n_p_203574),
                                                            &n_p_203574));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218852,
                                                            4,
                                                            sizeof(partition_sizze_203667),
                                                            &partition_sizze_203667));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218852,
                                                            5,
                                                            sizeof(lifted_single_ma_l_arg_204224),
                                                            &lifted_single_ma_l_arg_204224));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218852,
                                                            6,
                                                            sizeof(num_groups_218847),
                                                            &num_groups_218847));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218852,
                                                            7,
                                                            sizeof(groups_per_segment_234381),
                                                            &groups_per_segment_234381));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218852,
                                                            8,
                                                            sizeof(elements_per_thread_234382),
                                                            &elements_per_thread_234382));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218852,
                                                            9,
                                                            sizeof(virt_num_groups_234383),
                                                            &virt_num_groups_234383));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218852,
                                                            10,
                                                            sizeof(threads_per_segment_234385),
                                                            &threads_per_segment_234385));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218852,
                                                            11,
                                                            sizeof(mem_230625.mem),
                                                            &mem_230625.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218852,
                                                            12,
                                                            sizeof(mem_230636.mem),
                                                            &mem_230636.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218852,
                                                            13,
                                                            sizeof(segred_tmp_mem_234386.mem),
                                                            &segred_tmp_mem_234386.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218852,
                                                            14,
                                                            sizeof(mainzicounter_mem_234388.mem),
                                                            &mainzicounter_mem_234388.mem));
                    if (1 * ((size_t) num_groups_218847 *
                             (size_t) segred_group_sizze_218846) != 0) {
                        const size_t global_work_sizze_237239[1] =
                                     {(size_t) num_groups_218847 *
                                     (size_t) segred_group_sizze_218846};
                        const size_t local_work_sizze_237243[1] =
                                     {(size_t) segred_group_sizze_218846};
                        int64_t time_start_237240 = 0, time_end_237241 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.segred_large_218852",
                                    global_work_sizze_237239[0],
                                    local_work_sizze_237243[0], (int) (0 + 1 +
                                                                       (int64_t) 8 *
                                                                       segred_group_sizze_218846));
                            time_start_237240 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegred_large_218852,
                                                                        1, NULL,
                                                                        global_work_sizze_237239,
                                                                        local_work_sizze_237243,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegred_large_218852_runs,
                                                                                                                  &ctx->mainzisegred_large_218852_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_237241 = get_wall_time();
                            
                            long time_diff_237242 = time_end_237241 -
                                 time_start_237240;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segred_large_218852",
                                    time_diff_237242);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &segred_tmp_mem_234386,
                                              "segred_tmp_mem_234386") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_230637, &mem_230636,
                                        "mem_230636") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230636, "mem_230636") != 0)
                    return 1;
            }
            if (slt64((int64_t) 0, partition_sizze_203667 *
                      dyn_lifted_single_ma_l_arg_204234)) {
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegScan");
                
                int64_t stage1_max_num_groups_234423;
                
                stage1_max_num_groups_234423 = ctx->opencl.max_group_size;
                
                int64_t stage1_num_groups_234424 =
                        smin64(stage1_max_num_groups_234423, num_groups_218899);
                int32_t num_threads_234425 =
                        sext_i64_i32(stage1_num_groups_234424 *
                        segscan_group_sizze_218898);
                
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218904,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218904,
                                                        3,
                                                        (size_t) smax64((int64_t) 1,
                                                                        (int64_t) 8 *
                                                                        segscan_group_sizze_218898),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218904,
                                                        4, sizeof(n_p_203574),
                                                        &n_p_203574));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218904,
                                                        5,
                                                        sizeof(i64_res_203589),
                                                        &i64_res_203589));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218904,
                                                        6,
                                                        sizeof(partition_sizze_203667),
                                                        &partition_sizze_203667));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218904,
                                                        7,
                                                        sizeof(lifted_single_ma_l_arg_204224),
                                                        &lifted_single_ma_l_arg_204224));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218904,
                                                        8,
                                                        sizeof(dyn_lifted_single_ma_l_arg_204234),
                                                        &dyn_lifted_single_ma_l_arg_204234));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218904,
                                                        9,
                                                        sizeof(num_threads_234425),
                                                        &num_threads_234425));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218904,
                                                        10,
                                                        sizeof(mem_230625.mem),
                                                        &mem_230625.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218904,
                                                        11,
                                                        sizeof(ext_mem_230637.mem),
                                                        &ext_mem_230637.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218904,
                                                        12,
                                                        sizeof(mem_230642.mem),
                                                        &mem_230642.mem));
                if (1 * ((size_t) stage1_num_groups_234424 *
                         (size_t) segscan_group_sizze_218898) != 0) {
                    const size_t global_work_sizze_237244[1] =
                                 {(size_t) stage1_num_groups_234424 *
                                 (size_t) segscan_group_sizze_218898};
                    const size_t local_work_sizze_237248[1] =
                                 {(size_t) segscan_group_sizze_218898};
                    int64_t time_start_237245 = 0, time_end_237246 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.scan_stage1_218904",
                                global_work_sizze_237244[0],
                                local_work_sizze_237248[0], (int) (0 +
                                                                   smax64((int64_t) 1,
                                                                          (int64_t) 8 *
                                                                          segscan_group_sizze_218898)));
                        time_start_237245 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainziscan_stage1_218904,
                                                                    1, NULL,
                                                                    global_work_sizze_237244,
                                                                    local_work_sizze_237248,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainziscan_stage1_218904_runs,
                                                                                                              &ctx->mainziscan_stage1_218904_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237246 = get_wall_time();
                        
                        long time_diff_237247 = time_end_237246 -
                             time_start_237245;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.scan_stage1_218904", time_diff_237247);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c", "elems_per_group",
                            (long long) (segscan_group_sizze_218898 *
                                         sdiv_up64(partition_sizze_203667 *
                                                   dyn_lifted_single_ma_l_arg_204234,
                                                   sext_i32_i64(num_threads_234425))),
                            '\n');
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218904,
                                                        1,
                                                        (size_t) smax64((int64_t) 1,
                                                                        (int64_t) 8 *
                                                                        stage1_num_groups_234424),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218904,
                                                        2,
                                                        sizeof(partition_sizze_203667),
                                                        &partition_sizze_203667));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218904,
                                                        3,
                                                        sizeof(dyn_lifted_single_ma_l_arg_204234),
                                                        &dyn_lifted_single_ma_l_arg_204234));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218904,
                                                        4,
                                                        sizeof(stage1_num_groups_234424),
                                                        &stage1_num_groups_234424));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218904,
                                                        5,
                                                        sizeof(num_threads_234425),
                                                        &num_threads_234425));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218904,
                                                        6,
                                                        sizeof(mem_230642.mem),
                                                        &mem_230642.mem));
                if (1 * ((size_t) (int64_t) 1 *
                         (size_t) stage1_num_groups_234424) != 0) {
                    const size_t global_work_sizze_237249[1] =
                                 {(size_t) (int64_t) 1 *
                                 (size_t) stage1_num_groups_234424};
                    const size_t local_work_sizze_237253[1] =
                                 {(size_t) stage1_num_groups_234424};
                    int64_t time_start_237250 = 0, time_end_237251 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.scan_stage2_218904",
                                global_work_sizze_237249[0],
                                local_work_sizze_237253[0], (int) (0 +
                                                                   smax64((int64_t) 1,
                                                                          (int64_t) 8 *
                                                                          stage1_num_groups_234424)));
                        time_start_237250 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainziscan_stage2_218904,
                                                                    1, NULL,
                                                                    global_work_sizze_237249,
                                                                    local_work_sizze_237253,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainziscan_stage2_218904_runs,
                                                                                                              &ctx->mainziscan_stage2_218904_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237251 = get_wall_time();
                        
                        long time_diff_237252 = time_end_237251 -
                             time_start_237250;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.scan_stage2_218904", time_diff_237252);
                    }
                }
                
                int32_t required_groups_234476 =
                        sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                               dyn_lifted_single_ma_l_arg_204234,
                                               segscan_group_sizze_218898));
                
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218904,
                                                        1,
                                                        sizeof(partition_sizze_203667),
                                                        &partition_sizze_203667));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218904,
                                                        2,
                                                        sizeof(dyn_lifted_single_ma_l_arg_204234),
                                                        &dyn_lifted_single_ma_l_arg_204234));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218904,
                                                        3,
                                                        sizeof(num_groups_218899),
                                                        &num_groups_218899));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218904,
                                                        4,
                                                        sizeof(num_threads_234425),
                                                        &num_threads_234425));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218904,
                                                        5,
                                                        sizeof(required_groups_234476),
                                                        &required_groups_234476));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218904,
                                                        6,
                                                        sizeof(mem_230642.mem),
                                                        &mem_230642.mem));
                if (1 * ((size_t) num_groups_218899 *
                         (size_t) segscan_group_sizze_218898) != 0) {
                    const size_t global_work_sizze_237254[1] =
                                 {(size_t) num_groups_218899 *
                                 (size_t) segscan_group_sizze_218898};
                    const size_t local_work_sizze_237258[1] =
                                 {(size_t) segscan_group_sizze_218898};
                    int64_t time_start_237255 = 0, time_end_237256 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.scan_stage3_218904",
                                global_work_sizze_237254[0],
                                local_work_sizze_237258[0], (int) 0);
                        time_start_237255 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainziscan_stage3_218904,
                                                                    1, NULL,
                                                                    global_work_sizze_237254,
                                                                    local_work_sizze_237258,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainziscan_stage3_218904_runs,
                                                                                                              &ctx->mainziscan_stage3_218904_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237256 = get_wall_time();
                        
                        long time_diff_237257 = time_end_237256 -
                             time_start_237255;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.scan_stage3_218904", time_diff_237257);
                    }
                }
            }
            if (memblock_unref_device(ctx, &ext_mem_230637, "ext_mem_230637") !=
                0)
                return 1;
            
            struct memblock_device ext_mem_230654;
            
            ext_mem_230654.references = NULL;
            
            int32_t local_memory_capacity_234565;
            
            local_memory_capacity_234565 = ctx->opencl.max_local_memory;
            if (sle64((int64_t) 0,
                      sext_i32_i64(local_memory_capacity_234565)) &&
                suff_outer_par_218930) {
                struct memblock_device mem_230645;
                
                mem_230645.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230645, binop_y_230640,
                                          "mem_230645")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_230645,
                                                          (int64_t) 0,
                                                          mem_230642,
                                                          (int64_t) 0,
                                                          (int64_t) 1,
                                                          dyn_lifted_single_ma_l_arg_204234,
                                                          partition_sizze_203667) !=
                    0) {
                    if (memblock_unref_device(ctx, &mem_230645, "mem_230645") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230654,
                                              "ext_mem_230654") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230637,
                                              "ext_mem_230637") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230620,
                                              "ext_mem_230620") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230602,
                                              "ext_mem_230602") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230594,
                                              "ext_mem_230594") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230595,
                                              "ext_mem_230595") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229623,
                                              "mem_param_229623") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229615,
                                              "mem_param_229615") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231625,
                                              "ext_mem_231625") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231626,
                                              "ext_mem_231626") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229601,
                                              "mem_param_229601") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229593,
                                              "mem_param_229593") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229585,
                                              "mem_param_229585") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231968,
                                              "ext_mem_231968") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231969,
                                              "ext_mem_231969") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231970,
                                              "ext_mem_231970") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230659, "mem_230659") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230642, "mem_230642") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230625, "mem_230625") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230608, "mem_230608") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229639, "mem_229639") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229634, "mem_229634") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229628, "mem_229628") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229577, "mem_229577") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229573, "mem_229573") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229568,
                                              "ext_mem_229568") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229569,
                                              "ext_mem_229569") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229519,
                                              "ext_mem_229519") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229520,
                                              "ext_mem_229520") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229470,
                                              "ext_mem_229470") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229471,
                                              "ext_mem_229471") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229372,
                                              "ext_mem_229372") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229373,
                                              "ext_mem_229373") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229304,
                                              "ext_mem_229304") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229305,
                                              "ext_mem_229305") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232074,
                                              "color_232074") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232361,
                                              "mem_out_232361") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232360,
                                              "mem_out_232360") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232359,
                                              "mem_out_232359") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_230649;
                
                mem_230649.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230649, bytes_229288,
                                          "mem_230649")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218950,
                                                        1,
                                                        sizeof(partition_sizze_203667),
                                                        &partition_sizze_203667));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218950,
                                                        2,
                                                        sizeof(mem_230645.mem),
                                                        &mem_230645.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218950,
                                                        3,
                                                        sizeof(mem_230649.mem),
                                                        &mem_230649.mem));
                if (1 * ((size_t) segmap_usable_groups_218947 *
                         (size_t) segmap_group_sizze_218946) != 0) {
                    const size_t global_work_sizze_237259[1] =
                                 {(size_t) segmap_usable_groups_218947 *
                                 (size_t) segmap_group_sizze_218946};
                    const size_t local_work_sizze_237263[1] =
                                 {(size_t) segmap_group_sizze_218946};
                    int64_t time_start_237260 = 0, time_end_237261 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.segmap_218950",
                                global_work_sizze_237259[0],
                                local_work_sizze_237263[0], (int) 0);
                        time_start_237260 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_218950,
                                                                    1, NULL,
                                                                    global_work_sizze_237259,
                                                                    local_work_sizze_237263,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_218950_runs,
                                                                                                              &ctx->mainzisegmap_218950_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237261 = get_wall_time();
                        
                        long time_diff_237262 = time_end_237261 -
                             time_start_237260;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_218950", time_diff_237262);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_230645, "mem_230645") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_230654, &mem_230649,
                                        "mem_230649") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230649, "mem_230649") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230645, "mem_230645") != 0)
                    return 1;
            } else {
                struct memblock_device mem_230653;
                
                mem_230653.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230653, bytes_229288,
                                          "mem_230653")) {
                    err = 1;
                    goto cleanup;
                }
                if (slt64((int64_t) 6, segred_group_sizze_218977)) {
                    int64_t segment_sizze_nonzzero_234497 = smax64((int64_t) 1,
                                                                   (int64_t) 3);
                    int64_t num_threads_234498 = num_groups_218978 *
                            segred_group_sizze_218977;
                    
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegRed-small");
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                (long long) partition_sizze_203667, '\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_218977,
                                                    segment_sizze_nonzzero_234497),
                                '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "required_groups",
                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667,
                                                                   squot64(segred_group_sizze_218977,
                                                                           segment_sizze_nonzzero_234497))),
                                '\n');
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218983,
                                                            1,
                                                            (size_t) ((int64_t) 8 *
                                                                      segred_group_sizze_218977),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218983,
                                                            2,
                                                            sizeof(partition_sizze_203667),
                                                            &partition_sizze_203667));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218983,
                                                            3,
                                                            sizeof(dyn_lifted_single_ma_l_arg_204234),
                                                            &dyn_lifted_single_ma_l_arg_204234));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218983,
                                                            4,
                                                            sizeof(num_groups_218978),
                                                            &num_groups_218978));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218983,
                                                            5,
                                                            sizeof(segment_sizze_nonzzero_234497),
                                                            &segment_sizze_nonzzero_234497));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218983,
                                                            6,
                                                            sizeof(mem_230642.mem),
                                                            &mem_230642.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218983,
                                                            7,
                                                            sizeof(mem_230653.mem),
                                                            &mem_230653.mem));
                    if (1 * ((size_t) num_groups_218978 *
                             (size_t) segred_group_sizze_218977) != 0) {
                        const size_t global_work_sizze_237264[1] =
                                     {(size_t) num_groups_218978 *
                                     (size_t) segred_group_sizze_218977};
                        const size_t local_work_sizze_237268[1] =
                                     {(size_t) segred_group_sizze_218977};
                        int64_t time_start_237265 = 0, time_end_237266 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.segred_small_218983",
                                    global_work_sizze_237264[0],
                                    local_work_sizze_237268[0], (int) (0 +
                                                                       (int64_t) 8 *
                                                                       segred_group_sizze_218977));
                            time_start_237265 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegred_small_218983,
                                                                        1, NULL,
                                                                        global_work_sizze_237264,
                                                                        local_work_sizze_237268,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegred_small_218983_runs,
                                                                                                                  &ctx->mainzisegred_small_218983_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_237266 = get_wall_time();
                            
                            long time_diff_237267 = time_end_237266 -
                                 time_start_237265;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segred_small_218983",
                                    time_diff_237267);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                } else {
                    int64_t groups_per_segment_234524 =
                            sdiv_up64(num_groups_218978, smax64((int64_t) 1,
                                                                partition_sizze_203667));
                    int64_t elements_per_thread_234525 = sdiv_up64((int64_t) 3,
                                                                   segred_group_sizze_218977 *
                                                                   groups_per_segment_234524);
                    int64_t virt_num_groups_234526 = groups_per_segment_234524 *
                            partition_sizze_203667;
                    int64_t num_threads_234527 = num_groups_218978 *
                            segred_group_sizze_218977;
                    int64_t threads_per_segment_234528 =
                            groups_per_segment_234524 *
                            segred_group_sizze_218977;
                    
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegRed-large");
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                (long long) partition_sizze_203667, '\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_234526, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                (long long) num_groups_218978, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "group_size",
                                (long long) segred_group_sizze_218977, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "elems_per_thread",
                                (long long) elements_per_thread_234525, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "groups_per_segment",
                                (long long) groups_per_segment_234524, '\n');
                    
                    struct memblock_device segred_tmp_mem_234529;
                    
                    segred_tmp_mem_234529.references = NULL;
                    if (memblock_alloc_device(ctx, &segred_tmp_mem_234529,
                                              (int64_t) 8 *
                                              virt_num_groups_234526,
                                              "segred_tmp_mem_234529")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mainzicounter_mem_234531 =
                                           ctx->mainzicounter_mem_234531;
                    
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218983,
                                                            1, (size_t) 1,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218983,
                                                            2,
                                                            (size_t) ((int64_t) 8 *
                                                                      segred_group_sizze_218977),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218983,
                                                            3,
                                                            sizeof(partition_sizze_203667),
                                                            &partition_sizze_203667));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218983,
                                                            4,
                                                            sizeof(dyn_lifted_single_ma_l_arg_204234),
                                                            &dyn_lifted_single_ma_l_arg_204234));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218983,
                                                            5,
                                                            sizeof(num_groups_218978),
                                                            &num_groups_218978));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218983,
                                                            6,
                                                            sizeof(groups_per_segment_234524),
                                                            &groups_per_segment_234524));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218983,
                                                            7,
                                                            sizeof(elements_per_thread_234525),
                                                            &elements_per_thread_234525));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218983,
                                                            8,
                                                            sizeof(virt_num_groups_234526),
                                                            &virt_num_groups_234526));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218983,
                                                            9,
                                                            sizeof(threads_per_segment_234528),
                                                            &threads_per_segment_234528));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218983,
                                                            10,
                                                            sizeof(mem_230642.mem),
                                                            &mem_230642.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218983,
                                                            11,
                                                            sizeof(mem_230653.mem),
                                                            &mem_230653.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218983,
                                                            12,
                                                            sizeof(segred_tmp_mem_234529.mem),
                                                            &segred_tmp_mem_234529.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218983,
                                                            13,
                                                            sizeof(mainzicounter_mem_234531.mem),
                                                            &mainzicounter_mem_234531.mem));
                    if (1 * ((size_t) num_groups_218978 *
                             (size_t) segred_group_sizze_218977) != 0) {
                        const size_t global_work_sizze_237270[1] =
                                     {(size_t) num_groups_218978 *
                                     (size_t) segred_group_sizze_218977};
                        const size_t local_work_sizze_237274[1] =
                                     {(size_t) segred_group_sizze_218977};
                        int64_t time_start_237271 = 0, time_end_237272 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.segred_large_218983",
                                    global_work_sizze_237270[0],
                                    local_work_sizze_237274[0], (int) (0 + 1 +
                                                                       (int64_t) 8 *
                                                                       segred_group_sizze_218977));
                            time_start_237271 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegred_large_218983,
                                                                        1, NULL,
                                                                        global_work_sizze_237270,
                                                                        local_work_sizze_237274,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegred_large_218983_runs,
                                                                                                                  &ctx->mainzisegred_large_218983_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_237272 = get_wall_time();
                            
                            long time_diff_237273 = time_end_237272 -
                                 time_start_237271;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segred_large_218983",
                                    time_diff_237273);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &segred_tmp_mem_234529,
                                              "segred_tmp_mem_234529") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_230654, &mem_230653,
                                        "mem_230653") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230653, "mem_230653") != 0)
                    return 1;
            }
            if (slt64((int64_t) 0, partition_sizze_203667 * n_203572)) {
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegScan");
                
                int64_t stage1_max_num_groups_234566;
                
                stage1_max_num_groups_234566 = ctx->opencl.max_group_size;
                
                int64_t stage1_num_groups_234567 =
                        smin64(stage1_max_num_groups_234566, num_groups_219030);
                int32_t num_threads_234568 =
                        sext_i64_i32(stage1_num_groups_234567 *
                        segscan_group_sizze_219029);
                
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_219035,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_219035,
                                                        3,
                                                        (size_t) smax64((int64_t) 1,
                                                                        (int64_t) 8 *
                                                                        segscan_group_sizze_219029),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_219035,
                                                        4, sizeof(n_203572),
                                                        &n_203572));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_219035,
                                                        5,
                                                        sizeof(partition_sizze_203667),
                                                        &partition_sizze_203667));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_219035,
                                                        6,
                                                        sizeof(dyn_lifted_single_ma_l_arg_204234),
                                                        &dyn_lifted_single_ma_l_arg_204234));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_219035,
                                                        7,
                                                        sizeof(num_threads_234568),
                                                        &num_threads_234568));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_219035,
                                                        8,
                                                        sizeof(mem_230642.mem),
                                                        &mem_230642.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_219035,
                                                        9,
                                                        sizeof(ext_mem_230654.mem),
                                                        &ext_mem_230654.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_219035,
                                                        10,
                                                        sizeof(mem_230659.mem),
                                                        &mem_230659.mem));
                if (1 * ((size_t) stage1_num_groups_234567 *
                         (size_t) segscan_group_sizze_219029) != 0) {
                    const size_t global_work_sizze_237275[1] =
                                 {(size_t) stage1_num_groups_234567 *
                                 (size_t) segscan_group_sizze_219029};
                    const size_t local_work_sizze_237279[1] =
                                 {(size_t) segscan_group_sizze_219029};
                    int64_t time_start_237276 = 0, time_end_237277 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.scan_stage1_219035",
                                global_work_sizze_237275[0],
                                local_work_sizze_237279[0], (int) (0 +
                                                                   smax64((int64_t) 1,
                                                                          (int64_t) 8 *
                                                                          segscan_group_sizze_219029)));
                        time_start_237276 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainziscan_stage1_219035,
                                                                    1, NULL,
                                                                    global_work_sizze_237275,
                                                                    local_work_sizze_237279,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainziscan_stage1_219035_runs,
                                                                                                              &ctx->mainziscan_stage1_219035_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237277 = get_wall_time();
                        
                        long time_diff_237278 = time_end_237277 -
                             time_start_237276;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.scan_stage1_219035", time_diff_237278);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c", "elems_per_group",
                            (long long) (segscan_group_sizze_219029 *
                                         sdiv_up64(partition_sizze_203667 *
                                                   n_203572,
                                                   sext_i32_i64(num_threads_234568))),
                            '\n');
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_219035,
                                                        1,
                                                        (size_t) smax64((int64_t) 1,
                                                                        (int64_t) 8 *
                                                                        stage1_num_groups_234567),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_219035,
                                                        2, sizeof(n_203572),
                                                        &n_203572));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_219035,
                                                        3,
                                                        sizeof(partition_sizze_203667),
                                                        &partition_sizze_203667));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_219035,
                                                        4,
                                                        sizeof(stage1_num_groups_234567),
                                                        &stage1_num_groups_234567));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_219035,
                                                        5,
                                                        sizeof(num_threads_234568),
                                                        &num_threads_234568));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_219035,
                                                        6,
                                                        sizeof(mem_230659.mem),
                                                        &mem_230659.mem));
                if (1 * ((size_t) (int64_t) 1 *
                         (size_t) stage1_num_groups_234567) != 0) {
                    const size_t global_work_sizze_237280[1] =
                                 {(size_t) (int64_t) 1 *
                                 (size_t) stage1_num_groups_234567};
                    const size_t local_work_sizze_237284[1] =
                                 {(size_t) stage1_num_groups_234567};
                    int64_t time_start_237281 = 0, time_end_237282 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.scan_stage2_219035",
                                global_work_sizze_237280[0],
                                local_work_sizze_237284[0], (int) (0 +
                                                                   smax64((int64_t) 1,
                                                                          (int64_t) 8 *
                                                                          stage1_num_groups_234567)));
                        time_start_237281 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainziscan_stage2_219035,
                                                                    1, NULL,
                                                                    global_work_sizze_237280,
                                                                    local_work_sizze_237284,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainziscan_stage2_219035_runs,
                                                                                                              &ctx->mainziscan_stage2_219035_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237282 = get_wall_time();
                        
                        long time_diff_237283 = time_end_237282 -
                             time_start_237281;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.scan_stage2_219035", time_diff_237283);
                    }
                }
                
                int32_t required_groups_234619 =
                        sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                               n_203572,
                                               segscan_group_sizze_219029));
                
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_219035,
                                                        1, sizeof(n_203572),
                                                        &n_203572));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_219035,
                                                        2,
                                                        sizeof(partition_sizze_203667),
                                                        &partition_sizze_203667));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_219035,
                                                        3,
                                                        sizeof(num_groups_219030),
                                                        &num_groups_219030));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_219035,
                                                        4,
                                                        sizeof(num_threads_234568),
                                                        &num_threads_234568));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_219035,
                                                        5,
                                                        sizeof(required_groups_234619),
                                                        &required_groups_234619));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_219035,
                                                        6,
                                                        sizeof(mem_230659.mem),
                                                        &mem_230659.mem));
                if (1 * ((size_t) num_groups_219030 *
                         (size_t) segscan_group_sizze_219029) != 0) {
                    const size_t global_work_sizze_237285[1] =
                                 {(size_t) num_groups_219030 *
                                 (size_t) segscan_group_sizze_219029};
                    const size_t local_work_sizze_237289[1] =
                                 {(size_t) segscan_group_sizze_219029};
                    int64_t time_start_237286 = 0, time_end_237287 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.scan_stage3_219035",
                                global_work_sizze_237285[0],
                                local_work_sizze_237289[0], (int) 0);
                        time_start_237286 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainziscan_stage3_219035,
                                                                    1, NULL,
                                                                    global_work_sizze_237285,
                                                                    local_work_sizze_237289,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainziscan_stage3_219035_runs,
                                                                                                              &ctx->mainziscan_stage3_219035_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237287 = get_wall_time();
                        
                        long time_diff_237288 = time_end_237287 -
                             time_start_237286;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.scan_stage3_219035", time_diff_237288);
                    }
                }
            }
            if (memblock_unref_device(ctx, &ext_mem_230654, "ext_mem_230654") !=
                0)
                return 1;
            
            struct memblock_device ext_mem_231016;
            
            ext_mem_231016.references = NULL;
            
            struct memblock_device ext_mem_231015;
            
            ext_mem_231015.references = NULL;
            if (cond_204250) {
                bool match_lit_205280 = (int64_t) 0 == d_l_203580;
                struct memblock_device ext_mem_230955;
                
                ext_mem_230955.references = NULL;
                
                struct memblock_device ext_mem_230954;
                
                ext_mem_230954.references = NULL;
                if (match_lit_205280) {
                    struct memblock_device mem_230663;
                    
                    mem_230663.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_230663, bytes_229486,
                                              "mem_230663")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f64(ctx, mem_230663,
                                                      partition_sizze_203667 *
                                                      l_n_m_203733, 0.0) != 0) {
                        if (memblock_unref_device(ctx, &mem_230663,
                                                  "mem_230663") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230954,
                                                  "ext_mem_230954") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230955,
                                                  "ext_mem_230955") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231015,
                                                  "ext_mem_231015") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231016,
                                                  "ext_mem_231016") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230654,
                                                  "ext_mem_230654") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230637,
                                                  "ext_mem_230637") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230620,
                                                  "ext_mem_230620") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230602,
                                                  "ext_mem_230602") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230594,
                                                  "ext_mem_230594") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230595,
                                                  "ext_mem_230595") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229623,
                                                  "mem_param_229623") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229615,
                                                  "mem_param_229615") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231625,
                                                  "ext_mem_231625") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231626,
                                                  "ext_mem_231626") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229601,
                                                  "mem_param_229601") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229593,
                                                  "mem_param_229593") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229585,
                                                  "mem_param_229585") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231968,
                                                  "ext_mem_231968") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231969,
                                                  "ext_mem_231969") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231970,
                                                  "ext_mem_231970") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230659,
                                                  "mem_230659") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230642,
                                                  "mem_230642") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230625,
                                                  "mem_230625") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230608,
                                                  "mem_230608") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229639,
                                                  "mem_229639") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229634,
                                                  "mem_229634") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229628,
                                                  "mem_229628") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229577,
                                                  "mem_229577") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229573,
                                                  "mem_229573") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229568,
                                                  "ext_mem_229568") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229569,
                                                  "ext_mem_229569") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229519,
                                                  "ext_mem_229519") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229520,
                                                  "ext_mem_229520") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229470,
                                                  "ext_mem_229470") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229471,
                                                  "ext_mem_229471") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229372,
                                                  "ext_mem_229372") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229373,
                                                  "ext_mem_229373") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229314,
                                                  "mem_229314") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229308,
                                                  "mem_229308") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229304,
                                                  "ext_mem_229304") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229305,
                                                  "ext_mem_229305") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229272,
                                                  "mem_229272") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229269,
                                                  "mem_229269") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232074,
                                                  "color_232074") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229265,
                                                  "mem_229265") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229263,
                                                  "mem_229263") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229260,
                                                  "mem_229260") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229242,
                                                  "mem_229242") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232361,
                                                  "mem_out_232361") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232360,
                                                  "mem_out_232360") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232359,
                                                  "mem_out_232359") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    bool suff_outer_par_219061;
                    
                    suff_outer_par_219061 =
                        *ctx->tuning_params.mainzisuff_outer_par_22 <=
                        partition_sizze_203667;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_22",
                                (long) partition_sizze_203667,
                                suff_outer_par_219061 ? "true" : "false");
                    
                    int64_t segmap_group_sizze_219134;
                    
                    segmap_group_sizze_219134 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_219065;
                    
                    int64_t num_groups_219135;
                    int32_t max_num_groups_234631;
                    
                    max_num_groups_234631 =
                        *ctx->tuning_params.mainzisegmap_num_groups_219067;
                    num_groups_219135 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(partition_sizze_203667,
                                                                             segmap_group_sizze_219134),
                                                                   sext_i32_i64(max_num_groups_234631))));
                    
                    int64_t segmap_group_sizze_219515;
                    
                    segmap_group_sizze_219515 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_219206;
                    
                    bool suff_outer_par_219519;
                    
                    suff_outer_par_219519 =
                        *ctx->tuning_params.mainzisuff_outer_par_23 <=
                        nest_sizze_209582;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_23",
                                (long) nest_sizze_209582,
                                suff_outer_par_219519 ? "true" : "false");
                    
                    int64_t nest_sizze_219597 = q_l_203577 * nest_sizze_209582;
                    int64_t segred_group_sizze_219598;
                    
                    segred_group_sizze_219598 =
                        *ctx->tuning_params.mainzisegred_group_sizze_219350;
                    
                    int64_t num_groups_219599;
                    int32_t max_num_groups_234632;
                    
                    max_num_groups_234632 =
                        *ctx->tuning_params.mainzisegred_num_groups_219352;
                    num_groups_219599 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(nest_sizze_219597,
                                                                             segred_group_sizze_219598),
                                                                   sext_i32_i64(max_num_groups_234632))));
                    
                    int64_t segmap_group_sizze_219636;
                    
                    segmap_group_sizze_219636 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_219337;
                    
                    int64_t segred_group_sizze_219647;
                    
                    segred_group_sizze_219647 =
                        *ctx->tuning_params.mainzisegred_group_sizze_219283;
                    
                    int64_t num_groups_219648;
                    int32_t max_num_groups_234633;
                    
                    max_num_groups_234633 =
                        *ctx->tuning_params.mainzisegred_num_groups_219285;
                    num_groups_219648 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(nest_sizze_219597,
                                                                             segred_group_sizze_219647),
                                                                   sext_i32_i64(max_num_groups_234633))));
                    
                    int64_t num_threads_232269 = segmap_group_sizze_219134 *
                            num_groups_219135;
                    int64_t total_sizze_232270 = bytes_229479 *
                            num_threads_232269;
                    struct memblock_device ext_mem_230721;
                    
                    ext_mem_230721.references = NULL;
                    
                    int32_t local_memory_capacity_234829;
                    
                    local_memory_capacity_234829 = ctx->opencl.max_local_memory;
                    if ((sle64((int64_t) 0,
                               sext_i32_i64(local_memory_capacity_234829)) &&
                         sle64((int64_t) 0,
                               sext_i32_i64(local_memory_capacity_234829))) &&
                        suff_outer_par_219061) {
                        struct memblock_device mem_230666;
                        
                        mem_230666.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230666,
                                                  binop_y_229485,
                                                  "mem_230666")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                  mem_230666,
                                                                  (int64_t) 0,
                                                                  ext_mem_229520,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  l_n_m_203733,
                                                                  partition_sizze_203667) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_230666,
                                                      "mem_230666") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230721,
                                                      "ext_mem_230721") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230663,
                                                      "mem_230663") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230954,
                                                      "ext_mem_230954") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230955,
                                                      "ext_mem_230955") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231015,
                                                      "ext_mem_231015") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231016,
                                                      "ext_mem_231016") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230654,
                                                      "ext_mem_230654") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230637,
                                                      "ext_mem_230637") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230620,
                                                      "ext_mem_230620") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230602,
                                                      "ext_mem_230602") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230669;
                        
                        mem_230669.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230669,
                                                  binop_y_229485,
                                                  "mem_230669")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_230669,
                                                                  (int64_t) 0,
                                                                  ext_mem_229519,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  l_n_m_203733,
                                                                  partition_sizze_203667) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_230669,
                                                      "mem_230669") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230666,
                                                      "mem_230666") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230721,
                                                      "ext_mem_230721") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230663,
                                                      "mem_230663") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230954,
                                                      "ext_mem_230954") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230955,
                                                      "ext_mem_230955") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231015,
                                                      "ext_mem_231015") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231016,
                                                      "ext_mem_231016") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230654,
                                                      "ext_mem_230654") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230637,
                                                      "ext_mem_230637") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230620,
                                                      "ext_mem_230620") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230602,
                                                      "ext_mem_230602") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230672;
                        
                        mem_230672.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230672,
                                                  binop_y_229284,
                                                  "mem_230672")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        int64_t group_sizze_234637;
                        
                        group_sizze_234637 =
                            *ctx->tuning_params.mainzigroup_sizze_234637;
                        
                        int64_t num_groups_234638 =
                                sdiv_up64(partition_sizze_203667 * n_203572,
                                          group_sizze_234637);
                        
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234634,
                                                                0,
                                                                sizeof(n_203572),
                                                                &n_203572));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234634,
                                                                1,
                                                                sizeof(partition_sizze_203667),
                                                                &partition_sizze_203667));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234634,
                                                                2,
                                                                sizeof(ctx_param_ext_229596),
                                                                &ctx_param_ext_229596));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234634,
                                                                3,
                                                                sizeof(ctx_param_ext_229597),
                                                                &ctx_param_ext_229597));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234634,
                                                                4,
                                                                sizeof(ctx_param_ext_229599),
                                                                &ctx_param_ext_229599));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234634,
                                                                5,
                                                                sizeof(mem_param_229601.mem),
                                                                &mem_param_229601.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234634,
                                                                6,
                                                                sizeof(mem_230672.mem),
                                                                &mem_230672.mem));
                        if (1 * ((size_t) num_groups_234638 *
                                 (size_t) group_sizze_234637) != 0) {
                            const size_t global_work_sizze_237290[1] =
                                         {(size_t) num_groups_234638 *
                                         (size_t) group_sizze_234637};
                            const size_t local_work_sizze_237294[1] =
                                         {(size_t) group_sizze_234637};
                            int64_t time_start_237291 = 0, time_end_237292 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.copy_234634",
                                        global_work_sizze_237290[0],
                                        local_work_sizze_237294[0], (int) 0);
                                time_start_237291 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzicopy_234634,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237290,
                                                                            local_work_sizze_237294,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzicopy_234634_runs,
                                                                                                                      &ctx->mainzicopy_234634_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237292 = get_wall_time();
                                
                                long time_diff_237293 = time_end_237292 -
                                     time_start_237291;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.copy_234634", time_diff_237293);
                            }
                        }
                        
                        struct memblock_device mem_230675;
                        
                        mem_230675.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230675,
                                                  binop_y_229284,
                                                  "mem_230675")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_230675,
                                                                  (int64_t) 0,
                                                                  mem_230659,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_203572,
                                                                  partition_sizze_203667) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_230675,
                                                      "mem_230675") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230672,
                                                      "mem_230672") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230669,
                                                      "mem_230669") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230666,
                                                      "mem_230666") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230721,
                                                      "ext_mem_230721") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230663,
                                                      "mem_230663") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230954,
                                                      "ext_mem_230954") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230955,
                                                      "ext_mem_230955") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231015,
                                                      "ext_mem_231015") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231016,
                                                      "ext_mem_231016") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230654,
                                                      "ext_mem_230654") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230637,
                                                      "ext_mem_230637") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230620,
                                                      "ext_mem_230620") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230602,
                                                      "ext_mem_230602") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230694;
                        
                        mem_230694.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230694,
                                                  binop_y_229485,
                                                  "mem_230694")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device color_232138;
                        
                        color_232138.references = NULL;
                        if (memblock_alloc_device(ctx, &color_232138,
                                                  total_sizze_232270,
                                                  "color_232138")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219139,
                                                                1,
                                                                sizeof(n_203572),
                                                                &n_203572));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219139,
                                                                2,
                                                                sizeof(q_l_203577),
                                                                &q_l_203577));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219139,
                                                                3,
                                                                sizeof(jump_t_203582),
                                                                &jump_t_203582));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219139,
                                                                4,
                                                                sizeof(partition_sizze_203667),
                                                                &partition_sizze_203667));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219139,
                                                                5,
                                                                sizeof(l_n_m_203733),
                                                                &l_n_m_203733));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219139,
                                                                6,
                                                                sizeof(i_203760),
                                                                &i_203760));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219139,
                                                                7,
                                                                sizeof(num_groups_219135),
                                                                &num_groups_219135));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219139,
                                                                8,
                                                                sizeof(num_threads_232269),
                                                                &num_threads_232269));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219139,
                                                                9,
                                                                sizeof(mem_230666.mem),
                                                                &mem_230666.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219139,
                                                                10,
                                                                sizeof(mem_230669.mem),
                                                                &mem_230669.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219139,
                                                                11,
                                                                sizeof(mem_230672.mem),
                                                                &mem_230672.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219139,
                                                                12,
                                                                sizeof(mem_230675.mem),
                                                                &mem_230675.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219139,
                                                                13,
                                                                sizeof(mem_230694.mem),
                                                                &mem_230694.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219139,
                                                                14,
                                                                sizeof(color_232138.mem),
                                                                &color_232138.mem));
                        if (1 * ((size_t) num_groups_219135 *
                                 (size_t) segmap_group_sizze_219134) != 0) {
                            const size_t global_work_sizze_237295[1] =
                                         {(size_t) num_groups_219135 *
                                         (size_t) segmap_group_sizze_219134};
                            const size_t local_work_sizze_237299[1] =
                                         {(size_t) segmap_group_sizze_219134};
                            int64_t time_start_237296 = 0, time_end_237297 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.segmap_219139",
                                        global_work_sizze_237295[0],
                                        local_work_sizze_237299[0], (int) 0);
                                time_start_237296 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_219139,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237295,
                                                                            local_work_sizze_237299,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_219139_runs,
                                                                                                                      &ctx->mainzisegmap_219139_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237297 = get_wall_time();
                                
                                long time_diff_237298 = time_end_237297 -
                                     time_start_237296;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_219139", time_diff_237298);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_230666,
                                                  "mem_230666") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230669,
                                                  "mem_230669") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230672,
                                                  "mem_230672") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230675,
                                                  "mem_230675") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232138,
                                                  "color_232138") != 0)
                            return 1;
                        
                        struct memblock_device mem_230719;
                        
                        mem_230719.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230719,
                                                  bytes_229486, "mem_230719")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_230719,
                                                                  (int64_t) 0,
                                                                  mem_230694,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  partition_sizze_203667,
                                                                  l_n_m_203733) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_230719,
                                                      "mem_230719") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232138,
                                                      "color_232138") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230694,
                                                      "mem_230694") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230675,
                                                      "mem_230675") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230672,
                                                      "mem_230672") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230669,
                                                      "mem_230669") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230666,
                                                      "mem_230666") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230721,
                                                      "ext_mem_230721") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230663,
                                                      "mem_230663") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230954,
                                                      "ext_mem_230954") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230955,
                                                      "ext_mem_230955") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231015,
                                                      "ext_mem_231015") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231016,
                                                      "ext_mem_231016") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230654,
                                                      "ext_mem_230654") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230637,
                                                      "ext_mem_230637") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230620,
                                                      "ext_mem_230620") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230602,
                                                      "ext_mem_230602") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        if (memblock_unref_device(ctx, &mem_230694,
                                                  "mem_230694") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230721,
                                                &mem_230719, "mem_230719") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230719,
                                                  "mem_230719") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232138,
                                                  "color_232138") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230694,
                                                  "mem_230694") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230675,
                                                  "mem_230675") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230672,
                                                  "mem_230672") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230669,
                                                  "mem_230669") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230666,
                                                  "mem_230666") != 0)
                            return 1;
                    } else {
                        int64_t segmap_usable_groups_219516 =
                                sdiv_up64(nest_sizze_209582,
                                          segmap_group_sizze_219515);
                        struct memblock_device ext_mem_230715;
                        
                        ext_mem_230715.references = NULL;
                        
                        int32_t local_memory_capacity_234828;
                        
                        local_memory_capacity_234828 =
                            ctx->opencl.max_local_memory;
                        if (sle64((int64_t) 0,
                                  sext_i32_i64(local_memory_capacity_234828)) &&
                            suff_outer_par_219519) {
                            struct memblock_device mem_230699;
                            
                            mem_230699.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230699,
                                                      bytes_229486,
                                                      "mem_230699")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219524,
                                                                    1,
                                                                    sizeof(n_203572),
                                                                    &n_203572));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219524,
                                                                    2,
                                                                    sizeof(q_l_203577),
                                                                    &q_l_203577));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219524,
                                                                    3,
                                                                    sizeof(jump_t_203582),
                                                                    &jump_t_203582));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219524,
                                                                    4,
                                                                    sizeof(partition_sizze_203667),
                                                                    &partition_sizze_203667));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219524,
                                                                    5,
                                                                    sizeof(l_n_m_203733),
                                                                    &l_n_m_203733));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219524,
                                                                    6,
                                                                    sizeof(i_203760),
                                                                    &i_203760));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219524,
                                                                    7,
                                                                    sizeof(ctx_param_ext_229596),
                                                                    &ctx_param_ext_229596));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219524,
                                                                    8,
                                                                    sizeof(ctx_param_ext_229597),
                                                                    &ctx_param_ext_229597));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219524,
                                                                    9,
                                                                    sizeof(ctx_param_ext_229599),
                                                                    &ctx_param_ext_229599));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219524,
                                                                    10,
                                                                    sizeof(ext_mem_229519.mem),
                                                                    &ext_mem_229519.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219524,
                                                                    11,
                                                                    sizeof(ext_mem_229520.mem),
                                                                    &ext_mem_229520.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219524,
                                                                    12,
                                                                    sizeof(mem_param_229601.mem),
                                                                    &mem_param_229601.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219524,
                                                                    13,
                                                                    sizeof(mem_230659.mem),
                                                                    &mem_230659.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219524,
                                                                    14,
                                                                    sizeof(mem_230699.mem),
                                                                    &mem_230699.mem));
                            if (1 * ((size_t) segmap_usable_groups_219516 *
                                     (size_t) segmap_group_sizze_219515) != 0) {
                                const size_t global_work_sizze_237300[1] =
                                             {(size_t) segmap_usable_groups_219516 *
                                             (size_t) segmap_group_sizze_219515};
                                const size_t local_work_sizze_237304[1] =
                                             {(size_t) segmap_group_sizze_219515};
                                int64_t time_start_237301 = 0, time_end_237302 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                            "main.segmap_219524",
                                            global_work_sizze_237300[0],
                                            local_work_sizze_237304[0],
                                            (int) 0);
                                    time_start_237301 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_219524,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237300,
                                                                                local_work_sizze_237304,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_219524_runs,
                                                                                                                          &ctx->mainzisegmap_219524_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237302 = get_wall_time();
                                    
                                    long time_diff_237303 = time_end_237302 -
                                         time_start_237301;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_219524",
                                            time_diff_237303);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_set_device(ctx, &ext_mem_230715,
                                                    &mem_230699,
                                                    "mem_230699") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230699,
                                                      "mem_230699") != 0)
                                return 1;
                        } else {
                            struct memblock_device mem_230704;
                            
                            mem_230704.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230704,
                                                      bytes_229486,
                                                      "mem_230704")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (slt64(q_l_203577 * (int64_t) 2,
                                      segred_group_sizze_219598)) {
                                int64_t segment_sizze_nonzzero_234674 =
                                        smax64((int64_t) 1, q_l_203577);
                                int64_t num_threads_234675 = num_groups_219599 *
                                        segred_group_sizze_219598;
                                
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n",
                                            "\n# SegRed-small");
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_segments",
                                            (long long) (partition_sizze_203667 *
                                                         l_n_m_203733), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_l_203577, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segments_per_group",
                                            (long long) squot64(segred_group_sizze_219598,
                                                                segment_sizze_nonzzero_234674),
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "required_groups",
                                            (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                               l_n_m_203733,
                                                                               squot64(segred_group_sizze_219598,
                                                                                       segment_sizze_nonzzero_234674))),
                                            '\n');
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219605,
                                                                        1,
                                                                        (size_t) ((int64_t) 8 *
                                                                                  segred_group_sizze_219598),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219605,
                                                                        2,
                                                                        sizeof(n_203572),
                                                                        &n_203572));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219605,
                                                                        3,
                                                                        sizeof(q_l_203577),
                                                                        &q_l_203577));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219605,
                                                                        4,
                                                                        sizeof(jump_t_203582),
                                                                        &jump_t_203582));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219605,
                                                                        5,
                                                                        sizeof(partition_sizze_203667),
                                                                        &partition_sizze_203667));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219605,
                                                                        6,
                                                                        sizeof(l_n_m_203733),
                                                                        &l_n_m_203733));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219605,
                                                                        7,
                                                                        sizeof(i_203760),
                                                                        &i_203760));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219605,
                                                                        8,
                                                                        sizeof(num_groups_219599),
                                                                        &num_groups_219599));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219605,
                                                                        9,
                                                                        sizeof(ctx_param_ext_229596),
                                                                        &ctx_param_ext_229596));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219605,
                                                                        10,
                                                                        sizeof(ctx_param_ext_229597),
                                                                        &ctx_param_ext_229597));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219605,
                                                                        11,
                                                                        sizeof(ctx_param_ext_229599),
                                                                        &ctx_param_ext_229599));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219605,
                                                                        12,
                                                                        sizeof(segment_sizze_nonzzero_234674),
                                                                        &segment_sizze_nonzzero_234674));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219605,
                                                                        13,
                                                                        sizeof(ext_mem_229519.mem),
                                                                        &ext_mem_229519.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219605,
                                                                        14,
                                                                        sizeof(ext_mem_229520.mem),
                                                                        &ext_mem_229520.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219605,
                                                                        15,
                                                                        sizeof(mem_param_229601.mem),
                                                                        &mem_param_229601.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219605,
                                                                        16,
                                                                        sizeof(mem_230704.mem),
                                                                        &mem_230704.mem));
                                if (1 * ((size_t) num_groups_219599 *
                                         (size_t) segred_group_sizze_219598) !=
                                    0) {
                                    const size_t global_work_sizze_237305[1] =
                                                 {(size_t) num_groups_219599 *
                                                 (size_t) segred_group_sizze_219598};
                                    const size_t local_work_sizze_237309[1] =
                                                 {(size_t) segred_group_sizze_219598};
                                    int64_t time_start_237306 = 0,
                                            time_end_237307 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                "main.segred_small_219605",
                                                global_work_sizze_237305[0],
                                                local_work_sizze_237309[0],
                                                (int) (0 + (int64_t) 8 *
                                                       segred_group_sizze_219598));
                                        time_start_237306 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegred_small_219605,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237305,
                                                                                    local_work_sizze_237309,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegred_small_219605_runs,
                                                                                                                              &ctx->mainzisegred_small_219605_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237307 = get_wall_time();
                                        
                                        long time_diff_237308 =
                                             time_end_237307 -
                                             time_start_237306;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segred_small_219605",
                                                time_diff_237308);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                            } else {
                                int64_t groups_per_segment_234703 =
                                        sdiv_up64(num_groups_219599,
                                                  smax64((int64_t) 1,
                                                         partition_sizze_203667 *
                                                         l_n_m_203733));
                                int64_t elements_per_thread_234704 =
                                        sdiv_up64(q_l_203577,
                                                  segred_group_sizze_219598 *
                                                  groups_per_segment_234703);
                                int64_t virt_num_groups_234705 =
                                        groups_per_segment_234703 *
                                        (partition_sizze_203667 * l_n_m_203733);
                                int64_t num_threads_234706 = num_groups_219599 *
                                        segred_group_sizze_219598;
                                int64_t threads_per_segment_234707 =
                                        groups_per_segment_234703 *
                                        segred_group_sizze_219598;
                                
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n",
                                            "\n# SegRed-large");
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_segments",
                                            (long long) (partition_sizze_203667 *
                                                         l_n_m_203733), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_l_203577, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "virt_num_groups",
                                            (long long) virt_num_groups_234705,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_groups",
                                            (long long) num_groups_219599,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "group_size",
                                            (long long) segred_group_sizze_219598,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "elems_per_thread",
                                            (long long) elements_per_thread_234704,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "groups_per_segment",
                                            (long long) groups_per_segment_234703,
                                            '\n');
                                
                                struct memblock_device segred_tmp_mem_234708;
                                
                                segred_tmp_mem_234708.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &segred_tmp_mem_234708,
                                                          (int64_t) 8 *
                                                          virt_num_groups_234705,
                                                          "segred_tmp_mem_234708")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mainzicounter_mem_234710
                                                       =
                                                       ctx->mainzicounter_mem_234710;
                                
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219605,
                                                                        1,
                                                                        (size_t) 1,
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219605,
                                                                        2,
                                                                        (size_t) ((int64_t) 8 *
                                                                                  segred_group_sizze_219598),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219605,
                                                                        3,
                                                                        sizeof(n_203572),
                                                                        &n_203572));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219605,
                                                                        4,
                                                                        sizeof(q_l_203577),
                                                                        &q_l_203577));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219605,
                                                                        5,
                                                                        sizeof(jump_t_203582),
                                                                        &jump_t_203582));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219605,
                                                                        6,
                                                                        sizeof(partition_sizze_203667),
                                                                        &partition_sizze_203667));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219605,
                                                                        7,
                                                                        sizeof(l_n_m_203733),
                                                                        &l_n_m_203733));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219605,
                                                                        8,
                                                                        sizeof(i_203760),
                                                                        &i_203760));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219605,
                                                                        9,
                                                                        sizeof(num_groups_219599),
                                                                        &num_groups_219599));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219605,
                                                                        10,
                                                                        sizeof(ctx_param_ext_229596),
                                                                        &ctx_param_ext_229596));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219605,
                                                                        11,
                                                                        sizeof(ctx_param_ext_229597),
                                                                        &ctx_param_ext_229597));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219605,
                                                                        12,
                                                                        sizeof(ctx_param_ext_229599),
                                                                        &ctx_param_ext_229599));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219605,
                                                                        13,
                                                                        sizeof(groups_per_segment_234703),
                                                                        &groups_per_segment_234703));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219605,
                                                                        14,
                                                                        sizeof(elements_per_thread_234704),
                                                                        &elements_per_thread_234704));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219605,
                                                                        15,
                                                                        sizeof(virt_num_groups_234705),
                                                                        &virt_num_groups_234705));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219605,
                                                                        16,
                                                                        sizeof(threads_per_segment_234707),
                                                                        &threads_per_segment_234707));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219605,
                                                                        17,
                                                                        sizeof(ext_mem_229519.mem),
                                                                        &ext_mem_229519.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219605,
                                                                        18,
                                                                        sizeof(ext_mem_229520.mem),
                                                                        &ext_mem_229520.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219605,
                                                                        19,
                                                                        sizeof(mem_param_229601.mem),
                                                                        &mem_param_229601.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219605,
                                                                        20,
                                                                        sizeof(mem_230704.mem),
                                                                        &mem_230704.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219605,
                                                                        21,
                                                                        sizeof(segred_tmp_mem_234708.mem),
                                                                        &segred_tmp_mem_234708.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219605,
                                                                        22,
                                                                        sizeof(mainzicounter_mem_234710.mem),
                                                                        &mainzicounter_mem_234710.mem));
                                if (1 * ((size_t) num_groups_219599 *
                                         (size_t) segred_group_sizze_219598) !=
                                    0) {
                                    const size_t global_work_sizze_237311[1] =
                                                 {(size_t) num_groups_219599 *
                                                 (size_t) segred_group_sizze_219598};
                                    const size_t local_work_sizze_237315[1] =
                                                 {(size_t) segred_group_sizze_219598};
                                    int64_t time_start_237312 = 0,
                                            time_end_237313 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                "main.segred_large_219605",
                                                global_work_sizze_237311[0],
                                                local_work_sizze_237315[0],
                                                (int) (0 + 1 + (int64_t) 8 *
                                                       segred_group_sizze_219598));
                                        time_start_237312 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegred_large_219605,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237311,
                                                                                    local_work_sizze_237315,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegred_large_219605_runs,
                                                                                                                              &ctx->mainzisegred_large_219605_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237313 = get_wall_time();
                                        
                                        long time_diff_237314 =
                                             time_end_237313 -
                                             time_start_237312;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segred_large_219605",
                                                time_diff_237314);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx,
                                                          &segred_tmp_mem_234708,
                                                          "segred_tmp_mem_234708") !=
                                    0)
                                    return 1;
                            }
                            
                            int64_t segmap_usable_groups_219637 =
                                    sdiv_up64(nest_sizze_209582,
                                              segmap_group_sizze_219636);
                            struct memblock_device mem_230709;
                            
                            mem_230709.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230709,
                                                      bytes_229486,
                                                      "mem_230709")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219641,
                                                                    1,
                                                                    sizeof(partition_sizze_203667),
                                                                    &partition_sizze_203667));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219641,
                                                                    2,
                                                                    sizeof(l_n_m_203733),
                                                                    &l_n_m_203733));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219641,
                                                                    3,
                                                                    sizeof(mem_230704.mem),
                                                                    &mem_230704.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219641,
                                                                    4,
                                                                    sizeof(mem_230709.mem),
                                                                    &mem_230709.mem));
                            if (1 * ((size_t) segmap_usable_groups_219637 *
                                     (size_t) segmap_group_sizze_219636) != 0) {
                                const size_t global_work_sizze_237316[1] =
                                             {(size_t) segmap_usable_groups_219637 *
                                             (size_t) segmap_group_sizze_219636};
                                const size_t local_work_sizze_237320[1] =
                                             {(size_t) segmap_group_sizze_219636};
                                int64_t time_start_237317 = 0, time_end_237318 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                            "main.segmap_219641",
                                            global_work_sizze_237316[0],
                                            local_work_sizze_237320[0],
                                            (int) 0);
                                    time_start_237317 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_219641,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237316,
                                                                                local_work_sizze_237320,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_219641_runs,
                                                                                                                          &ctx->mainzisegmap_219641_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237318 = get_wall_time();
                                    
                                    long time_diff_237319 = time_end_237318 -
                                         time_start_237317;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_219641",
                                            time_diff_237319);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_230704,
                                                      "mem_230704") != 0)
                                return 1;
                            
                            struct memblock_device mem_230714;
                            
                            mem_230714.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230714,
                                                      bytes_229486,
                                                      "mem_230714")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (slt64(q_l_203577 * (int64_t) 2,
                                      segred_group_sizze_219647)) {
                                int64_t segment_sizze_nonzzero_234756 =
                                        smax64((int64_t) 1, q_l_203577);
                                int64_t num_threads_234757 = num_groups_219648 *
                                        segred_group_sizze_219647;
                                
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n",
                                            "\n# SegRed-small");
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_segments",
                                            (long long) (partition_sizze_203667 *
                                                         l_n_m_203733), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_l_203577, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segments_per_group",
                                            (long long) squot64(segred_group_sizze_219647,
                                                                segment_sizze_nonzzero_234756),
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "required_groups",
                                            (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                               l_n_m_203733,
                                                                               squot64(segred_group_sizze_219647,
                                                                                       segment_sizze_nonzzero_234756))),
                                            '\n');
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219654,
                                                                        1,
                                                                        (size_t) ((int64_t) 8 *
                                                                                  segred_group_sizze_219647),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219654,
                                                                        2,
                                                                        sizeof(n_203572),
                                                                        &n_203572));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219654,
                                                                        3,
                                                                        sizeof(q_l_203577),
                                                                        &q_l_203577));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219654,
                                                                        4,
                                                                        sizeof(jump_t_203582),
                                                                        &jump_t_203582));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219654,
                                                                        5,
                                                                        sizeof(partition_sizze_203667),
                                                                        &partition_sizze_203667));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219654,
                                                                        6,
                                                                        sizeof(l_n_m_203733),
                                                                        &l_n_m_203733));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219654,
                                                                        7,
                                                                        sizeof(i_203760),
                                                                        &i_203760));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219654,
                                                                        8,
                                                                        sizeof(num_groups_219648),
                                                                        &num_groups_219648));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219654,
                                                                        9,
                                                                        sizeof(ctx_param_ext_229596),
                                                                        &ctx_param_ext_229596));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219654,
                                                                        10,
                                                                        sizeof(ctx_param_ext_229597),
                                                                        &ctx_param_ext_229597));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219654,
                                                                        11,
                                                                        sizeof(ctx_param_ext_229599),
                                                                        &ctx_param_ext_229599));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219654,
                                                                        12,
                                                                        sizeof(segment_sizze_nonzzero_234756),
                                                                        &segment_sizze_nonzzero_234756));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219654,
                                                                        13,
                                                                        sizeof(ext_mem_229519.mem),
                                                                        &ext_mem_229519.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219654,
                                                                        14,
                                                                        sizeof(ext_mem_229520.mem),
                                                                        &ext_mem_229520.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219654,
                                                                        15,
                                                                        sizeof(mem_param_229601.mem),
                                                                        &mem_param_229601.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219654,
                                                                        16,
                                                                        sizeof(mem_230659.mem),
                                                                        &mem_230659.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219654,
                                                                        17,
                                                                        sizeof(mem_230709.mem),
                                                                        &mem_230709.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219654,
                                                                        18,
                                                                        sizeof(mem_230714.mem),
                                                                        &mem_230714.mem));
                                if (1 * ((size_t) num_groups_219648 *
                                         (size_t) segred_group_sizze_219647) !=
                                    0) {
                                    const size_t global_work_sizze_237321[1] =
                                                 {(size_t) num_groups_219648 *
                                                 (size_t) segred_group_sizze_219647};
                                    const size_t local_work_sizze_237325[1] =
                                                 {(size_t) segred_group_sizze_219647};
                                    int64_t time_start_237322 = 0,
                                            time_end_237323 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                "main.segred_small_219654",
                                                global_work_sizze_237321[0],
                                                local_work_sizze_237325[0],
                                                (int) (0 + (int64_t) 8 *
                                                       segred_group_sizze_219647));
                                        time_start_237322 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegred_small_219654,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237321,
                                                                                    local_work_sizze_237325,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegred_small_219654_runs,
                                                                                                                              &ctx->mainzisegred_small_219654_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237323 = get_wall_time();
                                        
                                        long time_diff_237324 =
                                             time_end_237323 -
                                             time_start_237322;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segred_small_219654",
                                                time_diff_237324);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                            } else {
                                int64_t groups_per_segment_234785 =
                                        sdiv_up64(num_groups_219648,
                                                  smax64((int64_t) 1,
                                                         partition_sizze_203667 *
                                                         l_n_m_203733));
                                int64_t elements_per_thread_234786 =
                                        sdiv_up64(q_l_203577,
                                                  segred_group_sizze_219647 *
                                                  groups_per_segment_234785);
                                int64_t virt_num_groups_234787 =
                                        groups_per_segment_234785 *
                                        (partition_sizze_203667 * l_n_m_203733);
                                int64_t num_threads_234788 = num_groups_219648 *
                                        segred_group_sizze_219647;
                                int64_t threads_per_segment_234789 =
                                        groups_per_segment_234785 *
                                        segred_group_sizze_219647;
                                
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n",
                                            "\n# SegRed-large");
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_segments",
                                            (long long) (partition_sizze_203667 *
                                                         l_n_m_203733), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_l_203577, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "virt_num_groups",
                                            (long long) virt_num_groups_234787,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_groups",
                                            (long long) num_groups_219648,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "group_size",
                                            (long long) segred_group_sizze_219647,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "elems_per_thread",
                                            (long long) elements_per_thread_234786,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "groups_per_segment",
                                            (long long) groups_per_segment_234785,
                                            '\n');
                                
                                struct memblock_device segred_tmp_mem_234790;
                                
                                segred_tmp_mem_234790.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &segred_tmp_mem_234790,
                                                          (int64_t) 8 *
                                                          virt_num_groups_234787,
                                                          "segred_tmp_mem_234790")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mainzicounter_mem_234792
                                                       =
                                                       ctx->mainzicounter_mem_234792;
                                
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219654,
                                                                        1,
                                                                        (size_t) 1,
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219654,
                                                                        2,
                                                                        (size_t) ((int64_t) 8 *
                                                                                  segred_group_sizze_219647),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219654,
                                                                        3,
                                                                        sizeof(n_203572),
                                                                        &n_203572));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219654,
                                                                        4,
                                                                        sizeof(q_l_203577),
                                                                        &q_l_203577));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219654,
                                                                        5,
                                                                        sizeof(jump_t_203582),
                                                                        &jump_t_203582));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219654,
                                                                        6,
                                                                        sizeof(partition_sizze_203667),
                                                                        &partition_sizze_203667));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219654,
                                                                        7,
                                                                        sizeof(l_n_m_203733),
                                                                        &l_n_m_203733));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219654,
                                                                        8,
                                                                        sizeof(i_203760),
                                                                        &i_203760));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219654,
                                                                        9,
                                                                        sizeof(num_groups_219648),
                                                                        &num_groups_219648));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219654,
                                                                        10,
                                                                        sizeof(ctx_param_ext_229596),
                                                                        &ctx_param_ext_229596));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219654,
                                                                        11,
                                                                        sizeof(ctx_param_ext_229597),
                                                                        &ctx_param_ext_229597));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219654,
                                                                        12,
                                                                        sizeof(ctx_param_ext_229599),
                                                                        &ctx_param_ext_229599));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219654,
                                                                        13,
                                                                        sizeof(groups_per_segment_234785),
                                                                        &groups_per_segment_234785));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219654,
                                                                        14,
                                                                        sizeof(elements_per_thread_234786),
                                                                        &elements_per_thread_234786));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219654,
                                                                        15,
                                                                        sizeof(virt_num_groups_234787),
                                                                        &virt_num_groups_234787));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219654,
                                                                        16,
                                                                        sizeof(threads_per_segment_234789),
                                                                        &threads_per_segment_234789));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219654,
                                                                        17,
                                                                        sizeof(ext_mem_229519.mem),
                                                                        &ext_mem_229519.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219654,
                                                                        18,
                                                                        sizeof(ext_mem_229520.mem),
                                                                        &ext_mem_229520.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219654,
                                                                        19,
                                                                        sizeof(mem_param_229601.mem),
                                                                        &mem_param_229601.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219654,
                                                                        20,
                                                                        sizeof(mem_230659.mem),
                                                                        &mem_230659.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219654,
                                                                        21,
                                                                        sizeof(mem_230709.mem),
                                                                        &mem_230709.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219654,
                                                                        22,
                                                                        sizeof(mem_230714.mem),
                                                                        &mem_230714.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219654,
                                                                        23,
                                                                        sizeof(segred_tmp_mem_234790.mem),
                                                                        &segred_tmp_mem_234790.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219654,
                                                                        24,
                                                                        sizeof(mainzicounter_mem_234792.mem),
                                                                        &mainzicounter_mem_234792.mem));
                                if (1 * ((size_t) num_groups_219648 *
                                         (size_t) segred_group_sizze_219647) !=
                                    0) {
                                    const size_t global_work_sizze_237327[1] =
                                                 {(size_t) num_groups_219648 *
                                                 (size_t) segred_group_sizze_219647};
                                    const size_t local_work_sizze_237331[1] =
                                                 {(size_t) segred_group_sizze_219647};
                                    int64_t time_start_237328 = 0,
                                            time_end_237329 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                "main.segred_large_219654",
                                                global_work_sizze_237327[0],
                                                local_work_sizze_237331[0],
                                                (int) (0 + 1 + (int64_t) 8 *
                                                       segred_group_sizze_219647));
                                        time_start_237328 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegred_large_219654,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237327,
                                                                                    local_work_sizze_237331,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegred_large_219654_runs,
                                                                                                                              &ctx->mainzisegred_large_219654_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237329 = get_wall_time();
                                        
                                        long time_diff_237330 =
                                             time_end_237329 -
                                             time_start_237328;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segred_large_219654",
                                                time_diff_237330);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx,
                                                          &segred_tmp_mem_234790,
                                                          "segred_tmp_mem_234790") !=
                                    0)
                                    return 1;
                            }
                            if (memblock_unref_device(ctx, &mem_230709,
                                                      "mem_230709") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230715,
                                                    &mem_230714,
                                                    "mem_230714") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230714,
                                                      "mem_230714") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230709,
                                                      "mem_230709") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230704,
                                                      "mem_230704") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_230721,
                                                &ext_mem_230715,
                                                "ext_mem_230715") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230715,
                                                  "ext_mem_230715") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_230955,
                                            &ext_mem_230721,
                                            "ext_mem_230721") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_230954, &mem_230663,
                                            "mem_230663") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230721,
                                              "ext_mem_230721") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230663, "mem_230663") !=
                        0)
                        return 1;
                } else {
                    bool match_lit_205349 = (int64_t) 1 == d_l_203580;
                    struct memblock_device ext_mem_230953;
                    
                    ext_mem_230953.references = NULL;
                    
                    struct memblock_device ext_mem_230952;
                    
                    ext_mem_230952.references = NULL;
                    if (match_lit_205349) {
                        bool suff_outer_par_219694;
                        
                        suff_outer_par_219694 =
                            *ctx->tuning_params.mainzisuff_outer_par_24 <=
                            partition_sizze_203667;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_24",
                                    (long) partition_sizze_203667,
                                    suff_outer_par_219694 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_219796;
                        
                        segmap_group_sizze_219796 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_219698;
                        
                        int64_t num_groups_219797;
                        int32_t max_num_groups_234830;
                        
                        max_num_groups_234830 =
                            *ctx->tuning_params.mainzisegmap_num_groups_219700;
                        num_groups_219797 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(partition_sizze_203667,
                                                                                 segmap_group_sizze_219796),
                                                                       sext_i32_i64(max_num_groups_234830))));
                        
                        int64_t segmap_group_sizze_220312;
                        
                        segmap_group_sizze_220312 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_219898;
                        
                        bool suff_outer_par_220316;
                        
                        suff_outer_par_220316 =
                            *ctx->tuning_params.mainzisuff_outer_par_25 <=
                            nest_sizze_209582;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_25",
                                    (long) nest_sizze_209582,
                                    suff_outer_par_220316 ? "true" : "false");
                        
                        int64_t nest_sizze_220424 = q_l_203577 *
                                nest_sizze_209582;
                        int64_t segred_group_sizze_220425;
                        
                        segred_group_sizze_220425 =
                            *ctx->tuning_params.mainzisegred_group_sizze_220102;
                        
                        int64_t num_groups_220426;
                        int32_t max_num_groups_234831;
                        
                        max_num_groups_234831 =
                            *ctx->tuning_params.mainzisegred_num_groups_220104;
                        num_groups_220426 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_220424,
                                                                                 segred_group_sizze_220425),
                                                                       sext_i32_i64(max_num_groups_234831))));
                        
                        int64_t segmap_group_sizze_220473;
                        
                        segmap_group_sizze_220473 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_220080;
                        
                        int64_t segred_group_sizze_220495;
                        
                        segred_group_sizze_220495 =
                            *ctx->tuning_params.mainzisegred_group_sizze_220008;
                        
                        int64_t num_groups_220496;
                        int32_t max_num_groups_234832;
                        
                        max_num_groups_234832 =
                            *ctx->tuning_params.mainzisegred_num_groups_220010;
                        num_groups_220496 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_220424,
                                                                                 segred_group_sizze_220495),
                                                                       sext_i32_i64(max_num_groups_234832))));
                        
                        int64_t num_threads_232275 = segmap_group_sizze_219796 *
                                num_groups_219797;
                        int64_t total_sizze_232276 = bytes_229479 *
                                num_threads_232275;
                        int64_t total_sizze_232277 = bytes_229479 *
                                num_threads_232275;
                        struct memblock_device ext_mem_230828;
                        
                        ext_mem_230828.references = NULL;
                        
                        struct memblock_device ext_mem_230827;
                        
                        ext_mem_230827.references = NULL;
                        
                        int32_t local_memory_capacity_235079;
                        
                        local_memory_capacity_235079 =
                            ctx->opencl.max_local_memory;
                        if ((sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_235079)) &&
                             sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_235079))) &&
                            suff_outer_par_219694) {
                            struct memblock_device mem_230724;
                            
                            mem_230724.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230724,
                                                      binop_y_229485,
                                                      "mem_230724")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_230724,
                                                                      (int64_t) 0,
                                                                      ext_mem_229520,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      l_n_m_203733,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230724,
                                                          "mem_230724") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230827,
                                                          "ext_mem_230827") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230828,
                                                          "ext_mem_230828") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230952,
                                                          "ext_mem_230952") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230953,
                                                          "ext_mem_230953") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230954,
                                                          "ext_mem_230954") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230955,
                                                          "ext_mem_230955") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230727;
                            
                            mem_230727.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230727,
                                                      binop_y_229485,
                                                      "mem_230727")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230727,
                                                                      (int64_t) 0,
                                                                      ext_mem_229519,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      l_n_m_203733,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230727,
                                                          "mem_230727") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230724,
                                                          "mem_230724") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230827,
                                                          "ext_mem_230827") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230828,
                                                          "ext_mem_230828") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230952,
                                                          "ext_mem_230952") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230953,
                                                          "ext_mem_230953") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230954,
                                                          "ext_mem_230954") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230955,
                                                          "ext_mem_230955") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230730;
                            
                            mem_230730.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230730,
                                                      binop_y_229284,
                                                      "mem_230730")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            int64_t group_sizze_234836;
                            
                            group_sizze_234836 =
                                *ctx->tuning_params.mainzigroup_sizze_234836;
                            
                            int64_t num_groups_234837 =
                                    sdiv_up64(partition_sizze_203667 * n_203572,
                                              group_sizze_234836);
                            
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234833,
                                                                    0,
                                                                    sizeof(n_203572),
                                                                    &n_203572));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234833,
                                                                    1,
                                                                    sizeof(partition_sizze_203667),
                                                                    &partition_sizze_203667));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234833,
                                                                    2,
                                                                    sizeof(ctx_param_ext_229596),
                                                                    &ctx_param_ext_229596));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234833,
                                                                    3,
                                                                    sizeof(ctx_param_ext_229597),
                                                                    &ctx_param_ext_229597));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234833,
                                                                    4,
                                                                    sizeof(ctx_param_ext_229599),
                                                                    &ctx_param_ext_229599));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234833,
                                                                    5,
                                                                    sizeof(mem_param_229601.mem),
                                                                    &mem_param_229601.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234833,
                                                                    6,
                                                                    sizeof(mem_230730.mem),
                                                                    &mem_230730.mem));
                            if (1 * ((size_t) num_groups_234837 *
                                     (size_t) group_sizze_234836) != 0) {
                                const size_t global_work_sizze_237332[1] =
                                             {(size_t) num_groups_234837 *
                                             (size_t) group_sizze_234836};
                                const size_t local_work_sizze_237336[1] =
                                             {(size_t) group_sizze_234836};
                                int64_t time_start_237333 = 0, time_end_237334 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                            "main.copy_234833",
                                            global_work_sizze_237332[0],
                                            local_work_sizze_237336[0],
                                            (int) 0);
                                    time_start_237333 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzicopy_234833,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237332,
                                                                                local_work_sizze_237336,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzicopy_234833_runs,
                                                                                                                          &ctx->mainzicopy_234833_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237334 = get_wall_time();
                                    
                                    long time_diff_237335 = time_end_237334 -
                                         time_start_237333;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.copy_234833",
                                            time_diff_237335);
                                }
                            }
                            
                            struct memblock_device mem_230733;
                            
                            mem_230733.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230733,
                                                      binop_y_229284,
                                                      "mem_230733")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230733,
                                                                      (int64_t) 0,
                                                                      mem_230659,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_203572,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230733,
                                                          "mem_230733") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230730,
                                                          "mem_230730") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230727,
                                                          "mem_230727") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230724,
                                                          "mem_230724") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230827,
                                                          "ext_mem_230827") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230828,
                                                          "ext_mem_230828") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230952,
                                                          "ext_mem_230952") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230953,
                                                          "ext_mem_230953") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230954,
                                                          "ext_mem_230954") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230955,
                                                          "ext_mem_230955") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230767;
                            
                            mem_230767.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230767,
                                                      binop_y_229485,
                                                      "mem_230767")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230770;
                            
                            mem_230770.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230770,
                                                      binop_y_229485,
                                                      "mem_230770")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232139;
                            
                            color_232139.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232139,
                                                      total_sizze_232276,
                                                      "color_232139")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232140;
                            
                            color_232140.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232140,
                                                      total_sizze_232277,
                                                      "color_232140")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219802,
                                                                    1,
                                                                    sizeof(n_203572),
                                                                    &n_203572));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219802,
                                                                    2,
                                                                    sizeof(q_l_203577),
                                                                    &q_l_203577));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219802,
                                                                    3,
                                                                    sizeof(jump_t_203582),
                                                                    &jump_t_203582));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219802,
                                                                    4,
                                                                    sizeof(partition_sizze_203667),
                                                                    &partition_sizze_203667));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219802,
                                                                    5,
                                                                    sizeof(l_n_m_203733),
                                                                    &l_n_m_203733));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219802,
                                                                    6,
                                                                    sizeof(i_203760),
                                                                    &i_203760));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219802,
                                                                    7,
                                                                    sizeof(num_groups_219797),
                                                                    &num_groups_219797));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219802,
                                                                    8,
                                                                    sizeof(num_threads_232275),
                                                                    &num_threads_232275));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219802,
                                                                    9,
                                                                    sizeof(mem_230724.mem),
                                                                    &mem_230724.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219802,
                                                                    10,
                                                                    sizeof(mem_230727.mem),
                                                                    &mem_230727.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219802,
                                                                    11,
                                                                    sizeof(mem_230730.mem),
                                                                    &mem_230730.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219802,
                                                                    12,
                                                                    sizeof(mem_230733.mem),
                                                                    &mem_230733.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219802,
                                                                    13,
                                                                    sizeof(mem_230767.mem),
                                                                    &mem_230767.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219802,
                                                                    14,
                                                                    sizeof(mem_230770.mem),
                                                                    &mem_230770.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219802,
                                                                    15,
                                                                    sizeof(color_232139.mem),
                                                                    &color_232139.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219802,
                                                                    16,
                                                                    sizeof(color_232140.mem),
                                                                    &color_232140.mem));
                            if (1 * ((size_t) num_groups_219797 *
                                     (size_t) segmap_group_sizze_219796) != 0) {
                                const size_t global_work_sizze_237337[1] =
                                             {(size_t) num_groups_219797 *
                                             (size_t) segmap_group_sizze_219796};
                                const size_t local_work_sizze_237341[1] =
                                             {(size_t) segmap_group_sizze_219796};
                                int64_t time_start_237338 = 0, time_end_237339 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                            "main.segmap_219802",
                                            global_work_sizze_237337[0],
                                            local_work_sizze_237341[0],
                                            (int) 0);
                                    time_start_237338 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_219802,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237337,
                                                                                local_work_sizze_237341,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_219802_runs,
                                                                                                                          &ctx->mainzisegmap_219802_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237339 = get_wall_time();
                                    
                                    long time_diff_237340 = time_end_237339 -
                                         time_start_237338;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_219802",
                                            time_diff_237340);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_230724,
                                                      "mem_230724") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230727,
                                                      "mem_230727") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230730,
                                                      "mem_230730") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230733,
                                                      "mem_230733") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232139,
                                                      "color_232139") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232140,
                                                      "color_232140") != 0)
                                return 1;
                            
                            struct memblock_device mem_230820;
                            
                            mem_230820.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230820,
                                                      bytes_229486,
                                                      "mem_230820")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230820,
                                                                      (int64_t) 0,
                                                                      mem_230767,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203667,
                                                                      l_n_m_203733) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230820,
                                                          "mem_230820") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232140,
                                                          "color_232140") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232139,
                                                          "color_232139") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230770,
                                                          "mem_230770") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230767,
                                                          "mem_230767") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230733,
                                                          "mem_230733") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230730,
                                                          "mem_230730") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230727,
                                                          "mem_230727") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230724,
                                                          "mem_230724") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230827,
                                                          "ext_mem_230827") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230828,
                                                          "ext_mem_230828") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230952,
                                                          "ext_mem_230952") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230953,
                                                          "ext_mem_230953") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230954,
                                                          "ext_mem_230954") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230955,
                                                          "ext_mem_230955") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_230767,
                                                      "mem_230767") != 0)
                                return 1;
                            
                            struct memblock_device mem_230825;
                            
                            mem_230825.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230825,
                                                      bytes_229486,
                                                      "mem_230825")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230825,
                                                                      (int64_t) 0,
                                                                      mem_230770,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203667,
                                                                      l_n_m_203733) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230825,
                                                          "mem_230825") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230820,
                                                          "mem_230820") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232140,
                                                          "color_232140") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232139,
                                                          "color_232139") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230770,
                                                          "mem_230770") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230767,
                                                          "mem_230767") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230733,
                                                          "mem_230733") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230730,
                                                          "mem_230730") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230727,
                                                          "mem_230727") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230724,
                                                          "mem_230724") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230827,
                                                          "ext_mem_230827") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230828,
                                                          "ext_mem_230828") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230952,
                                                          "ext_mem_230952") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230953,
                                                          "ext_mem_230953") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230954,
                                                          "ext_mem_230954") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230955,
                                                          "ext_mem_230955") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_230770,
                                                      "mem_230770") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230828,
                                                    &mem_230820,
                                                    "mem_230820") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230827,
                                                    &mem_230825,
                                                    "mem_230825") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230825,
                                                      "mem_230825") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230820,
                                                      "mem_230820") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232140,
                                                      "color_232140") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232139,
                                                      "color_232139") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230770,
                                                      "mem_230770") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230767,
                                                      "mem_230767") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230733,
                                                      "mem_230733") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230730,
                                                      "mem_230730") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230727,
                                                      "mem_230727") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230724,
                                                      "mem_230724") != 0)
                                return 1;
                        } else {
                            int64_t segmap_usable_groups_220313 =
                                    sdiv_up64(nest_sizze_209582,
                                              segmap_group_sizze_220312);
                            struct memblock_device ext_mem_230816;
                            
                            ext_mem_230816.references = NULL;
                            
                            struct memblock_device ext_mem_230815;
                            
                            ext_mem_230815.references = NULL;
                            
                            int32_t local_memory_capacity_235078;
                            
                            local_memory_capacity_235078 =
                                ctx->opencl.max_local_memory;
                            if (sle64((int64_t) 0,
                                      sext_i32_i64(local_memory_capacity_235078)) &&
                                suff_outer_par_220316) {
                                struct memblock_device mem_230775;
                                
                                mem_230775.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230775,
                                                          bytes_229486,
                                                          "mem_230775")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230779;
                                
                                mem_230779.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230779,
                                                          bytes_229486,
                                                          "mem_230779")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220323,
                                                                        1,
                                                                        sizeof(n_203572),
                                                                        &n_203572));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220323,
                                                                        2,
                                                                        sizeof(q_l_203577),
                                                                        &q_l_203577));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220323,
                                                                        3,
                                                                        sizeof(jump_t_203582),
                                                                        &jump_t_203582));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220323,
                                                                        4,
                                                                        sizeof(partition_sizze_203667),
                                                                        &partition_sizze_203667));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220323,
                                                                        5,
                                                                        sizeof(l_n_m_203733),
                                                                        &l_n_m_203733));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220323,
                                                                        6,
                                                                        sizeof(i_203760),
                                                                        &i_203760));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220323,
                                                                        7,
                                                                        sizeof(ctx_param_ext_229596),
                                                                        &ctx_param_ext_229596));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220323,
                                                                        8,
                                                                        sizeof(ctx_param_ext_229597),
                                                                        &ctx_param_ext_229597));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220323,
                                                                        9,
                                                                        sizeof(ctx_param_ext_229599),
                                                                        &ctx_param_ext_229599));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220323,
                                                                        10,
                                                                        sizeof(ext_mem_229519.mem),
                                                                        &ext_mem_229519.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220323,
                                                                        11,
                                                                        sizeof(ext_mem_229520.mem),
                                                                        &ext_mem_229520.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220323,
                                                                        12,
                                                                        sizeof(mem_param_229601.mem),
                                                                        &mem_param_229601.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220323,
                                                                        13,
                                                                        sizeof(mem_230659.mem),
                                                                        &mem_230659.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220323,
                                                                        14,
                                                                        sizeof(mem_230775.mem),
                                                                        &mem_230775.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220323,
                                                                        15,
                                                                        sizeof(mem_230779.mem),
                                                                        &mem_230779.mem));
                                if (1 * ((size_t) segmap_usable_groups_220313 *
                                         (size_t) segmap_group_sizze_220312) !=
                                    0) {
                                    const size_t global_work_sizze_237342[1] =
                                                 {(size_t) segmap_usable_groups_220313 *
                                                 (size_t) segmap_group_sizze_220312};
                                    const size_t local_work_sizze_237346[1] =
                                                 {(size_t) segmap_group_sizze_220312};
                                    int64_t time_start_237343 = 0,
                                            time_end_237344 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                "main.segmap_220323",
                                                global_work_sizze_237342[0],
                                                local_work_sizze_237346[0],
                                                (int) 0);
                                        time_start_237343 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegmap_220323,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237342,
                                                                                    local_work_sizze_237346,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegmap_220323_runs,
                                                                                                                              &ctx->mainzisegmap_220323_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237344 = get_wall_time();
                                        
                                        long time_diff_237345 =
                                             time_end_237344 -
                                             time_start_237343;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segmap_220323",
                                                time_diff_237345);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_set_device(ctx, &ext_mem_230816,
                                                        &mem_230775,
                                                        "mem_230775") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230815,
                                                        &mem_230779,
                                                        "mem_230779") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230779,
                                                          "mem_230779") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230775,
                                                          "mem_230775") != 0)
                                    return 1;
                            } else {
                                struct memblock_device mem_230784;
                                
                                mem_230784.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230784,
                                                          bytes_229486,
                                                          "mem_230784")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230788;
                                
                                mem_230788.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230788,
                                                          bytes_229486,
                                                          "mem_230788")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230792;
                                
                                mem_230792.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230792,
                                                          bytes_229486,
                                                          "mem_230792")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_l_203577 * (int64_t) 2,
                                          segred_group_sizze_220425)) {
                                    int64_t segment_sizze_nonzzero_234882 =
                                            smax64((int64_t) 1, q_l_203577);
                                    int64_t num_threads_234883 =
                                            num_groups_220426 *
                                            segred_group_sizze_220425;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-small");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             l_n_m_203733),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203577, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_220425,
                                                                    segment_sizze_nonzzero_234882),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                                   l_n_m_203733,
                                                                                   squot64(segred_group_sizze_220425,
                                                                                           segment_sizze_nonzzero_234882))),
                                                '\n');
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220434,
                                                                            1,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_220425),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220434,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_220425),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220434,
                                                                            3,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_220425),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220434,
                                                                            4,
                                                                            sizeof(n_203572),
                                                                            &n_203572));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220434,
                                                                            5,
                                                                            sizeof(q_l_203577),
                                                                            &q_l_203577));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220434,
                                                                            6,
                                                                            sizeof(jump_t_203582),
                                                                            &jump_t_203582));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220434,
                                                                            7,
                                                                            sizeof(partition_sizze_203667),
                                                                            &partition_sizze_203667));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220434,
                                                                            8,
                                                                            sizeof(l_n_m_203733),
                                                                            &l_n_m_203733));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220434,
                                                                            9,
                                                                            sizeof(i_203760),
                                                                            &i_203760));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220434,
                                                                            10,
                                                                            sizeof(num_groups_220426),
                                                                            &num_groups_220426));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220434,
                                                                            11,
                                                                            sizeof(ctx_param_ext_229596),
                                                                            &ctx_param_ext_229596));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220434,
                                                                            12,
                                                                            sizeof(ctx_param_ext_229597),
                                                                            &ctx_param_ext_229597));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220434,
                                                                            13,
                                                                            sizeof(ctx_param_ext_229599),
                                                                            &ctx_param_ext_229599));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220434,
                                                                            14,
                                                                            sizeof(segment_sizze_nonzzero_234882),
                                                                            &segment_sizze_nonzzero_234882));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220434,
                                                                            15,
                                                                            sizeof(ext_mem_229519.mem),
                                                                            &ext_mem_229519.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220434,
                                                                            16,
                                                                            sizeof(ext_mem_229520.mem),
                                                                            &ext_mem_229520.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220434,
                                                                            17,
                                                                            sizeof(mem_param_229601.mem),
                                                                            &mem_param_229601.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220434,
                                                                            18,
                                                                            sizeof(mem_230784.mem),
                                                                            &mem_230784.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220434,
                                                                            19,
                                                                            sizeof(mem_230788.mem),
                                                                            &mem_230788.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220434,
                                                                            20,
                                                                            sizeof(mem_230792.mem),
                                                                            &mem_230792.mem));
                                    if (1 * ((size_t) num_groups_220426 *
                                             (size_t) segred_group_sizze_220425) !=
                                        0) {
                                        const size_t global_work_sizze_237347[1]
                                                     =
                                                     {(size_t) num_groups_220426 *
                                                     (size_t) segred_group_sizze_220425};
                                        const size_t local_work_sizze_237351[1]
                                                     =
                                                     {(size_t) segred_group_sizze_220425};
                                        int64_t time_start_237348 = 0,
                                                time_end_237349 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                    "main.segred_small_220434",
                                                    global_work_sizze_237347[0],
                                                    local_work_sizze_237351[0],
                                                    (int) (0 + (int64_t) 8 *
                                                           segred_group_sizze_220425 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_220425 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_220425));
                                            time_start_237348 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_small_220434,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237347,
                                                                                        local_work_sizze_237351,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_small_220434_runs,
                                                                                                                                  &ctx->mainzisegred_small_220434_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237349 = get_wall_time();
                                            
                                            long time_diff_237350 =
                                                 time_end_237349 -
                                                 time_start_237348;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_small_220434",
                                                    time_diff_237350);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_234923 =
                                            sdiv_up64(num_groups_220426,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203667 *
                                                             l_n_m_203733));
                                    int64_t elements_per_thread_234924 =
                                            sdiv_up64(q_l_203577,
                                                      segred_group_sizze_220425 *
                                                      groups_per_segment_234923);
                                    int64_t virt_num_groups_234925 =
                                            groups_per_segment_234923 *
                                            (partition_sizze_203667 *
                                             l_n_m_203733);
                                    int64_t num_threads_234926 =
                                            num_groups_220426 *
                                            segred_group_sizze_220425;
                                    int64_t threads_per_segment_234927 =
                                            groups_per_segment_234923 *
                                            segred_group_sizze_220425;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-large");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             l_n_m_203733),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203577, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_234925,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_220426,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_220425,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_234924,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_234923,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_234928;
                                    
                                    segred_tmp_mem_234928.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_234928,
                                                              (int64_t) 8 *
                                                              virt_num_groups_234925,
                                                              "segred_tmp_mem_234928")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_234930;
                                    
                                    segred_tmp_mem_234930.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_234930,
                                                              (int64_t) 8 *
                                                              virt_num_groups_234925,
                                                              "segred_tmp_mem_234930")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_234932;
                                    
                                    segred_tmp_mem_234932.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_234932,
                                                              (int64_t) 8 *
                                                              virt_num_groups_234925,
                                                              "segred_tmp_mem_234932")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_234934 =
                                    ctx->mainzicounter_mem_234934;
                                    
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220434,
                                                                            1,
                                                                            (size_t) 1,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220434,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_220425),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220434,
                                                                            3,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_220425),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220434,
                                                                            4,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_220425),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220434,
                                                                            5,
                                                                            sizeof(n_203572),
                                                                            &n_203572));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220434,
                                                                            6,
                                                                            sizeof(q_l_203577),
                                                                            &q_l_203577));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220434,
                                                                            7,
                                                                            sizeof(jump_t_203582),
                                                                            &jump_t_203582));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220434,
                                                                            8,
                                                                            sizeof(partition_sizze_203667),
                                                                            &partition_sizze_203667));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220434,
                                                                            9,
                                                                            sizeof(l_n_m_203733),
                                                                            &l_n_m_203733));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220434,
                                                                            10,
                                                                            sizeof(i_203760),
                                                                            &i_203760));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220434,
                                                                            11,
                                                                            sizeof(num_groups_220426),
                                                                            &num_groups_220426));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220434,
                                                                            12,
                                                                            sizeof(ctx_param_ext_229596),
                                                                            &ctx_param_ext_229596));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220434,
                                                                            13,
                                                                            sizeof(ctx_param_ext_229597),
                                                                            &ctx_param_ext_229597));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220434,
                                                                            14,
                                                                            sizeof(ctx_param_ext_229599),
                                                                            &ctx_param_ext_229599));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220434,
                                                                            15,
                                                                            sizeof(groups_per_segment_234923),
                                                                            &groups_per_segment_234923));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220434,
                                                                            16,
                                                                            sizeof(elements_per_thread_234924),
                                                                            &elements_per_thread_234924));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220434,
                                                                            17,
                                                                            sizeof(virt_num_groups_234925),
                                                                            &virt_num_groups_234925));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220434,
                                                                            18,
                                                                            sizeof(threads_per_segment_234927),
                                                                            &threads_per_segment_234927));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220434,
                                                                            19,
                                                                            sizeof(ext_mem_229519.mem),
                                                                            &ext_mem_229519.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220434,
                                                                            20,
                                                                            sizeof(ext_mem_229520.mem),
                                                                            &ext_mem_229520.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220434,
                                                                            21,
                                                                            sizeof(mem_param_229601.mem),
                                                                            &mem_param_229601.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220434,
                                                                            22,
                                                                            sizeof(mem_230784.mem),
                                                                            &mem_230784.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220434,
                                                                            23,
                                                                            sizeof(mem_230788.mem),
                                                                            &mem_230788.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220434,
                                                                            24,
                                                                            sizeof(mem_230792.mem),
                                                                            &mem_230792.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220434,
                                                                            25,
                                                                            sizeof(segred_tmp_mem_234928.mem),
                                                                            &segred_tmp_mem_234928.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220434,
                                                                            26,
                                                                            sizeof(segred_tmp_mem_234930.mem),
                                                                            &segred_tmp_mem_234930.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220434,
                                                                            27,
                                                                            sizeof(segred_tmp_mem_234932.mem),
                                                                            &segred_tmp_mem_234932.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220434,
                                                                            28,
                                                                            sizeof(mainzicounter_mem_234934.mem),
                                                                            &mainzicounter_mem_234934.mem));
                                    if (1 * ((size_t) num_groups_220426 *
                                             (size_t) segred_group_sizze_220425) !=
                                        0) {
                                        const size_t global_work_sizze_237353[1]
                                                     =
                                                     {(size_t) num_groups_220426 *
                                                     (size_t) segred_group_sizze_220425};
                                        const size_t local_work_sizze_237357[1]
                                                     =
                                                     {(size_t) segred_group_sizze_220425};
                                        int64_t time_start_237354 = 0,
                                                time_end_237355 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                    "main.segred_large_220434",
                                                    global_work_sizze_237353[0],
                                                    local_work_sizze_237357[0],
                                                    (int) (0 + 1 + (int64_t) 8 *
                                                           segred_group_sizze_220425 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_220425 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_220425));
                                            time_start_237354 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_large_220434,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237353,
                                                                                        local_work_sizze_237357,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_large_220434_runs,
                                                                                                                                  &ctx->mainzisegred_large_220434_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237355 = get_wall_time();
                                            
                                            long time_diff_237356 =
                                                 time_end_237355 -
                                                 time_start_237354;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_large_220434",
                                                    time_diff_237356);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_234932,
                                                              "segred_tmp_mem_234932") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_234930,
                                                              "segred_tmp_mem_234930") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_234928,
                                                              "segred_tmp_mem_234928") !=
                                        0)
                                        return 1;
                                }
                                
                                int64_t segmap_usable_groups_220474 =
                                        sdiv_up64(nest_sizze_209582,
                                                  segmap_group_sizze_220473);
                                struct memblock_device mem_230797;
                                
                                mem_230797.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230797,
                                                          bytes_229486,
                                                          "mem_230797")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230801;
                                
                                mem_230801.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230801,
                                                          bytes_229486,
                                                          "mem_230801")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230805;
                                
                                mem_230805.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230805,
                                                          bytes_229486,
                                                          "mem_230805")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220480,
                                                                        1,
                                                                        sizeof(partition_sizze_203667),
                                                                        &partition_sizze_203667));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220480,
                                                                        2,
                                                                        sizeof(l_n_m_203733),
                                                                        &l_n_m_203733));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220480,
                                                                        3,
                                                                        sizeof(mem_230784.mem),
                                                                        &mem_230784.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220480,
                                                                        4,
                                                                        sizeof(mem_230788.mem),
                                                                        &mem_230788.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220480,
                                                                        5,
                                                                        sizeof(mem_230792.mem),
                                                                        &mem_230792.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220480,
                                                                        6,
                                                                        sizeof(mem_230797.mem),
                                                                        &mem_230797.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220480,
                                                                        7,
                                                                        sizeof(mem_230801.mem),
                                                                        &mem_230801.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220480,
                                                                        8,
                                                                        sizeof(mem_230805.mem),
                                                                        &mem_230805.mem));
                                if (1 * ((size_t) segmap_usable_groups_220474 *
                                         (size_t) segmap_group_sizze_220473) !=
                                    0) {
                                    const size_t global_work_sizze_237358[1] =
                                                 {(size_t) segmap_usable_groups_220474 *
                                                 (size_t) segmap_group_sizze_220473};
                                    const size_t local_work_sizze_237362[1] =
                                                 {(size_t) segmap_group_sizze_220473};
                                    int64_t time_start_237359 = 0,
                                            time_end_237360 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                "main.segmap_220480",
                                                global_work_sizze_237358[0],
                                                local_work_sizze_237362[0],
                                                (int) 0);
                                        time_start_237359 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegmap_220480,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237358,
                                                                                    local_work_sizze_237362,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegmap_220480_runs,
                                                                                                                              &ctx->mainzisegmap_220480_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237360 = get_wall_time();
                                        
                                        long time_diff_237361 =
                                             time_end_237360 -
                                             time_start_237359;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segmap_220480",
                                                time_diff_237361);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx, &mem_230784,
                                                          "mem_230784") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230788,
                                                          "mem_230788") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230792,
                                                          "mem_230792") != 0)
                                    return 1;
                                
                                struct memblock_device mem_230810;
                                
                                mem_230810.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230810,
                                                          bytes_229486,
                                                          "mem_230810")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230814;
                                
                                mem_230814.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230814,
                                                          bytes_229486,
                                                          "mem_230814")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_l_203577 * (int64_t) 2,
                                          segred_group_sizze_220495)) {
                                    int64_t segment_sizze_nonzzero_234992 =
                                            smax64((int64_t) 1, q_l_203577);
                                    int64_t num_threads_234993 =
                                            num_groups_220496 *
                                            segred_group_sizze_220495;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-small");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             l_n_m_203733),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203577, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_220495,
                                                                    segment_sizze_nonzzero_234992),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                                   l_n_m_203733,
                                                                                   squot64(segred_group_sizze_220495,
                                                                                           segment_sizze_nonzzero_234992))),
                                                '\n');
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220503,
                                                                            1,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_220495),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220503,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_220495),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220503,
                                                                            3,
                                                                            sizeof(n_203572),
                                                                            &n_203572));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220503,
                                                                            4,
                                                                            sizeof(q_l_203577),
                                                                            &q_l_203577));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220503,
                                                                            5,
                                                                            sizeof(jump_t_203582),
                                                                            &jump_t_203582));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220503,
                                                                            6,
                                                                            sizeof(partition_sizze_203667),
                                                                            &partition_sizze_203667));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220503,
                                                                            7,
                                                                            sizeof(l_n_m_203733),
                                                                            &l_n_m_203733));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220503,
                                                                            8,
                                                                            sizeof(i_203760),
                                                                            &i_203760));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220503,
                                                                            9,
                                                                            sizeof(num_groups_220496),
                                                                            &num_groups_220496));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220503,
                                                                            10,
                                                                            sizeof(ctx_param_ext_229596),
                                                                            &ctx_param_ext_229596));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220503,
                                                                            11,
                                                                            sizeof(ctx_param_ext_229597),
                                                                            &ctx_param_ext_229597));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220503,
                                                                            12,
                                                                            sizeof(ctx_param_ext_229599),
                                                                            &ctx_param_ext_229599));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220503,
                                                                            13,
                                                                            sizeof(segment_sizze_nonzzero_234992),
                                                                            &segment_sizze_nonzzero_234992));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220503,
                                                                            14,
                                                                            sizeof(ext_mem_229519.mem),
                                                                            &ext_mem_229519.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220503,
                                                                            15,
                                                                            sizeof(ext_mem_229520.mem),
                                                                            &ext_mem_229520.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220503,
                                                                            16,
                                                                            sizeof(mem_param_229601.mem),
                                                                            &mem_param_229601.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220503,
                                                                            17,
                                                                            sizeof(mem_230659.mem),
                                                                            &mem_230659.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220503,
                                                                            18,
                                                                            sizeof(mem_230797.mem),
                                                                            &mem_230797.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220503,
                                                                            19,
                                                                            sizeof(mem_230801.mem),
                                                                            &mem_230801.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220503,
                                                                            20,
                                                                            sizeof(mem_230805.mem),
                                                                            &mem_230805.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220503,
                                                                            21,
                                                                            sizeof(mem_230810.mem),
                                                                            &mem_230810.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220503,
                                                                            22,
                                                                            sizeof(mem_230814.mem),
                                                                            &mem_230814.mem));
                                    if (1 * ((size_t) num_groups_220496 *
                                             (size_t) segred_group_sizze_220495) !=
                                        0) {
                                        const size_t global_work_sizze_237363[1]
                                                     =
                                                     {(size_t) num_groups_220496 *
                                                     (size_t) segred_group_sizze_220495};
                                        const size_t local_work_sizze_237367[1]
                                                     =
                                                     {(size_t) segred_group_sizze_220495};
                                        int64_t time_start_237364 = 0,
                                                time_end_237365 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                    "main.segred_small_220503",
                                                    global_work_sizze_237363[0],
                                                    local_work_sizze_237367[0],
                                                    (int) (0 + (int64_t) 8 *
                                                           segred_group_sizze_220495 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_220495));
                                            time_start_237364 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_small_220503,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237363,
                                                                                        local_work_sizze_237367,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_small_220503_runs,
                                                                                                                                  &ctx->mainzisegred_small_220503_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237365 = get_wall_time();
                                            
                                            long time_diff_237366 =
                                                 time_end_237365 -
                                                 time_start_237364;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_small_220503",
                                                    time_diff_237366);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_235027 =
                                            sdiv_up64(num_groups_220496,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203667 *
                                                             l_n_m_203733));
                                    int64_t elements_per_thread_235028 =
                                            sdiv_up64(q_l_203577,
                                                      segred_group_sizze_220495 *
                                                      groups_per_segment_235027);
                                    int64_t virt_num_groups_235029 =
                                            groups_per_segment_235027 *
                                            (partition_sizze_203667 *
                                             l_n_m_203733);
                                    int64_t num_threads_235030 =
                                            num_groups_220496 *
                                            segred_group_sizze_220495;
                                    int64_t threads_per_segment_235031 =
                                            groups_per_segment_235027 *
                                            segred_group_sizze_220495;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-large");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             l_n_m_203733),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203577, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_235029,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_220496,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_220495,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_235028,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_235027,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235032;
                                    
                                    segred_tmp_mem_235032.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235032,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235029,
                                                              "segred_tmp_mem_235032")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235034;
                                    
                                    segred_tmp_mem_235034.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235034,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235029,
                                                              "segred_tmp_mem_235034")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_235036 =
                                    ctx->mainzicounter_mem_235036;
                                    
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220503,
                                                                            1,
                                                                            (size_t) 1,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220503,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_220495),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220503,
                                                                            3,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_220495),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220503,
                                                                            4,
                                                                            sizeof(n_203572),
                                                                            &n_203572));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220503,
                                                                            5,
                                                                            sizeof(q_l_203577),
                                                                            &q_l_203577));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220503,
                                                                            6,
                                                                            sizeof(jump_t_203582),
                                                                            &jump_t_203582));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220503,
                                                                            7,
                                                                            sizeof(partition_sizze_203667),
                                                                            &partition_sizze_203667));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220503,
                                                                            8,
                                                                            sizeof(l_n_m_203733),
                                                                            &l_n_m_203733));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220503,
                                                                            9,
                                                                            sizeof(i_203760),
                                                                            &i_203760));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220503,
                                                                            10,
                                                                            sizeof(num_groups_220496),
                                                                            &num_groups_220496));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220503,
                                                                            11,
                                                                            sizeof(ctx_param_ext_229596),
                                                                            &ctx_param_ext_229596));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220503,
                                                                            12,
                                                                            sizeof(ctx_param_ext_229597),
                                                                            &ctx_param_ext_229597));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220503,
                                                                            13,
                                                                            sizeof(ctx_param_ext_229599),
                                                                            &ctx_param_ext_229599));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220503,
                                                                            14,
                                                                            sizeof(groups_per_segment_235027),
                                                                            &groups_per_segment_235027));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220503,
                                                                            15,
                                                                            sizeof(elements_per_thread_235028),
                                                                            &elements_per_thread_235028));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220503,
                                                                            16,
                                                                            sizeof(virt_num_groups_235029),
                                                                            &virt_num_groups_235029));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220503,
                                                                            17,
                                                                            sizeof(threads_per_segment_235031),
                                                                            &threads_per_segment_235031));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220503,
                                                                            18,
                                                                            sizeof(ext_mem_229519.mem),
                                                                            &ext_mem_229519.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220503,
                                                                            19,
                                                                            sizeof(ext_mem_229520.mem),
                                                                            &ext_mem_229520.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220503,
                                                                            20,
                                                                            sizeof(mem_param_229601.mem),
                                                                            &mem_param_229601.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220503,
                                                                            21,
                                                                            sizeof(mem_230659.mem),
                                                                            &mem_230659.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220503,
                                                                            22,
                                                                            sizeof(mem_230797.mem),
                                                                            &mem_230797.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220503,
                                                                            23,
                                                                            sizeof(mem_230801.mem),
                                                                            &mem_230801.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220503,
                                                                            24,
                                                                            sizeof(mem_230805.mem),
                                                                            &mem_230805.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220503,
                                                                            25,
                                                                            sizeof(mem_230810.mem),
                                                                            &mem_230810.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220503,
                                                                            26,
                                                                            sizeof(mem_230814.mem),
                                                                            &mem_230814.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220503,
                                                                            27,
                                                                            sizeof(segred_tmp_mem_235032.mem),
                                                                            &segred_tmp_mem_235032.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220503,
                                                                            28,
                                                                            sizeof(segred_tmp_mem_235034.mem),
                                                                            &segred_tmp_mem_235034.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220503,
                                                                            29,
                                                                            sizeof(mainzicounter_mem_235036.mem),
                                                                            &mainzicounter_mem_235036.mem));
                                    if (1 * ((size_t) num_groups_220496 *
                                             (size_t) segred_group_sizze_220495) !=
                                        0) {
                                        const size_t global_work_sizze_237369[1]
                                                     =
                                                     {(size_t) num_groups_220496 *
                                                     (size_t) segred_group_sizze_220495};
                                        const size_t local_work_sizze_237373[1]
                                                     =
                                                     {(size_t) segred_group_sizze_220495};
                                        int64_t time_start_237370 = 0,
                                                time_end_237371 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                    "main.segred_large_220503",
                                                    global_work_sizze_237369[0],
                                                    local_work_sizze_237373[0],
                                                    (int) (0 + 1 + (int64_t) 8 *
                                                           segred_group_sizze_220495 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_220495));
                                            time_start_237370 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_large_220503,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237369,
                                                                                        local_work_sizze_237373,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_large_220503_runs,
                                                                                                                                  &ctx->mainzisegred_large_220503_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237371 = get_wall_time();
                                            
                                            long time_diff_237372 =
                                                 time_end_237371 -
                                                 time_start_237370;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_large_220503",
                                                    time_diff_237372);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235034,
                                                              "segred_tmp_mem_235034") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235032,
                                                              "segred_tmp_mem_235032") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_unref_device(ctx, &mem_230797,
                                                          "mem_230797") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230801,
                                                          "mem_230801") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230805,
                                                          "mem_230805") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230816,
                                                        &mem_230810,
                                                        "mem_230810") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230815,
                                                        &mem_230814,
                                                        "mem_230814") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230814,
                                                          "mem_230814") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230810,
                                                          "mem_230810") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230805,
                                                          "mem_230805") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230801,
                                                          "mem_230801") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230797,
                                                          "mem_230797") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230792,
                                                          "mem_230792") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230788,
                                                          "mem_230788") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230784,
                                                          "mem_230784") != 0)
                                    return 1;
                            }
                            if (memblock_set_device(ctx, &ext_mem_230828,
                                                    &ext_mem_230816,
                                                    "ext_mem_230816") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230827,
                                                    &ext_mem_230815,
                                                    "ext_mem_230815") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230815,
                                                      "ext_mem_230815") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230816,
                                                      "ext_mem_230816") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_230953,
                                                &ext_mem_230828,
                                                "ext_mem_230828") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230952,
                                                &ext_mem_230827,
                                                "ext_mem_230827") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230827,
                                                  "ext_mem_230827") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230828,
                                                  "ext_mem_230828") != 0)
                            return 1;
                    } else {
                        bool suff_outer_par_220559;
                        
                        suff_outer_par_220559 =
                            *ctx->tuning_params.mainzisuff_outer_par_26 <=
                            partition_sizze_203667;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_26",
                                    (long) partition_sizze_203667,
                                    suff_outer_par_220559 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_220693;
                        
                        segmap_group_sizze_220693 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_220563;
                        
                        int64_t num_groups_220694;
                        int32_t max_num_groups_235080;
                        
                        max_num_groups_235080 =
                            *ctx->tuning_params.mainzisegmap_num_groups_220565;
                        num_groups_220694 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(partition_sizze_203667,
                                                                                 segmap_group_sizze_220693),
                                                                       sext_i32_i64(max_num_groups_235080))));
                        
                        int64_t segmap_group_sizze_221357;
                        
                        segmap_group_sizze_221357 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_220827;
                        
                        bool suff_outer_par_221361;
                        
                        suff_outer_par_221361 =
                            *ctx->tuning_params.mainzisuff_outer_par_27 <=
                            nest_sizze_209582;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_27",
                                    (long) nest_sizze_209582,
                                    suff_outer_par_221361 ? "true" : "false");
                        
                        int64_t nest_sizze_221501 = q_l_203577 *
                                nest_sizze_209582;
                        int64_t segred_group_sizze_221502;
                        
                        segred_group_sizze_221502 =
                            *ctx->tuning_params.mainzisegred_group_sizze_221099;
                        
                        int64_t num_groups_221503;
                        int32_t max_num_groups_235081;
                        
                        max_num_groups_235081 =
                            *ctx->tuning_params.mainzisegred_num_groups_221101;
                        num_groups_221503 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_221501,
                                                                                 segred_group_sizze_221502),
                                                                       sext_i32_i64(max_num_groups_235081))));
                        
                        int64_t segmap_group_sizze_221560;
                        
                        segmap_group_sizze_221560 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_221058;
                        
                        int64_t segred_group_sizze_221603;
                        
                        segred_group_sizze_221603 =
                            *ctx->tuning_params.mainzisegred_group_sizze_220973;
                        
                        int64_t num_groups_221604;
                        int32_t max_num_groups_235082;
                        
                        max_num_groups_235082 =
                            *ctx->tuning_params.mainzisegred_num_groups_220975;
                        num_groups_221604 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_221501,
                                                                                 segred_group_sizze_221603),
                                                                       sext_i32_i64(max_num_groups_235082))));
                        
                        int64_t num_threads_232282 = segmap_group_sizze_220693 *
                                num_groups_220694;
                        int64_t total_sizze_232283 = bytes_229479 *
                                num_threads_232282;
                        int64_t total_sizze_232284 = bytes_229479 *
                                num_threads_232282;
                        struct memblock_device ext_mem_230951;
                        
                        ext_mem_230951.references = NULL;
                        
                        struct memblock_device ext_mem_230950;
                        
                        ext_mem_230950.references = NULL;
                        
                        int32_t local_memory_capacity_235361;
                        
                        local_memory_capacity_235361 =
                            ctx->opencl.max_local_memory;
                        if ((sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_235361)) &&
                             sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_235361))) &&
                            suff_outer_par_220559) {
                            struct memblock_device mem_230831;
                            
                            mem_230831.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230831,
                                                      binop_y_229485,
                                                      "mem_230831")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_230831,
                                                                      (int64_t) 0,
                                                                      ext_mem_229520,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      l_n_m_203733,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230831,
                                                          "mem_230831") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230950,
                                                          "ext_mem_230950") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230951,
                                                          "ext_mem_230951") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230952,
                                                          "ext_mem_230952") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230953,
                                                          "ext_mem_230953") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230954,
                                                          "ext_mem_230954") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230955,
                                                          "ext_mem_230955") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230834;
                            
                            mem_230834.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230834,
                                                      binop_y_229485,
                                                      "mem_230834")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230834,
                                                                      (int64_t) 0,
                                                                      ext_mem_229519,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      l_n_m_203733,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230834,
                                                          "mem_230834") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230831,
                                                          "mem_230831") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230950,
                                                          "ext_mem_230950") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230951,
                                                          "ext_mem_230951") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230952,
                                                          "ext_mem_230952") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230953,
                                                          "ext_mem_230953") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230954,
                                                          "ext_mem_230954") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230955,
                                                          "ext_mem_230955") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230837;
                            
                            mem_230837.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230837,
                                                      binop_y_229284,
                                                      "mem_230837")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            int64_t group_sizze_235086;
                            
                            group_sizze_235086 =
                                *ctx->tuning_params.mainzigroup_sizze_235086;
                            
                            int64_t num_groups_235087 =
                                    sdiv_up64(partition_sizze_203667 * n_203572,
                                              group_sizze_235086);
                            
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235083,
                                                                    0,
                                                                    sizeof(n_203572),
                                                                    &n_203572));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235083,
                                                                    1,
                                                                    sizeof(partition_sizze_203667),
                                                                    &partition_sizze_203667));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235083,
                                                                    2,
                                                                    sizeof(ctx_param_ext_229596),
                                                                    &ctx_param_ext_229596));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235083,
                                                                    3,
                                                                    sizeof(ctx_param_ext_229597),
                                                                    &ctx_param_ext_229597));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235083,
                                                                    4,
                                                                    sizeof(ctx_param_ext_229599),
                                                                    &ctx_param_ext_229599));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235083,
                                                                    5,
                                                                    sizeof(mem_param_229601.mem),
                                                                    &mem_param_229601.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235083,
                                                                    6,
                                                                    sizeof(mem_230837.mem),
                                                                    &mem_230837.mem));
                            if (1 * ((size_t) num_groups_235087 *
                                     (size_t) group_sizze_235086) != 0) {
                                const size_t global_work_sizze_237374[1] =
                                             {(size_t) num_groups_235087 *
                                             (size_t) group_sizze_235086};
                                const size_t local_work_sizze_237378[1] =
                                             {(size_t) group_sizze_235086};
                                int64_t time_start_237375 = 0, time_end_237376 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                            "main.copy_235083",
                                            global_work_sizze_237374[0],
                                            local_work_sizze_237378[0],
                                            (int) 0);
                                    time_start_237375 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzicopy_235083,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237374,
                                                                                local_work_sizze_237378,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzicopy_235083_runs,
                                                                                                                          &ctx->mainzicopy_235083_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237376 = get_wall_time();
                                    
                                    long time_diff_237377 = time_end_237376 -
                                         time_start_237375;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.copy_235083",
                                            time_diff_237377);
                                }
                            }
                            
                            struct memblock_device mem_230840;
                            
                            mem_230840.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230840,
                                                      binop_y_229284,
                                                      "mem_230840")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230840,
                                                                      (int64_t) 0,
                                                                      mem_230659,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_203572,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230840,
                                                          "mem_230840") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230837,
                                                          "mem_230837") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230834,
                                                          "mem_230834") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230831,
                                                          "mem_230831") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230950,
                                                          "ext_mem_230950") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230951,
                                                          "ext_mem_230951") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230952,
                                                          "ext_mem_230952") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230953,
                                                          "ext_mem_230953") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230954,
                                                          "ext_mem_230954") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230955,
                                                          "ext_mem_230955") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230874;
                            
                            mem_230874.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230874,
                                                      binop_y_229485,
                                                      "mem_230874")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230877;
                            
                            mem_230877.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230877,
                                                      binop_y_229485,
                                                      "mem_230877")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232141;
                            
                            color_232141.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232141,
                                                      total_sizze_232283,
                                                      "color_232141")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232142;
                            
                            color_232142.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232142,
                                                      total_sizze_232284,
                                                      "color_232142")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220699,
                                                                    1,
                                                                    sizeof(n_203572),
                                                                    &n_203572));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220699,
                                                                    2,
                                                                    sizeof(q_l_203577),
                                                                    &q_l_203577));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220699,
                                                                    3,
                                                                    sizeof(jump_t_203582),
                                                                    &jump_t_203582));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220699,
                                                                    4,
                                                                    sizeof(partition_sizze_203667),
                                                                    &partition_sizze_203667));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220699,
                                                                    5,
                                                                    sizeof(l_n_m_203733),
                                                                    &l_n_m_203733));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220699,
                                                                    6,
                                                                    sizeof(i_203760),
                                                                    &i_203760));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220699,
                                                                    7,
                                                                    sizeof(num_groups_220694),
                                                                    &num_groups_220694));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220699,
                                                                    8,
                                                                    sizeof(num_threads_232282),
                                                                    &num_threads_232282));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220699,
                                                                    9,
                                                                    sizeof(mem_230831.mem),
                                                                    &mem_230831.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220699,
                                                                    10,
                                                                    sizeof(mem_230834.mem),
                                                                    &mem_230834.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220699,
                                                                    11,
                                                                    sizeof(mem_230837.mem),
                                                                    &mem_230837.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220699,
                                                                    12,
                                                                    sizeof(mem_230840.mem),
                                                                    &mem_230840.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220699,
                                                                    13,
                                                                    sizeof(mem_230874.mem),
                                                                    &mem_230874.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220699,
                                                                    14,
                                                                    sizeof(mem_230877.mem),
                                                                    &mem_230877.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220699,
                                                                    15,
                                                                    sizeof(color_232141.mem),
                                                                    &color_232141.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220699,
                                                                    16,
                                                                    sizeof(color_232142.mem),
                                                                    &color_232142.mem));
                            if (1 * ((size_t) num_groups_220694 *
                                     (size_t) segmap_group_sizze_220693) != 0) {
                                const size_t global_work_sizze_237379[1] =
                                             {(size_t) num_groups_220694 *
                                             (size_t) segmap_group_sizze_220693};
                                const size_t local_work_sizze_237383[1] =
                                             {(size_t) segmap_group_sizze_220693};
                                int64_t time_start_237380 = 0, time_end_237381 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                            "main.segmap_220699",
                                            global_work_sizze_237379[0],
                                            local_work_sizze_237383[0],
                                            (int) 0);
                                    time_start_237380 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_220699,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237379,
                                                                                local_work_sizze_237383,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_220699_runs,
                                                                                                                          &ctx->mainzisegmap_220699_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237381 = get_wall_time();
                                    
                                    long time_diff_237382 = time_end_237381 -
                                         time_start_237380;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_220699",
                                            time_diff_237382);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_230831,
                                                      "mem_230831") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230834,
                                                      "mem_230834") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230837,
                                                      "mem_230837") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230840,
                                                      "mem_230840") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232141,
                                                      "color_232141") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232142,
                                                      "color_232142") != 0)
                                return 1;
                            
                            struct memblock_device mem_230943;
                            
                            mem_230943.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230943,
                                                      bytes_229486,
                                                      "mem_230943")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230943,
                                                                      (int64_t) 0,
                                                                      mem_230874,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203667,
                                                                      l_n_m_203733) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230943,
                                                          "mem_230943") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232142,
                                                          "color_232142") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232141,
                                                          "color_232141") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230877,
                                                          "mem_230877") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230874,
                                                          "mem_230874") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230840,
                                                          "mem_230840") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230837,
                                                          "mem_230837") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230834,
                                                          "mem_230834") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230831,
                                                          "mem_230831") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230950,
                                                          "ext_mem_230950") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230951,
                                                          "ext_mem_230951") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230952,
                                                          "ext_mem_230952") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230953,
                                                          "ext_mem_230953") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230954,
                                                          "ext_mem_230954") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230955,
                                                          "ext_mem_230955") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_230874,
                                                      "mem_230874") != 0)
                                return 1;
                            
                            struct memblock_device mem_230948;
                            
                            mem_230948.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230948,
                                                      bytes_229486,
                                                      "mem_230948")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230948,
                                                                      (int64_t) 0,
                                                                      mem_230877,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203667,
                                                                      l_n_m_203733) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230948,
                                                          "mem_230948") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230943,
                                                          "mem_230943") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232142,
                                                          "color_232142") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232141,
                                                          "color_232141") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230877,
                                                          "mem_230877") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230874,
                                                          "mem_230874") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230840,
                                                          "mem_230840") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230837,
                                                          "mem_230837") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230834,
                                                          "mem_230834") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230831,
                                                          "mem_230831") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230950,
                                                          "ext_mem_230950") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230951,
                                                          "ext_mem_230951") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230952,
                                                          "ext_mem_230952") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230953,
                                                          "ext_mem_230953") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230954,
                                                          "ext_mem_230954") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230955,
                                                          "ext_mem_230955") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_230877,
                                                      "mem_230877") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230951,
                                                    &mem_230943,
                                                    "mem_230943") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230950,
                                                    &mem_230948,
                                                    "mem_230948") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230948,
                                                      "mem_230948") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230943,
                                                      "mem_230943") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232142,
                                                      "color_232142") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232141,
                                                      "color_232141") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230877,
                                                      "mem_230877") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230874,
                                                      "mem_230874") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230840,
                                                      "mem_230840") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230837,
                                                      "mem_230837") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230834,
                                                      "mem_230834") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230831,
                                                      "mem_230831") != 0)
                                return 1;
                        } else {
                            int64_t segmap_usable_groups_221358 =
                                    sdiv_up64(nest_sizze_209582,
                                              segmap_group_sizze_221357);
                            struct memblock_device ext_mem_230939;
                            
                            ext_mem_230939.references = NULL;
                            
                            struct memblock_device ext_mem_230938;
                            
                            ext_mem_230938.references = NULL;
                            
                            int32_t local_memory_capacity_235360;
                            
                            local_memory_capacity_235360 =
                                ctx->opencl.max_local_memory;
                            if (sle64((int64_t) 0,
                                      sext_i32_i64(local_memory_capacity_235360)) &&
                                suff_outer_par_221361) {
                                struct memblock_device mem_230882;
                                
                                mem_230882.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230882,
                                                          bytes_229486,
                                                          "mem_230882")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230886;
                                
                                mem_230886.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230886,
                                                          bytes_229486,
                                                          "mem_230886")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221368,
                                                                        1,
                                                                        sizeof(n_203572),
                                                                        &n_203572));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221368,
                                                                        2,
                                                                        sizeof(q_l_203577),
                                                                        &q_l_203577));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221368,
                                                                        3,
                                                                        sizeof(jump_t_203582),
                                                                        &jump_t_203582));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221368,
                                                                        4,
                                                                        sizeof(partition_sizze_203667),
                                                                        &partition_sizze_203667));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221368,
                                                                        5,
                                                                        sizeof(l_n_m_203733),
                                                                        &l_n_m_203733));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221368,
                                                                        6,
                                                                        sizeof(i_203760),
                                                                        &i_203760));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221368,
                                                                        7,
                                                                        sizeof(ctx_param_ext_229596),
                                                                        &ctx_param_ext_229596));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221368,
                                                                        8,
                                                                        sizeof(ctx_param_ext_229597),
                                                                        &ctx_param_ext_229597));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221368,
                                                                        9,
                                                                        sizeof(ctx_param_ext_229599),
                                                                        &ctx_param_ext_229599));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221368,
                                                                        10,
                                                                        sizeof(ext_mem_229519.mem),
                                                                        &ext_mem_229519.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221368,
                                                                        11,
                                                                        sizeof(ext_mem_229520.mem),
                                                                        &ext_mem_229520.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221368,
                                                                        12,
                                                                        sizeof(mem_param_229601.mem),
                                                                        &mem_param_229601.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221368,
                                                                        13,
                                                                        sizeof(mem_230659.mem),
                                                                        &mem_230659.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221368,
                                                                        14,
                                                                        sizeof(mem_230882.mem),
                                                                        &mem_230882.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221368,
                                                                        15,
                                                                        sizeof(mem_230886.mem),
                                                                        &mem_230886.mem));
                                if (1 * ((size_t) segmap_usable_groups_221358 *
                                         (size_t) segmap_group_sizze_221357) !=
                                    0) {
                                    const size_t global_work_sizze_237384[1] =
                                                 {(size_t) segmap_usable_groups_221358 *
                                                 (size_t) segmap_group_sizze_221357};
                                    const size_t local_work_sizze_237388[1] =
                                                 {(size_t) segmap_group_sizze_221357};
                                    int64_t time_start_237385 = 0,
                                            time_end_237386 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                "main.segmap_221368",
                                                global_work_sizze_237384[0],
                                                local_work_sizze_237388[0],
                                                (int) 0);
                                        time_start_237385 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegmap_221368,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237384,
                                                                                    local_work_sizze_237388,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegmap_221368_runs,
                                                                                                                              &ctx->mainzisegmap_221368_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237386 = get_wall_time();
                                        
                                        long time_diff_237387 =
                                             time_end_237386 -
                                             time_start_237385;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segmap_221368",
                                                time_diff_237387);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_set_device(ctx, &ext_mem_230939,
                                                        &mem_230882,
                                                        "mem_230882") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230938,
                                                        &mem_230886,
                                                        "mem_230886") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230886,
                                                          "mem_230886") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230882,
                                                          "mem_230882") != 0)
                                    return 1;
                            } else {
                                struct memblock_device mem_230891;
                                
                                mem_230891.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230891,
                                                          bytes_229486,
                                                          "mem_230891")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230895;
                                
                                mem_230895.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230895,
                                                          bytes_229486,
                                                          "mem_230895")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230899;
                                
                                mem_230899.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230899,
                                                          bytes_229486,
                                                          "mem_230899")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230903;
                                
                                mem_230903.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230903,
                                                          bytes_229486,
                                                          "mem_230903")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230907;
                                
                                mem_230907.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230907,
                                                          bytes_229486,
                                                          "mem_230907")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_l_203577 * (int64_t) 2,
                                          segred_group_sizze_221502)) {
                                    int64_t segment_sizze_nonzzero_235136 =
                                            smax64((int64_t) 1, q_l_203577);
                                    int64_t num_threads_235137 =
                                            num_groups_221503 *
                                            segred_group_sizze_221502;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-small");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             l_n_m_203733),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203577, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_221502,
                                                                    segment_sizze_nonzzero_235136),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                                   l_n_m_203733,
                                                                                   squot64(segred_group_sizze_221502,
                                                                                           segment_sizze_nonzzero_235136))),
                                                '\n');
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221513,
                                                                            1,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_221502),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221513,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_221502),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221513,
                                                                            3,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_221502),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221513,
                                                                            4,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_221502),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221513,
                                                                            5,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_221502),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221513,
                                                                            6,
                                                                            sizeof(n_203572),
                                                                            &n_203572));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221513,
                                                                            7,
                                                                            sizeof(q_l_203577),
                                                                            &q_l_203577));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221513,
                                                                            8,
                                                                            sizeof(jump_t_203582),
                                                                            &jump_t_203582));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221513,
                                                                            9,
                                                                            sizeof(partition_sizze_203667),
                                                                            &partition_sizze_203667));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221513,
                                                                            10,
                                                                            sizeof(l_n_m_203733),
                                                                            &l_n_m_203733));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221513,
                                                                            11,
                                                                            sizeof(i_203760),
                                                                            &i_203760));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221513,
                                                                            12,
                                                                            sizeof(num_groups_221503),
                                                                            &num_groups_221503));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221513,
                                                                            13,
                                                                            sizeof(ctx_param_ext_229596),
                                                                            &ctx_param_ext_229596));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221513,
                                                                            14,
                                                                            sizeof(ctx_param_ext_229597),
                                                                            &ctx_param_ext_229597));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221513,
                                                                            15,
                                                                            sizeof(ctx_param_ext_229599),
                                                                            &ctx_param_ext_229599));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221513,
                                                                            16,
                                                                            sizeof(segment_sizze_nonzzero_235136),
                                                                            &segment_sizze_nonzzero_235136));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221513,
                                                                            17,
                                                                            sizeof(ext_mem_229519.mem),
                                                                            &ext_mem_229519.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221513,
                                                                            18,
                                                                            sizeof(ext_mem_229520.mem),
                                                                            &ext_mem_229520.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221513,
                                                                            19,
                                                                            sizeof(mem_param_229601.mem),
                                                                            &mem_param_229601.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221513,
                                                                            20,
                                                                            sizeof(mem_230891.mem),
                                                                            &mem_230891.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221513,
                                                                            21,
                                                                            sizeof(mem_230895.mem),
                                                                            &mem_230895.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221513,
                                                                            22,
                                                                            sizeof(mem_230899.mem),
                                                                            &mem_230899.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221513,
                                                                            23,
                                                                            sizeof(mem_230903.mem),
                                                                            &mem_230903.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221513,
                                                                            24,
                                                                            sizeof(mem_230907.mem),
                                                                            &mem_230907.mem));
                                    if (1 * ((size_t) num_groups_221503 *
                                             (size_t) segred_group_sizze_221502) !=
                                        0) {
                                        const size_t global_work_sizze_237389[1]
                                                     =
                                                     {(size_t) num_groups_221503 *
                                                     (size_t) segred_group_sizze_221502};
                                        const size_t local_work_sizze_237393[1]
                                                     =
                                                     {(size_t) segred_group_sizze_221502};
                                        int64_t time_start_237390 = 0,
                                                time_end_237391 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                    "main.segred_small_221513",
                                                    global_work_sizze_237389[0],
                                                    local_work_sizze_237393[0],
                                                    (int) (0 + (int64_t) 8 *
                                                           segred_group_sizze_221502 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_221502 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_221502 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_221502 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_221502));
                                            time_start_237390 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_small_221513,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237389,
                                                                                        local_work_sizze_237393,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_small_221513_runs,
                                                                                                                                  &ctx->mainzisegred_small_221513_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237391 = get_wall_time();
                                            
                                            long time_diff_237392 =
                                                 time_end_237391 -
                                                 time_start_237390;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_small_221513",
                                                    time_diff_237392);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_235189 =
                                            sdiv_up64(num_groups_221503,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203667 *
                                                             l_n_m_203733));
                                    int64_t elements_per_thread_235190 =
                                            sdiv_up64(q_l_203577,
                                                      segred_group_sizze_221502 *
                                                      groups_per_segment_235189);
                                    int64_t virt_num_groups_235191 =
                                            groups_per_segment_235189 *
                                            (partition_sizze_203667 *
                                             l_n_m_203733);
                                    int64_t num_threads_235192 =
                                            num_groups_221503 *
                                            segred_group_sizze_221502;
                                    int64_t threads_per_segment_235193 =
                                            groups_per_segment_235189 *
                                            segred_group_sizze_221502;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-large");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             l_n_m_203733),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203577, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_235191,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_221503,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_221502,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_235190,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_235189,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235194;
                                    
                                    segred_tmp_mem_235194.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235194,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235191,
                                                              "segred_tmp_mem_235194")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235196;
                                    
                                    segred_tmp_mem_235196.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235196,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235191,
                                                              "segred_tmp_mem_235196")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235198;
                                    
                                    segred_tmp_mem_235198.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235198,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235191,
                                                              "segred_tmp_mem_235198")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235200;
                                    
                                    segred_tmp_mem_235200.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235200,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235191,
                                                              "segred_tmp_mem_235200")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235202;
                                    
                                    segred_tmp_mem_235202.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235202,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235191,
                                                              "segred_tmp_mem_235202")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_235204 =
                                    ctx->mainzicounter_mem_235204;
                                    
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            1,
                                                                            (size_t) 1,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_221502),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            3,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_221502),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            4,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_221502),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            5,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_221502),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            6,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_221502),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            7,
                                                                            sizeof(n_203572),
                                                                            &n_203572));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            8,
                                                                            sizeof(q_l_203577),
                                                                            &q_l_203577));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            9,
                                                                            sizeof(jump_t_203582),
                                                                            &jump_t_203582));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            10,
                                                                            sizeof(partition_sizze_203667),
                                                                            &partition_sizze_203667));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            11,
                                                                            sizeof(l_n_m_203733),
                                                                            &l_n_m_203733));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            12,
                                                                            sizeof(i_203760),
                                                                            &i_203760));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            13,
                                                                            sizeof(num_groups_221503),
                                                                            &num_groups_221503));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            14,
                                                                            sizeof(ctx_param_ext_229596),
                                                                            &ctx_param_ext_229596));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            15,
                                                                            sizeof(ctx_param_ext_229597),
                                                                            &ctx_param_ext_229597));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            16,
                                                                            sizeof(ctx_param_ext_229599),
                                                                            &ctx_param_ext_229599));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            17,
                                                                            sizeof(groups_per_segment_235189),
                                                                            &groups_per_segment_235189));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            18,
                                                                            sizeof(elements_per_thread_235190),
                                                                            &elements_per_thread_235190));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            19,
                                                                            sizeof(virt_num_groups_235191),
                                                                            &virt_num_groups_235191));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            20,
                                                                            sizeof(threads_per_segment_235193),
                                                                            &threads_per_segment_235193));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            21,
                                                                            sizeof(ext_mem_229519.mem),
                                                                            &ext_mem_229519.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            22,
                                                                            sizeof(ext_mem_229520.mem),
                                                                            &ext_mem_229520.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            23,
                                                                            sizeof(mem_param_229601.mem),
                                                                            &mem_param_229601.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            24,
                                                                            sizeof(mem_230891.mem),
                                                                            &mem_230891.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            25,
                                                                            sizeof(mem_230895.mem),
                                                                            &mem_230895.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            26,
                                                                            sizeof(mem_230899.mem),
                                                                            &mem_230899.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            27,
                                                                            sizeof(mem_230903.mem),
                                                                            &mem_230903.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            28,
                                                                            sizeof(mem_230907.mem),
                                                                            &mem_230907.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            29,
                                                                            sizeof(segred_tmp_mem_235194.mem),
                                                                            &segred_tmp_mem_235194.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            30,
                                                                            sizeof(segred_tmp_mem_235196.mem),
                                                                            &segred_tmp_mem_235196.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            31,
                                                                            sizeof(segred_tmp_mem_235198.mem),
                                                                            &segred_tmp_mem_235198.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            32,
                                                                            sizeof(segred_tmp_mem_235200.mem),
                                                                            &segred_tmp_mem_235200.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            33,
                                                                            sizeof(segred_tmp_mem_235202.mem),
                                                                            &segred_tmp_mem_235202.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221513,
                                                                            34,
                                                                            sizeof(mainzicounter_mem_235204.mem),
                                                                            &mainzicounter_mem_235204.mem));
                                    if (1 * ((size_t) num_groups_221503 *
                                             (size_t) segred_group_sizze_221502) !=
                                        0) {
                                        const size_t global_work_sizze_237395[1]
                                                     =
                                                     {(size_t) num_groups_221503 *
                                                     (size_t) segred_group_sizze_221502};
                                        const size_t local_work_sizze_237399[1]
                                                     =
                                                     {(size_t) segred_group_sizze_221502};
                                        int64_t time_start_237396 = 0,
                                                time_end_237397 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                    "main.segred_large_221513",
                                                    global_work_sizze_237395[0],
                                                    local_work_sizze_237399[0],
                                                    (int) (0 + 1 + (int64_t) 8 *
                                                           segred_group_sizze_221502 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_221502 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_221502 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_221502 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_221502));
                                            time_start_237396 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_large_221513,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237395,
                                                                                        local_work_sizze_237399,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_large_221513_runs,
                                                                                                                                  &ctx->mainzisegred_large_221513_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237397 = get_wall_time();
                                            
                                            long time_diff_237398 =
                                                 time_end_237397 -
                                                 time_start_237396;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_large_221513",
                                                    time_diff_237398);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235202,
                                                              "segred_tmp_mem_235202") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235200,
                                                              "segred_tmp_mem_235200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235198,
                                                              "segred_tmp_mem_235198") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235196,
                                                              "segred_tmp_mem_235196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235194,
                                                              "segred_tmp_mem_235194") !=
                                        0)
                                        return 1;
                                }
                                
                                int64_t segmap_usable_groups_221561 =
                                        sdiv_up64(nest_sizze_209582,
                                                  segmap_group_sizze_221560);
                                struct memblock_device mem_230912;
                                
                                mem_230912.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230912,
                                                          bytes_229486,
                                                          "mem_230912")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230916;
                                
                                mem_230916.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230916,
                                                          bytes_229486,
                                                          "mem_230916")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230920;
                                
                                mem_230920.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230920,
                                                          bytes_229486,
                                                          "mem_230920")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230924;
                                
                                mem_230924.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230924,
                                                          bytes_229486,
                                                          "mem_230924")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230928;
                                
                                mem_230928.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230928,
                                                          bytes_229486,
                                                          "mem_230928")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221569,
                                                                        1,
                                                                        sizeof(partition_sizze_203667),
                                                                        &partition_sizze_203667));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221569,
                                                                        2,
                                                                        sizeof(l_n_m_203733),
                                                                        &l_n_m_203733));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221569,
                                                                        3,
                                                                        sizeof(mem_230891.mem),
                                                                        &mem_230891.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221569,
                                                                        4,
                                                                        sizeof(mem_230895.mem),
                                                                        &mem_230895.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221569,
                                                                        5,
                                                                        sizeof(mem_230899.mem),
                                                                        &mem_230899.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221569,
                                                                        6,
                                                                        sizeof(mem_230903.mem),
                                                                        &mem_230903.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221569,
                                                                        7,
                                                                        sizeof(mem_230907.mem),
                                                                        &mem_230907.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221569,
                                                                        8,
                                                                        sizeof(mem_230912.mem),
                                                                        &mem_230912.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221569,
                                                                        9,
                                                                        sizeof(mem_230916.mem),
                                                                        &mem_230916.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221569,
                                                                        10,
                                                                        sizeof(mem_230920.mem),
                                                                        &mem_230920.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221569,
                                                                        11,
                                                                        sizeof(mem_230924.mem),
                                                                        &mem_230924.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221569,
                                                                        12,
                                                                        sizeof(mem_230928.mem),
                                                                        &mem_230928.mem));
                                if (1 * ((size_t) segmap_usable_groups_221561 *
                                         (size_t) segmap_group_sizze_221560) !=
                                    0) {
                                    const size_t global_work_sizze_237400[1] =
                                                 {(size_t) segmap_usable_groups_221561 *
                                                 (size_t) segmap_group_sizze_221560};
                                    const size_t local_work_sizze_237404[1] =
                                                 {(size_t) segmap_group_sizze_221560};
                                    int64_t time_start_237401 = 0,
                                            time_end_237402 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                "main.segmap_221569",
                                                global_work_sizze_237400[0],
                                                local_work_sizze_237404[0],
                                                (int) 0);
                                        time_start_237401 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegmap_221569,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237400,
                                                                                    local_work_sizze_237404,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegmap_221569_runs,
                                                                                                                              &ctx->mainzisegmap_221569_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237402 = get_wall_time();
                                        
                                        long time_diff_237403 =
                                             time_end_237402 -
                                             time_start_237401;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segmap_221569",
                                                time_diff_237403);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx, &mem_230891,
                                                          "mem_230891") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230895,
                                                          "mem_230895") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230899,
                                                          "mem_230899") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230903,
                                                          "mem_230903") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230907,
                                                          "mem_230907") != 0)
                                    return 1;
                                
                                struct memblock_device mem_230933;
                                
                                mem_230933.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230933,
                                                          bytes_229486,
                                                          "mem_230933")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230937;
                                
                                mem_230937.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230937,
                                                          bytes_229486,
                                                          "mem_230937")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_l_203577 * (int64_t) 2,
                                          segred_group_sizze_221603)) {
                                    int64_t segment_sizze_nonzzero_235274 =
                                            smax64((int64_t) 1, q_l_203577);
                                    int64_t num_threads_235275 =
                                            num_groups_221604 *
                                            segred_group_sizze_221603;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-small");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             l_n_m_203733),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203577, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_221603,
                                                                    segment_sizze_nonzzero_235274),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                                   l_n_m_203733,
                                                                                   squot64(segred_group_sizze_221603,
                                                                                           segment_sizze_nonzzero_235274))),
                                                '\n');
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221611,
                                                                            1,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_221603),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221611,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_221603),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221611,
                                                                            3,
                                                                            sizeof(n_203572),
                                                                            &n_203572));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221611,
                                                                            4,
                                                                            sizeof(q_l_203577),
                                                                            &q_l_203577));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221611,
                                                                            5,
                                                                            sizeof(jump_t_203582),
                                                                            &jump_t_203582));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221611,
                                                                            6,
                                                                            sizeof(partition_sizze_203667),
                                                                            &partition_sizze_203667));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221611,
                                                                            7,
                                                                            sizeof(l_n_m_203733),
                                                                            &l_n_m_203733));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221611,
                                                                            8,
                                                                            sizeof(i_203760),
                                                                            &i_203760));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221611,
                                                                            9,
                                                                            sizeof(num_groups_221604),
                                                                            &num_groups_221604));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221611,
                                                                            10,
                                                                            sizeof(ctx_param_ext_229596),
                                                                            &ctx_param_ext_229596));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221611,
                                                                            11,
                                                                            sizeof(ctx_param_ext_229597),
                                                                            &ctx_param_ext_229597));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221611,
                                                                            12,
                                                                            sizeof(ctx_param_ext_229599),
                                                                            &ctx_param_ext_229599));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221611,
                                                                            13,
                                                                            sizeof(segment_sizze_nonzzero_235274),
                                                                            &segment_sizze_nonzzero_235274));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221611,
                                                                            14,
                                                                            sizeof(ext_mem_229519.mem),
                                                                            &ext_mem_229519.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221611,
                                                                            15,
                                                                            sizeof(ext_mem_229520.mem),
                                                                            &ext_mem_229520.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221611,
                                                                            16,
                                                                            sizeof(mem_param_229601.mem),
                                                                            &mem_param_229601.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221611,
                                                                            17,
                                                                            sizeof(mem_230659.mem),
                                                                            &mem_230659.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221611,
                                                                            18,
                                                                            sizeof(mem_230912.mem),
                                                                            &mem_230912.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221611,
                                                                            19,
                                                                            sizeof(mem_230916.mem),
                                                                            &mem_230916.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221611,
                                                                            20,
                                                                            sizeof(mem_230920.mem),
                                                                            &mem_230920.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221611,
                                                                            21,
                                                                            sizeof(mem_230924.mem),
                                                                            &mem_230924.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221611,
                                                                            22,
                                                                            sizeof(mem_230928.mem),
                                                                            &mem_230928.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221611,
                                                                            23,
                                                                            sizeof(mem_230933.mem),
                                                                            &mem_230933.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221611,
                                                                            24,
                                                                            sizeof(mem_230937.mem),
                                                                            &mem_230937.mem));
                                    if (1 * ((size_t) num_groups_221604 *
                                             (size_t) segred_group_sizze_221603) !=
                                        0) {
                                        const size_t global_work_sizze_237405[1]
                                                     =
                                                     {(size_t) num_groups_221604 *
                                                     (size_t) segred_group_sizze_221603};
                                        const size_t local_work_sizze_237409[1]
                                                     =
                                                     {(size_t) segred_group_sizze_221603};
                                        int64_t time_start_237406 = 0,
                                                time_end_237407 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                    "main.segred_small_221611",
                                                    global_work_sizze_237405[0],
                                                    local_work_sizze_237409[0],
                                                    (int) (0 + (int64_t) 8 *
                                                           segred_group_sizze_221603 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_221603));
                                            time_start_237406 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_small_221611,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237405,
                                                                                        local_work_sizze_237409,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_small_221611_runs,
                                                                                                                                  &ctx->mainzisegred_small_221611_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237407 = get_wall_time();
                                            
                                            long time_diff_237408 =
                                                 time_end_237407 -
                                                 time_start_237406;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_small_221611",
                                                    time_diff_237408);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_235309 =
                                            sdiv_up64(num_groups_221604,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203667 *
                                                             l_n_m_203733));
                                    int64_t elements_per_thread_235310 =
                                            sdiv_up64(q_l_203577,
                                                      segred_group_sizze_221603 *
                                                      groups_per_segment_235309);
                                    int64_t virt_num_groups_235311 =
                                            groups_per_segment_235309 *
                                            (partition_sizze_203667 *
                                             l_n_m_203733);
                                    int64_t num_threads_235312 =
                                            num_groups_221604 *
                                            segred_group_sizze_221603;
                                    int64_t threads_per_segment_235313 =
                                            groups_per_segment_235309 *
                                            segred_group_sizze_221603;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-large");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             l_n_m_203733),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203577, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_235311,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_221604,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_221603,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_235310,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_235309,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235314;
                                    
                                    segred_tmp_mem_235314.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235314,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235311,
                                                              "segred_tmp_mem_235314")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235316;
                                    
                                    segred_tmp_mem_235316.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235316,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235311,
                                                              "segred_tmp_mem_235316")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_235318 =
                                    ctx->mainzicounter_mem_235318;
                                    
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            1,
                                                                            (size_t) 1,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_221603),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            3,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_221603),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            4,
                                                                            sizeof(n_203572),
                                                                            &n_203572));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            5,
                                                                            sizeof(q_l_203577),
                                                                            &q_l_203577));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            6,
                                                                            sizeof(jump_t_203582),
                                                                            &jump_t_203582));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            7,
                                                                            sizeof(partition_sizze_203667),
                                                                            &partition_sizze_203667));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            8,
                                                                            sizeof(l_n_m_203733),
                                                                            &l_n_m_203733));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            9,
                                                                            sizeof(i_203760),
                                                                            &i_203760));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            10,
                                                                            sizeof(num_groups_221604),
                                                                            &num_groups_221604));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            11,
                                                                            sizeof(ctx_param_ext_229596),
                                                                            &ctx_param_ext_229596));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            12,
                                                                            sizeof(ctx_param_ext_229597),
                                                                            &ctx_param_ext_229597));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            13,
                                                                            sizeof(ctx_param_ext_229599),
                                                                            &ctx_param_ext_229599));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            14,
                                                                            sizeof(groups_per_segment_235309),
                                                                            &groups_per_segment_235309));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            15,
                                                                            sizeof(elements_per_thread_235310),
                                                                            &elements_per_thread_235310));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            16,
                                                                            sizeof(virt_num_groups_235311),
                                                                            &virt_num_groups_235311));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            17,
                                                                            sizeof(threads_per_segment_235313),
                                                                            &threads_per_segment_235313));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            18,
                                                                            sizeof(ext_mem_229519.mem),
                                                                            &ext_mem_229519.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            19,
                                                                            sizeof(ext_mem_229520.mem),
                                                                            &ext_mem_229520.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            20,
                                                                            sizeof(mem_param_229601.mem),
                                                                            &mem_param_229601.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            21,
                                                                            sizeof(mem_230659.mem),
                                                                            &mem_230659.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            22,
                                                                            sizeof(mem_230912.mem),
                                                                            &mem_230912.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            23,
                                                                            sizeof(mem_230916.mem),
                                                                            &mem_230916.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            24,
                                                                            sizeof(mem_230920.mem),
                                                                            &mem_230920.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            25,
                                                                            sizeof(mem_230924.mem),
                                                                            &mem_230924.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            26,
                                                                            sizeof(mem_230928.mem),
                                                                            &mem_230928.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            27,
                                                                            sizeof(mem_230933.mem),
                                                                            &mem_230933.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            28,
                                                                            sizeof(mem_230937.mem),
                                                                            &mem_230937.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            29,
                                                                            sizeof(segred_tmp_mem_235314.mem),
                                                                            &segred_tmp_mem_235314.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            30,
                                                                            sizeof(segred_tmp_mem_235316.mem),
                                                                            &segred_tmp_mem_235316.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221611,
                                                                            31,
                                                                            sizeof(mainzicounter_mem_235318.mem),
                                                                            &mainzicounter_mem_235318.mem));
                                    if (1 * ((size_t) num_groups_221604 *
                                             (size_t) segred_group_sizze_221603) !=
                                        0) {
                                        const size_t global_work_sizze_237411[1]
                                                     =
                                                     {(size_t) num_groups_221604 *
                                                     (size_t) segred_group_sizze_221603};
                                        const size_t local_work_sizze_237415[1]
                                                     =
                                                     {(size_t) segred_group_sizze_221603};
                                        int64_t time_start_237412 = 0,
                                                time_end_237413 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                    "main.segred_large_221611",
                                                    global_work_sizze_237411[0],
                                                    local_work_sizze_237415[0],
                                                    (int) (0 + 1 + (int64_t) 8 *
                                                           segred_group_sizze_221603 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_221603));
                                            time_start_237412 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_large_221611,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237411,
                                                                                        local_work_sizze_237415,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_large_221611_runs,
                                                                                                                                  &ctx->mainzisegred_large_221611_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237413 = get_wall_time();
                                            
                                            long time_diff_237414 =
                                                 time_end_237413 -
                                                 time_start_237412;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_large_221611",
                                                    time_diff_237414);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235316,
                                                              "segred_tmp_mem_235316") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235314,
                                                              "segred_tmp_mem_235314") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_unref_device(ctx, &mem_230912,
                                                          "mem_230912") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230916,
                                                          "mem_230916") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230920,
                                                          "mem_230920") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230924,
                                                          "mem_230924") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230928,
                                                          "mem_230928") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230939,
                                                        &mem_230933,
                                                        "mem_230933") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230938,
                                                        &mem_230937,
                                                        "mem_230937") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230937,
                                                          "mem_230937") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230933,
                                                          "mem_230933") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230928,
                                                          "mem_230928") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230924,
                                                          "mem_230924") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230920,
                                                          "mem_230920") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230916,
                                                          "mem_230916") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230912,
                                                          "mem_230912") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230907,
                                                          "mem_230907") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230903,
                                                          "mem_230903") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230899,
                                                          "mem_230899") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230895,
                                                          "mem_230895") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230891,
                                                          "mem_230891") != 0)
                                    return 1;
                            }
                            if (memblock_set_device(ctx, &ext_mem_230951,
                                                    &ext_mem_230939,
                                                    "ext_mem_230939") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230950,
                                                    &ext_mem_230938,
                                                    "ext_mem_230938") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230938,
                                                      "ext_mem_230938") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230939,
                                                      "ext_mem_230939") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_230953,
                                                &ext_mem_230951,
                                                "ext_mem_230951") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230952,
                                                &ext_mem_230950,
                                                "ext_mem_230950") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230950,
                                                  "ext_mem_230950") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230951,
                                                  "ext_mem_230951") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_230955,
                                            &ext_mem_230953,
                                            "ext_mem_230953") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_230954,
                                            &ext_mem_230952,
                                            "ext_mem_230952") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230952,
                                              "ext_mem_230952") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230953,
                                              "ext_mem_230953") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_231016, &ext_mem_230955,
                                        "ext_mem_230955") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231015, &ext_mem_230954,
                                        "ext_mem_230954") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_230954,
                                          "ext_mem_230954") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_230955,
                                          "ext_mem_230955") != 0)
                    return 1;
            } else {
                bool match_lit_205574 = (int64_t) 0 == d_l_203580;
                int64_t binop_y_230962 = (int64_t) 8 * q_l_203577;
                int64_t bytes_230963 = smax64((int64_t) 0, binop_y_230962);
                struct memblock_device ext_mem_231014;
                
                ext_mem_231014.references = NULL;
                
                struct memblock_device ext_mem_231013;
                
                ext_mem_231013.references = NULL;
                if (match_lit_205574) {
                    struct memblock_device mem_230959;
                    
                    mem_230959.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_230959, bytes_229486,
                                              "mem_230959")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f64(ctx, mem_230959,
                                                      partition_sizze_203667 *
                                                      l_n_m_203733, 0.0) != 0) {
                        if (memblock_unref_device(ctx, &mem_230959,
                                                  "mem_230959") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231013,
                                                  "ext_mem_231013") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231014,
                                                  "ext_mem_231014") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231015,
                                                  "ext_mem_231015") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231016,
                                                  "ext_mem_231016") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230654,
                                                  "ext_mem_230654") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230637,
                                                  "ext_mem_230637") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230620,
                                                  "ext_mem_230620") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230602,
                                                  "ext_mem_230602") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230594,
                                                  "ext_mem_230594") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230595,
                                                  "ext_mem_230595") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229623,
                                                  "mem_param_229623") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229615,
                                                  "mem_param_229615") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231625,
                                                  "ext_mem_231625") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231626,
                                                  "ext_mem_231626") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229601,
                                                  "mem_param_229601") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229593,
                                                  "mem_param_229593") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229585,
                                                  "mem_param_229585") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231968,
                                                  "ext_mem_231968") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231969,
                                                  "ext_mem_231969") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231970,
                                                  "ext_mem_231970") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230659,
                                                  "mem_230659") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230642,
                                                  "mem_230642") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230625,
                                                  "mem_230625") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230608,
                                                  "mem_230608") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229639,
                                                  "mem_229639") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229634,
                                                  "mem_229634") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229628,
                                                  "mem_229628") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229577,
                                                  "mem_229577") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229573,
                                                  "mem_229573") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229568,
                                                  "ext_mem_229568") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229569,
                                                  "ext_mem_229569") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229519,
                                                  "ext_mem_229519") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229520,
                                                  "ext_mem_229520") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229470,
                                                  "ext_mem_229470") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229471,
                                                  "ext_mem_229471") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229372,
                                                  "ext_mem_229372") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229373,
                                                  "ext_mem_229373") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229314,
                                                  "mem_229314") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229308,
                                                  "mem_229308") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229304,
                                                  "ext_mem_229304") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229305,
                                                  "ext_mem_229305") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229272,
                                                  "mem_229272") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229269,
                                                  "mem_229269") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232074,
                                                  "color_232074") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229265,
                                                  "mem_229265") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229263,
                                                  "mem_229263") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229260,
                                                  "mem_229260") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229242,
                                                  "mem_229242") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232361,
                                                  "mem_out_232361") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232360,
                                                  "mem_out_232360") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232359,
                                                  "mem_out_232359") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_230969;
                    
                    mem_230969.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_230969, bytes_229486,
                                              "mem_230969")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221759,
                                                            1,
                                                            (size_t) ((int64_t) 8 *
                                                                      q_l_203577),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221759,
                                                            2,
                                                            (size_t) ((int64_t) 8 *
                                                                      q_l_203577),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221759,
                                                            3,
                                                            (size_t) bytes_230963,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221759,
                                                            4, sizeof(n_203572),
                                                            &n_203572));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221759,
                                                            5,
                                                            sizeof(q_l_203577),
                                                            &q_l_203577));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221759,
                                                            6,
                                                            sizeof(jump_t_203582),
                                                            &jump_t_203582));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221759,
                                                            7,
                                                            sizeof(partition_sizze_203667),
                                                            &partition_sizze_203667));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221759,
                                                            8,
                                                            sizeof(l_n_m_203733),
                                                            &l_n_m_203733));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221759,
                                                            9, sizeof(i_203760),
                                                            &i_203760));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221759,
                                                            10,
                                                            sizeof(ctx_param_ext_229596),
                                                            &ctx_param_ext_229596));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221759,
                                                            11,
                                                            sizeof(ctx_param_ext_229597),
                                                            &ctx_param_ext_229597));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221759,
                                                            12,
                                                            sizeof(ctx_param_ext_229599),
                                                            &ctx_param_ext_229599));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221759,
                                                            13,
                                                            sizeof(ext_mem_229519.mem),
                                                            &ext_mem_229519.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221759,
                                                            14,
                                                            sizeof(ext_mem_229520.mem),
                                                            &ext_mem_229520.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221759,
                                                            15,
                                                            sizeof(mem_param_229601.mem),
                                                            &mem_param_229601.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221759,
                                                            16,
                                                            sizeof(mem_230659.mem),
                                                            &mem_230659.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221759,
                                                            17,
                                                            sizeof(mem_230969.mem),
                                                            &mem_230969.mem));
                    if (1 * ((size_t) nest_sizze_209582 *
                             (size_t) q_l_203577) != 0) {
                        const size_t global_work_sizze_237416[1] =
                                     {(size_t) nest_sizze_209582 *
                                     (size_t) q_l_203577};
                        const size_t local_work_sizze_237420[1] =
                                     {(size_t) q_l_203577};
                        int64_t time_start_237417 = 0, time_end_237418 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.segmap_intragroup_221759",
                                    global_work_sizze_237416[0],
                                    local_work_sizze_237420[0], (int) (0 +
                                                                       (int64_t) 8 *
                                                                       q_l_203577 +
                                                                       (int64_t) 8 *
                                                                       q_l_203577 +
                                                                       bytes_230963));
                            time_start_237417 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_intragroup_221759,
                                                                        1, NULL,
                                                                        global_work_sizze_237416,
                                                                        local_work_sizze_237420,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_intragroup_221759_runs,
                                                                                                                  &ctx->mainzisegmap_intragroup_221759_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_237418 = get_wall_time();
                            
                            long time_diff_237419 = time_end_237418 -
                                 time_start_237417;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_intragroup_221759",
                                    time_diff_237419);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_set_device(ctx, &ext_mem_231014, &mem_230969,
                                            "mem_230969") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231013, &mem_230959,
                                            "mem_230959") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230969, "mem_230969") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230959, "mem_230959") !=
                        0)
                        return 1;
                } else {
                    bool match_lit_205629 = (int64_t) 1 == d_l_203580;
                    struct memblock_device ext_mem_231012;
                    
                    ext_mem_231012.references = NULL;
                    
                    struct memblock_device ext_mem_231011;
                    
                    ext_mem_231011.references = NULL;
                    if (match_lit_205629) {
                        struct memblock_device mem_230982;
                        
                        mem_230982.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230982,
                                                  bytes_229486, "mem_230982")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230986;
                        
                        mem_230986.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230986,
                                                  bytes_229486, "mem_230986")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221926,
                                                                1,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_l_203577),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221926,
                                                                2,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_l_203577),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221926,
                                                                3,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_l_203577),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221926,
                                                                4,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_l_203577),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221926,
                                                                5,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_l_203577),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221926,
                                                                6,
                                                                (size_t) bytes_230963,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221926,
                                                                7,
                                                                (size_t) bytes_230963,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221926,
                                                                8,
                                                                sizeof(n_203572),
                                                                &n_203572));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221926,
                                                                9,
                                                                sizeof(q_l_203577),
                                                                &q_l_203577));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221926,
                                                                10,
                                                                sizeof(jump_t_203582),
                                                                &jump_t_203582));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221926,
                                                                11,
                                                                sizeof(partition_sizze_203667),
                                                                &partition_sizze_203667));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221926,
                                                                12,
                                                                sizeof(l_n_m_203733),
                                                                &l_n_m_203733));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221926,
                                                                13,
                                                                sizeof(i_203760),
                                                                &i_203760));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221926,
                                                                14,
                                                                sizeof(ctx_param_ext_229596),
                                                                &ctx_param_ext_229596));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221926,
                                                                15,
                                                                sizeof(ctx_param_ext_229597),
                                                                &ctx_param_ext_229597));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221926,
                                                                16,
                                                                sizeof(ctx_param_ext_229599),
                                                                &ctx_param_ext_229599));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221926,
                                                                17,
                                                                sizeof(ext_mem_229519.mem),
                                                                &ext_mem_229519.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221926,
                                                                18,
                                                                sizeof(ext_mem_229520.mem),
                                                                &ext_mem_229520.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221926,
                                                                19,
                                                                sizeof(mem_param_229601.mem),
                                                                &mem_param_229601.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221926,
                                                                20,
                                                                sizeof(mem_230659.mem),
                                                                &mem_230659.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221926,
                                                                21,
                                                                sizeof(mem_230982.mem),
                                                                &mem_230982.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221926,
                                                                22,
                                                                sizeof(mem_230986.mem),
                                                                &mem_230986.mem));
                        if (1 * ((size_t) nest_sizze_209582 *
                                 (size_t) q_l_203577) != 0) {
                            const size_t global_work_sizze_237421[1] =
                                         {(size_t) nest_sizze_209582 *
                                         (size_t) q_l_203577};
                            const size_t local_work_sizze_237425[1] =
                                         {(size_t) q_l_203577};
                            int64_t time_start_237422 = 0, time_end_237423 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.segmap_intragroup_221926",
                                        global_work_sizze_237421[0],
                                        local_work_sizze_237425[0], (int) (0 +
                                                                           (int64_t) 8 *
                                                                           q_l_203577 +
                                                                           (int64_t) 8 *
                                                                           q_l_203577 +
                                                                           (int64_t) 8 *
                                                                           q_l_203577 +
                                                                           (int64_t) 8 *
                                                                           q_l_203577 +
                                                                           (int64_t) 8 *
                                                                           q_l_203577 +
                                                                           bytes_230963 +
                                                                           bytes_230963));
                                time_start_237422 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_intragroup_221926,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237421,
                                                                            local_work_sizze_237425,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_intragroup_221926_runs,
                                                                                                                      &ctx->mainzisegmap_intragroup_221926_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237423 = get_wall_time();
                                
                                long time_diff_237424 = time_end_237423 -
                                     time_start_237422;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_221926",
                                        time_diff_237424);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_set_device(ctx, &ext_mem_231012,
                                                &mem_230982, "mem_230982") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231011,
                                                &mem_230986, "mem_230986") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230986,
                                                  "mem_230986") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230982,
                                                  "mem_230982") != 0)
                            return 1;
                    } else {
                        struct memblock_device mem_231006;
                        
                        mem_231006.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231006,
                                                  bytes_229486, "mem_231006")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231010;
                        
                        mem_231010.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231010,
                                                  bytes_229486, "mem_231010")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222183,
                                                                1,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_l_203577),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222183,
                                                                2,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_l_203577),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222183,
                                                                3,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_l_203577),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222183,
                                                                4,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_l_203577),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222183,
                                                                5,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_l_203577),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222183,
                                                                6,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_l_203577),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222183,
                                                                7,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_l_203577),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222183,
                                                                8,
                                                                (size_t) bytes_230963,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222183,
                                                                9,
                                                                (size_t) bytes_230963,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222183,
                                                                10,
                                                                (size_t) bytes_230963,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222183,
                                                                11,
                                                                (size_t) bytes_230963,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222183,
                                                                12,
                                                                sizeof(n_203572),
                                                                &n_203572));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222183,
                                                                13,
                                                                sizeof(q_l_203577),
                                                                &q_l_203577));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222183,
                                                                14,
                                                                sizeof(jump_t_203582),
                                                                &jump_t_203582));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222183,
                                                                15,
                                                                sizeof(partition_sizze_203667),
                                                                &partition_sizze_203667));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222183,
                                                                16,
                                                                sizeof(l_n_m_203733),
                                                                &l_n_m_203733));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222183,
                                                                17,
                                                                sizeof(i_203760),
                                                                &i_203760));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222183,
                                                                18,
                                                                sizeof(ctx_param_ext_229596),
                                                                &ctx_param_ext_229596));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222183,
                                                                19,
                                                                sizeof(ctx_param_ext_229597),
                                                                &ctx_param_ext_229597));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222183,
                                                                20,
                                                                sizeof(ctx_param_ext_229599),
                                                                &ctx_param_ext_229599));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222183,
                                                                21,
                                                                sizeof(ext_mem_229519.mem),
                                                                &ext_mem_229519.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222183,
                                                                22,
                                                                sizeof(ext_mem_229520.mem),
                                                                &ext_mem_229520.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222183,
                                                                23,
                                                                sizeof(mem_param_229601.mem),
                                                                &mem_param_229601.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222183,
                                                                24,
                                                                sizeof(mem_230659.mem),
                                                                &mem_230659.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222183,
                                                                25,
                                                                sizeof(mem_231006.mem),
                                                                &mem_231006.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222183,
                                                                26,
                                                                sizeof(mem_231010.mem),
                                                                &mem_231010.mem));
                        if (1 * ((size_t) nest_sizze_209582 *
                                 (size_t) q_l_203577) != 0) {
                            const size_t global_work_sizze_237426[1] =
                                         {(size_t) nest_sizze_209582 *
                                         (size_t) q_l_203577};
                            const size_t local_work_sizze_237430[1] =
                                         {(size_t) q_l_203577};
                            int64_t time_start_237427 = 0, time_end_237428 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.segmap_intragroup_222183",
                                        global_work_sizze_237426[0],
                                        local_work_sizze_237430[0], (int) (0 +
                                                                           (int64_t) 8 *
                                                                           q_l_203577 +
                                                                           (int64_t) 8 *
                                                                           q_l_203577 +
                                                                           (int64_t) 8 *
                                                                           q_l_203577 +
                                                                           (int64_t) 8 *
                                                                           q_l_203577 +
                                                                           (int64_t) 8 *
                                                                           q_l_203577 +
                                                                           (int64_t) 8 *
                                                                           q_l_203577 +
                                                                           (int64_t) 8 *
                                                                           q_l_203577 +
                                                                           bytes_230963 +
                                                                           bytes_230963 +
                                                                           bytes_230963 +
                                                                           bytes_230963));
                                time_start_237427 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_intragroup_222183,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237426,
                                                                            local_work_sizze_237430,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_intragroup_222183_runs,
                                                                                                                      &ctx->mainzisegmap_intragroup_222183_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237428 = get_wall_time();
                                
                                long time_diff_237429 = time_end_237428 -
                                     time_start_237427;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_222183",
                                        time_diff_237429);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_set_device(ctx, &ext_mem_231012,
                                                &mem_231006, "mem_231006") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231011,
                                                &mem_231010, "mem_231010") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231010,
                                                  "mem_231010") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231006,
                                                  "mem_231006") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_231014,
                                            &ext_mem_231012,
                                            "ext_mem_231012") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231013,
                                            &ext_mem_231011,
                                            "ext_mem_231011") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231011,
                                              "ext_mem_231011") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231012,
                                              "ext_mem_231012") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_231016, &ext_mem_231014,
                                        "ext_mem_231014") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231015, &ext_mem_231013,
                                        "ext_mem_231013") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231013,
                                          "ext_mem_231013") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231014,
                                          "ext_mem_231014") != 0)
                    return 1;
            }
            
            struct memblock_device ext_mem_231022;
            
            ext_mem_231022.references = NULL;
            if (cond_204197) {
                bool zzero_205873 = jump_l_203583 == (int64_t) 0;
                bool nonzzero_205874 = !zzero_205873;
                bool nonzzero_cert_205875;
                
                if (!nonzzero_205874) {
                    ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                           "division by zero",
                                           "-> #0  loess.fut:547:20-27\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:546:3-550:9\n   #5  stl.fut:252:23-75\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:250:15-253:43\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n");
                    if (memblock_unref_device(ctx, &ext_mem_231022,
                                              "ext_mem_231022") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231015,
                                              "ext_mem_231015") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231016,
                                              "ext_mem_231016") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230654,
                                              "ext_mem_230654") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230637,
                                              "ext_mem_230637") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230620,
                                              "ext_mem_230620") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230602,
                                              "ext_mem_230602") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230594,
                                              "ext_mem_230594") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230595,
                                              "ext_mem_230595") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229623,
                                              "mem_param_229623") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229615,
                                              "mem_param_229615") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231625,
                                              "ext_mem_231625") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231626,
                                              "ext_mem_231626") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229601,
                                              "mem_param_229601") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229593,
                                              "mem_param_229593") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229585,
                                              "mem_param_229585") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231968,
                                              "ext_mem_231968") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231969,
                                              "ext_mem_231969") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231970,
                                              "ext_mem_231970") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230659, "mem_230659") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230642, "mem_230642") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230625, "mem_230625") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230608, "mem_230608") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229639, "mem_229639") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229634, "mem_229634") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229628, "mem_229628") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229577, "mem_229577") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229573, "mem_229573") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229568,
                                              "ext_mem_229568") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229569,
                                              "ext_mem_229569") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229519,
                                              "ext_mem_229519") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229520,
                                              "ext_mem_229520") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229470,
                                              "ext_mem_229470") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229471,
                                              "ext_mem_229471") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229372,
                                              "ext_mem_229372") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229373,
                                              "ext_mem_229373") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229304,
                                              "ext_mem_229304") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229305,
                                              "ext_mem_229305") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232074,
                                              "color_232074") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232361,
                                              "mem_out_232361") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232360,
                                              "mem_out_232360") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232359,
                                              "mem_out_232359") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                int64_t y_205876 = sub64(l_n_m_203733, (int64_t) 1);
                int64_t segmap_group_sizze_222434;
                
                segmap_group_sizze_222434 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_222316;
                
                int64_t segmap_usable_groups_222435 =
                        sdiv_up64(nest_sizze_207090, segmap_group_sizze_222434);
                struct memblock_device mem_231021;
                
                mem_231021.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231021, bytes_229285,
                                          "mem_231021")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222439,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222439,
                                                        3, sizeof(n_203572),
                                                        &n_203572));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222439,
                                                        4,
                                                        sizeof(jump_l_203583),
                                                        &jump_l_203583));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222439,
                                                        5,
                                                        sizeof(partition_sizze_203667),
                                                        &partition_sizze_203667));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222439,
                                                        6, sizeof(l_n_m_203733),
                                                        &l_n_m_203733));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222439,
                                                        7, sizeof(i_203760),
                                                        &i_203760));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222439,
                                                        8, sizeof(y_205876),
                                                        &y_205876));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222439,
                                                        9,
                                                        sizeof(ext_mem_231015.mem),
                                                        &ext_mem_231015.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222439,
                                                        10,
                                                        sizeof(ext_mem_231016.mem),
                                                        &ext_mem_231016.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222439,
                                                        11,
                                                        sizeof(mem_231021.mem),
                                                        &mem_231021.mem));
                if (1 * ((size_t) segmap_usable_groups_222435 *
                         (size_t) segmap_group_sizze_222434) != 0) {
                    const size_t global_work_sizze_237431[1] =
                                 {(size_t) segmap_usable_groups_222435 *
                                 (size_t) segmap_group_sizze_222434};
                    const size_t local_work_sizze_237435[1] =
                                 {(size_t) segmap_group_sizze_222434};
                    int64_t time_start_237432 = 0, time_end_237433 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.segmap_222439",
                                global_work_sizze_237431[0],
                                local_work_sizze_237435[0], (int) 0);
                        time_start_237432 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_222439,
                                                                    1, NULL,
                                                                    global_work_sizze_237431,
                                                                    local_work_sizze_237435,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_222439_runs,
                                                                                                              &ctx->mainzisegmap_222439_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237433 = get_wall_time();
                        
                        long time_diff_237434 = time_end_237433 -
                             time_start_237432;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_222439", time_diff_237434);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_set_device(ctx, &ext_mem_231022, &mem_231021,
                                        "mem_231021") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231021, "mem_231021") != 0)
                    return 1;
            } else {
                bool dim_match_205928 = n_203572 == l_n_m_203733;
                bool empty_or_match_cert_205929;
                
                if (!dim_match_205928) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Value of (core language) shape (",
                                  (long long) partition_sizze_203667, ", ",
                                  (long long) l_n_m_203733,
                                  ") cannot match shape of type `[",
                                  (long long) partition_sizze_203667, "][",
                                  (long long) n_203572, "]t`.",
                                  "-> #0  stl.fut:255:15-36\n   #1  stl.fut:415:61-429:75\n   #2  stl.fut:455:3-469:34\n   #3  stl.fut:439:1-469:34\n");
                    if (memblock_unref_device(ctx, &ext_mem_231022,
                                              "ext_mem_231022") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231015,
                                              "ext_mem_231015") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231016,
                                              "ext_mem_231016") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230654,
                                              "ext_mem_230654") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230637,
                                              "ext_mem_230637") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230620,
                                              "ext_mem_230620") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230602,
                                              "ext_mem_230602") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230594,
                                              "ext_mem_230594") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230595,
                                              "ext_mem_230595") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229623,
                                              "mem_param_229623") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229615,
                                              "mem_param_229615") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231625,
                                              "ext_mem_231625") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231626,
                                              "ext_mem_231626") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229601,
                                              "mem_param_229601") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229593,
                                              "mem_param_229593") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229585,
                                              "mem_param_229585") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231968,
                                              "ext_mem_231968") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231969,
                                              "ext_mem_231969") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231970,
                                              "ext_mem_231970") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230659, "mem_230659") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230642, "mem_230642") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230625, "mem_230625") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230608, "mem_230608") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229639, "mem_229639") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229634, "mem_229634") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229628, "mem_229628") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229577, "mem_229577") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229573, "mem_229573") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229568,
                                              "ext_mem_229568") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229569,
                                              "ext_mem_229569") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229519,
                                              "ext_mem_229519") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229520,
                                              "ext_mem_229520") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229470,
                                              "ext_mem_229470") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229471,
                                              "ext_mem_229471") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229372,
                                              "ext_mem_229372") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229373,
                                              "ext_mem_229373") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229304,
                                              "ext_mem_229304") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229305,
                                              "ext_mem_229305") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232074,
                                              "color_232074") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232361,
                                              "mem_out_232361") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232360,
                                              "mem_out_232360") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232359,
                                              "mem_out_232359") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                if (memblock_set_device(ctx, &ext_mem_231022, &ext_mem_231016,
                                        "ext_mem_231016") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &ext_mem_231015, "ext_mem_231015") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231016, "ext_mem_231016") !=
                0)
                return 1;
            
            struct memblock_device mem_231028;
            
            mem_231028.references = NULL;
            if (memblock_alloc_device(ctx, &mem_231028, bytes_229285,
                                      "mem_231028")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222534, 1,
                                                    sizeof(n_203572),
                                                    &n_203572));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222534, 2,
                                                    sizeof(n_p_203574),
                                                    &n_p_203574));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222534, 3,
                                                    sizeof(partition_sizze_203667),
                                                    &partition_sizze_203667));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222534, 4,
                                                    sizeof(C_len_203724),
                                                    &C_len_203724));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222534, 5,
                                                    sizeof(ext_231023),
                                                    &ext_231023));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222534, 6,
                                                    sizeof(mem_230608.mem),
                                                    &mem_230608.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222534, 7,
                                                    sizeof(ext_mem_231022.mem),
                                                    &ext_mem_231022.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222534, 8,
                                                    sizeof(mem_231028.mem),
                                                    &mem_231028.mem));
            if (1 * ((size_t) segmap_usable_groups_222530 *
                     (size_t) segmap_group_sizze_222529) != 0) {
                const size_t global_work_sizze_237436[1] =
                             {(size_t) segmap_usable_groups_222530 *
                             (size_t) segmap_group_sizze_222529};
                const size_t local_work_sizze_237440[1] =
                             {(size_t) segmap_group_sizze_222529};
                int64_t time_start_237437 = 0, time_end_237438 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                            "main.segmap_222534", global_work_sizze_237436[0],
                            local_work_sizze_237440[0], (int) 0);
                    time_start_237437 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_222534,
                                                                1, NULL,
                                                                global_work_sizze_237436,
                                                                local_work_sizze_237440,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_222534_runs,
                                                                                                          &ctx->mainzisegmap_222534_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_237438 = get_wall_time();
                    
                    long time_diff_237439 = time_end_237438 - time_start_237437;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_222534", time_diff_237439);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_unref_device(ctx, &ext_mem_231022, "ext_mem_231022") !=
                0)
                return 1;
            
            struct memblock_device ext_mem_231613;
            
            ext_mem_231613.references = NULL;
            
            struct memblock_device ext_mem_231612;
            
            ext_mem_231612.references = NULL;
            if (cond_204255) {
                bool match_lit_205941 = (int64_t) 0 == d_t_203579;
                struct memblock_device ext_mem_231510;
                
                ext_mem_231510.references = NULL;
                
                struct memblock_device ext_mem_231509;
                
                ext_mem_231509.references = NULL;
                if (match_lit_205941) {
                    struct memblock_device mem_231032;
                    
                    mem_231032.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231032, bytes_229535,
                                              "mem_231032")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f64(ctx, mem_231032,
                                                      partition_sizze_203667 *
                                                      t_n_m_203740, 0.0) != 0) {
                        if (memblock_unref_device(ctx, &mem_231032,
                                                  "mem_231032") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231509,
                                                  "ext_mem_231509") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231510,
                                                  "ext_mem_231510") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231612,
                                                  "ext_mem_231612") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231613,
                                                  "ext_mem_231613") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231028,
                                                  "mem_231028") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231022,
                                                  "ext_mem_231022") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231015,
                                                  "ext_mem_231015") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231016,
                                                  "ext_mem_231016") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230654,
                                                  "ext_mem_230654") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230637,
                                                  "ext_mem_230637") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230620,
                                                  "ext_mem_230620") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230602,
                                                  "ext_mem_230602") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230594,
                                                  "ext_mem_230594") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230595,
                                                  "ext_mem_230595") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229623,
                                                  "mem_param_229623") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229615,
                                                  "mem_param_229615") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231625,
                                                  "ext_mem_231625") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231626,
                                                  "ext_mem_231626") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229601,
                                                  "mem_param_229601") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229593,
                                                  "mem_param_229593") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229585,
                                                  "mem_param_229585") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231968,
                                                  "ext_mem_231968") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231969,
                                                  "ext_mem_231969") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231970,
                                                  "ext_mem_231970") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230659,
                                                  "mem_230659") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230642,
                                                  "mem_230642") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230625,
                                                  "mem_230625") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230608,
                                                  "mem_230608") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229639,
                                                  "mem_229639") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229634,
                                                  "mem_229634") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229628,
                                                  "mem_229628") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229577,
                                                  "mem_229577") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229573,
                                                  "mem_229573") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229568,
                                                  "ext_mem_229568") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229569,
                                                  "ext_mem_229569") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229519,
                                                  "ext_mem_229519") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229520,
                                                  "ext_mem_229520") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229470,
                                                  "ext_mem_229470") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229471,
                                                  "ext_mem_229471") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229372,
                                                  "ext_mem_229372") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229373,
                                                  "ext_mem_229373") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229314,
                                                  "mem_229314") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229308,
                                                  "mem_229308") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229304,
                                                  "ext_mem_229304") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229305,
                                                  "ext_mem_229305") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229272,
                                                  "mem_229272") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229269,
                                                  "mem_229269") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232074,
                                                  "color_232074") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229265,
                                                  "mem_229265") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229263,
                                                  "mem_229263") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229260,
                                                  "mem_229260") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229242,
                                                  "mem_229242") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232361,
                                                  "mem_out_232361") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232360,
                                                  "mem_out_232360") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232359,
                                                  "mem_out_232359") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    bool suff_outer_par_222540;
                    
                    suff_outer_par_222540 =
                        *ctx->tuning_params.mainzisuff_outer_par_28 <=
                        partition_sizze_203667;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_28",
                                (long) partition_sizze_203667,
                                suff_outer_par_222540 ? "true" : "false");
                    
                    int64_t segmap_group_sizze_222636;
                    
                    segmap_group_sizze_222636 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_222544;
                    
                    int64_t num_groups_222637;
                    int32_t max_num_groups_235458;
                    
                    max_num_groups_235458 =
                        *ctx->tuning_params.mainzisegmap_num_groups_222546;
                    num_groups_222637 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(partition_sizze_203667,
                                                                             segmap_group_sizze_222636),
                                                                   sext_i32_i64(max_num_groups_235458))));
                    
                    int64_t segmap_group_sizze_223152;
                    
                    segmap_group_sizze_223152 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_223126;
                    
                    int64_t segmap_group_sizze_223168;
                    
                    segmap_group_sizze_223168 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_223070;
                    
                    int64_t segmap_group_sizze_223193;
                    
                    segmap_group_sizze_223193 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_222733;
                    
                    bool suff_outer_par_223197;
                    
                    suff_outer_par_223197 =
                        *ctx->tuning_params.mainzisuff_outer_par_29 <=
                        nest_sizze_210208;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_29",
                                (long) nest_sizze_210208,
                                suff_outer_par_223197 ? "true" : "false");
                    
                    int64_t nest_sizze_223279 = q_t_203576 * nest_sizze_210208;
                    int64_t segred_group_sizze_223280;
                    
                    segred_group_sizze_223280 =
                        *ctx->tuning_params.mainzisegred_group_sizze_222884;
                    
                    int64_t num_groups_223281;
                    int32_t max_num_groups_235459;
                    
                    max_num_groups_235459 =
                        *ctx->tuning_params.mainzisegred_num_groups_222886;
                    num_groups_223281 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(nest_sizze_223279,
                                                                             segred_group_sizze_223280),
                                                                   sext_i32_i64(max_num_groups_235459))));
                    
                    int64_t segmap_group_sizze_223321;
                    
                    segmap_group_sizze_223321 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_222871;
                    
                    int64_t segred_group_sizze_223332;
                    
                    segred_group_sizze_223332 =
                        *ctx->tuning_params.mainzisegred_group_sizze_222814;
                    
                    int64_t num_groups_223333;
                    int32_t max_num_groups_235460;
                    
                    max_num_groups_235460 =
                        *ctx->tuning_params.mainzisegred_num_groups_222816;
                    num_groups_223333 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(nest_sizze_223279,
                                                                             segred_group_sizze_223332),
                                                                   sext_i32_i64(max_num_groups_235460))));
                    
                    int64_t maxSubHelper_232150 = umax64(bytes_229277,
                                                         bytes_229528);
                    int64_t num_threads_232294 = segmap_group_sizze_222636 *
                            num_groups_222637;
                    int64_t total_sizze_232295 = maxSubHelper_232150 *
                            num_threads_232294;
                    int64_t total_sizze_232296 = bytes_229277 *
                            num_threads_232294;
                    int64_t total_sizze_232297 = bytes_229277 *
                            num_threads_232294;
                    struct memblock_device ext_mem_231152;
                    
                    ext_mem_231152.references = NULL;
                    
                    int32_t local_memory_capacity_235679;
                    
                    local_memory_capacity_235679 = ctx->opencl.max_local_memory;
                    if ((sle64((int64_t) 0,
                               sext_i32_i64(local_memory_capacity_235679)) &&
                         sle64((int64_t) 0,
                               sext_i32_i64(local_memory_capacity_235679))) &&
                        suff_outer_par_222540) {
                        struct memblock_device mem_231035;
                        
                        mem_231035.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231035,
                                                  binop_y_229284,
                                                  "mem_231035")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_231035,
                                                                  (int64_t) 0,
                                                                  mem_231028,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_203572,
                                                                  partition_sizze_203667) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_231035,
                                                      "mem_231035") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231152,
                                                      "ext_mem_231152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231032,
                                                      "mem_231032") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231509,
                                                      "ext_mem_231509") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231510,
                                                      "ext_mem_231510") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231612,
                                                      "ext_mem_231612") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231613,
                                                      "ext_mem_231613") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231028,
                                                      "mem_231028") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231022,
                                                      "ext_mem_231022") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231015,
                                                      "ext_mem_231015") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231016,
                                                      "ext_mem_231016") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230654,
                                                      "ext_mem_230654") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230637,
                                                      "ext_mem_230637") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230620,
                                                      "ext_mem_230620") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230602,
                                                      "ext_mem_230602") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231038;
                        
                        mem_231038.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231038,
                                                  binop_y_229284,
                                                  "mem_231038")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                  mem_231038,
                                                                  (int64_t) 0,
                                                                  ext_mem_229305,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_203572,
                                                                  partition_sizze_203667) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_231038,
                                                      "mem_231038") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231035,
                                                      "mem_231035") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231152,
                                                      "ext_mem_231152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231032,
                                                      "mem_231032") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231509,
                                                      "ext_mem_231509") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231510,
                                                      "ext_mem_231510") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231612,
                                                      "ext_mem_231612") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231613,
                                                      "ext_mem_231613") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231028,
                                                      "mem_231028") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231022,
                                                      "ext_mem_231022") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231015,
                                                      "ext_mem_231015") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231016,
                                                      "ext_mem_231016") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230654,
                                                      "ext_mem_230654") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230637,
                                                      "ext_mem_230637") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230620,
                                                      "ext_mem_230620") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230602,
                                                      "ext_mem_230602") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231041;
                        
                        mem_231041.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231041,
                                                  binop_y_229534,
                                                  "mem_231041")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                  mem_231041,
                                                                  (int64_t) 0,
                                                                  ext_mem_229569,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  t_n_m_203740,
                                                                  partition_sizze_203667) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_231041,
                                                      "mem_231041") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231038,
                                                      "mem_231038") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231035,
                                                      "mem_231035") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231152,
                                                      "ext_mem_231152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231032,
                                                      "mem_231032") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231509,
                                                      "ext_mem_231509") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231510,
                                                      "ext_mem_231510") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231612,
                                                      "ext_mem_231612") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231613,
                                                      "ext_mem_231613") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231028,
                                                      "mem_231028") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231022,
                                                      "ext_mem_231022") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231015,
                                                      "ext_mem_231015") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231016,
                                                      "ext_mem_231016") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230654,
                                                      "ext_mem_230654") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230637,
                                                      "ext_mem_230637") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230620,
                                                      "ext_mem_230620") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230602,
                                                      "ext_mem_230602") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231044;
                        
                        mem_231044.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231044,
                                                  binop_y_229534,
                                                  "mem_231044")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_231044,
                                                                  (int64_t) 0,
                                                                  ext_mem_229568,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  t_n_m_203740,
                                                                  partition_sizze_203667) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_231044,
                                                      "mem_231044") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231041,
                                                      "mem_231041") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231038,
                                                      "mem_231038") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231035,
                                                      "mem_231035") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231152,
                                                      "ext_mem_231152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231032,
                                                      "mem_231032") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231509,
                                                      "ext_mem_231509") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231510,
                                                      "ext_mem_231510") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231612,
                                                      "ext_mem_231612") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231613,
                                                      "ext_mem_231613") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231028,
                                                      "mem_231028") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231022,
                                                      "ext_mem_231022") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231015,
                                                      "ext_mem_231015") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231016,
                                                      "ext_mem_231016") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230654,
                                                      "ext_mem_230654") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230637,
                                                      "ext_mem_230637") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230620,
                                                      "ext_mem_230620") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230602,
                                                      "ext_mem_230602") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231047;
                        
                        mem_231047.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231047,
                                                  binop_y_229284,
                                                  "mem_231047")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        int64_t group_sizze_235464;
                        
                        group_sizze_235464 =
                            *ctx->tuning_params.mainzigroup_sizze_235464;
                        
                        int64_t num_groups_235465 =
                                sdiv_up64(partition_sizze_203667 * n_203572,
                                          group_sizze_235464);
                        
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235461,
                                                                0,
                                                                sizeof(n_203572),
                                                                &n_203572));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235461,
                                                                1,
                                                                sizeof(partition_sizze_203667),
                                                                &partition_sizze_203667));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235461,
                                                                2,
                                                                sizeof(ctx_param_ext_229596),
                                                                &ctx_param_ext_229596));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235461,
                                                                3,
                                                                sizeof(ctx_param_ext_229597),
                                                                &ctx_param_ext_229597));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235461,
                                                                4,
                                                                sizeof(ctx_param_ext_229599),
                                                                &ctx_param_ext_229599));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235461,
                                                                5,
                                                                sizeof(mem_param_229601.mem),
                                                                &mem_param_229601.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235461,
                                                                6,
                                                                sizeof(mem_231047.mem),
                                                                &mem_231047.mem));
                        if (1 * ((size_t) num_groups_235465 *
                                 (size_t) group_sizze_235464) != 0) {
                            const size_t global_work_sizze_237441[1] =
                                         {(size_t) num_groups_235465 *
                                         (size_t) group_sizze_235464};
                            const size_t local_work_sizze_237445[1] =
                                         {(size_t) group_sizze_235464};
                            int64_t time_start_237442 = 0, time_end_237443 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.copy_235461",
                                        global_work_sizze_237441[0],
                                        local_work_sizze_237445[0], (int) 0);
                                time_start_237442 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzicopy_235461,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237441,
                                                                            local_work_sizze_237445,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzicopy_235461_runs,
                                                                                                                      &ctx->mainzicopy_235461_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237443 = get_wall_time();
                                
                                long time_diff_237444 = time_end_237443 -
                                     time_start_237442;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.copy_235461", time_diff_237444);
                            }
                        }
                        
                        struct memblock_device mem_231111;
                        
                        mem_231111.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231111,
                                                  binop_y_229534,
                                                  "mem_231111")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device color_232151;
                        
                        color_232151.references = NULL;
                        if (memblock_alloc_device(ctx, &color_232151,
                                                  total_sizze_232295,
                                                  "color_232151")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device color_232152;
                        
                        color_232152.references = NULL;
                        if (memblock_alloc_device(ctx, &color_232152,
                                                  total_sizze_232296,
                                                  "color_232152")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device color_232153;
                        
                        color_232153.references = NULL;
                        if (memblock_alloc_device(ctx, &color_232153,
                                                  total_sizze_232297,
                                                  "color_232153")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222641,
                                                                1,
                                                                sizeof(ctx->failure_is_an_option),
                                                                &ctx->failure_is_an_option));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222641,
                                                                3,
                                                                sizeof(n_203572),
                                                                &n_203572));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222641,
                                                                4,
                                                                sizeof(q_t_203576),
                                                                &q_t_203576));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222641,
                                                                5,
                                                                sizeof(jump_t_203582),
                                                                &jump_t_203582));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222641,
                                                                6,
                                                                sizeof(partition_sizze_203667),
                                                                &partition_sizze_203667));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222641,
                                                                7,
                                                                sizeof(t_n_m_203740),
                                                                &t_n_m_203740));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222641,
                                                                8,
                                                                sizeof(i_203760),
                                                                &i_203760));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222641,
                                                                9,
                                                                sizeof(num_groups_222637),
                                                                &num_groups_222637));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222641,
                                                                10,
                                                                sizeof(num_threads_232294),
                                                                &num_threads_232294));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222641,
                                                                11,
                                                                sizeof(mem_229269.mem),
                                                                &mem_229269.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222641,
                                                                12,
                                                                sizeof(ext_mem_229304.mem),
                                                                &ext_mem_229304.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222641,
                                                                13,
                                                                sizeof(mem_231035.mem),
                                                                &mem_231035.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222641,
                                                                14,
                                                                sizeof(mem_231038.mem),
                                                                &mem_231038.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222641,
                                                                15,
                                                                sizeof(mem_231041.mem),
                                                                &mem_231041.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222641,
                                                                16,
                                                                sizeof(mem_231044.mem),
                                                                &mem_231044.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222641,
                                                                17,
                                                                sizeof(mem_231047.mem),
                                                                &mem_231047.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222641,
                                                                18,
                                                                sizeof(mem_231111.mem),
                                                                &mem_231111.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222641,
                                                                19,
                                                                sizeof(color_232151.mem),
                                                                &color_232151.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222641,
                                                                20,
                                                                sizeof(color_232152.mem),
                                                                &color_232152.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222641,
                                                                21,
                                                                sizeof(color_232153.mem),
                                                                &color_232153.mem));
                        if (1 * ((size_t) num_groups_222637 *
                                 (size_t) segmap_group_sizze_222636) != 0) {
                            const size_t global_work_sizze_237446[1] =
                                         {(size_t) num_groups_222637 *
                                         (size_t) segmap_group_sizze_222636};
                            const size_t local_work_sizze_237450[1] =
                                         {(size_t) segmap_group_sizze_222636};
                            int64_t time_start_237447 = 0, time_end_237448 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.segmap_222641",
                                        global_work_sizze_237446[0],
                                        local_work_sizze_237450[0], (int) 0);
                                time_start_237447 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_222641,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237446,
                                                                            local_work_sizze_237450,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_222641_runs,
                                                                                                                      &ctx->mainzisegmap_222641_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237448 = get_wall_time();
                                
                                long time_diff_237449 = time_end_237448 -
                                     time_start_237447;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_222641", time_diff_237449);
                            }
                        }
                        ctx->failure_is_an_option = 1;
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_231035,
                                                  "mem_231035") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231038,
                                                  "mem_231038") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231041,
                                                  "mem_231041") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231044,
                                                  "mem_231044") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231047,
                                                  "mem_231047") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232151,
                                                  "color_232151") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232152,
                                                  "color_232152") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232153,
                                                  "color_232153") != 0)
                            return 1;
                        
                        struct memblock_device mem_231150;
                        
                        mem_231150.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231150,
                                                  bytes_229535, "mem_231150")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_231150,
                                                                  (int64_t) 0,
                                                                  mem_231111,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  partition_sizze_203667,
                                                                  t_n_m_203740) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_231150,
                                                      "mem_231150") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232153,
                                                      "color_232153") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232152,
                                                      "color_232152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232151,
                                                      "color_232151") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231111,
                                                      "mem_231111") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231047,
                                                      "mem_231047") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231044,
                                                      "mem_231044") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231041,
                                                      "mem_231041") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231038,
                                                      "mem_231038") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231035,
                                                      "mem_231035") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231152,
                                                      "ext_mem_231152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231032,
                                                      "mem_231032") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231509,
                                                      "ext_mem_231509") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231510,
                                                      "ext_mem_231510") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231612,
                                                      "ext_mem_231612") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231613,
                                                      "ext_mem_231613") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231028,
                                                      "mem_231028") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231022,
                                                      "ext_mem_231022") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231015,
                                                      "ext_mem_231015") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231016,
                                                      "ext_mem_231016") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230654,
                                                      "ext_mem_230654") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230637,
                                                      "ext_mem_230637") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230620,
                                                      "ext_mem_230620") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230602,
                                                      "ext_mem_230602") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        if (memblock_unref_device(ctx, &mem_231111,
                                                  "mem_231111") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231152,
                                                &mem_231150, "mem_231150") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231150,
                                                  "mem_231150") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232153,
                                                  "color_232153") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232152,
                                                  "color_232152") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232151,
                                                  "color_232151") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231111,
                                                  "mem_231111") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231047,
                                                  "mem_231047") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231044,
                                                  "mem_231044") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231041,
                                                  "mem_231041") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231038,
                                                  "mem_231038") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231035,
                                                  "mem_231035") != 0)
                            return 1;
                    } else {
                        int64_t segmap_usable_groups_223153 =
                                sdiv_up64(nest_sizze_207090,
                                          segmap_group_sizze_223152);
                        struct memblock_device mem_231116;
                        
                        mem_231116.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231116,
                                                  bytes_229285, "mem_231116")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223157,
                                                                1,
                                                                sizeof(n_203572),
                                                                &n_203572));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223157,
                                                                2,
                                                                sizeof(partition_sizze_203667),
                                                                &partition_sizze_203667));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223157,
                                                                3,
                                                                sizeof(mem_229269.mem),
                                                                &mem_229269.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223157,
                                                                4,
                                                                sizeof(mem_231028.mem),
                                                                &mem_231028.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223157,
                                                                5,
                                                                sizeof(mem_231116.mem),
                                                                &mem_231116.mem));
                        if (1 * ((size_t) segmap_usable_groups_223153 *
                                 (size_t) segmap_group_sizze_223152) != 0) {
                            const size_t global_work_sizze_237451[1] =
                                         {(size_t) segmap_usable_groups_223153 *
                                         (size_t) segmap_group_sizze_223152};
                            const size_t local_work_sizze_237455[1] =
                                         {(size_t) segmap_group_sizze_223152};
                            int64_t time_start_237452 = 0, time_end_237453 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.segmap_223157",
                                        global_work_sizze_237451[0],
                                        local_work_sizze_237455[0], (int) 0);
                                time_start_237452 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_223157,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237451,
                                                                            local_work_sizze_237455,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_223157_runs,
                                                                                                                      &ctx->mainzisegmap_223157_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237453 = get_wall_time();
                                
                                long time_diff_237454 = time_end_237453 -
                                     time_start_237452;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_223157", time_diff_237454);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        
                        int64_t segmap_usable_groups_223169 =
                                sdiv_up64(nest_sizze_207090,
                                          segmap_group_sizze_223168);
                        struct memblock_device mem_231121;
                        
                        mem_231121.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231121,
                                                  bytes_229285, "mem_231121")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231125;
                        
                        mem_231125.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231125,
                                                  bytes_229285, "mem_231125")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223174,
                                                                1,
                                                                sizeof(ctx->failure_is_an_option),
                                                                &ctx->failure_is_an_option));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223174,
                                                                3,
                                                                sizeof(n_203572),
                                                                &n_203572));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223174,
                                                                4,
                                                                sizeof(partition_sizze_203667),
                                                                &partition_sizze_203667));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223174,
                                                                5,
                                                                sizeof(ctx_param_ext_229596),
                                                                &ctx_param_ext_229596));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223174,
                                                                6,
                                                                sizeof(ctx_param_ext_229597),
                                                                &ctx_param_ext_229597));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223174,
                                                                7,
                                                                sizeof(ctx_param_ext_229599),
                                                                &ctx_param_ext_229599));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223174,
                                                                8,
                                                                sizeof(ext_mem_229305.mem),
                                                                &ext_mem_229305.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223174,
                                                                9,
                                                                sizeof(mem_param_229601.mem),
                                                                &mem_param_229601.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223174,
                                                                10,
                                                                sizeof(mem_231116.mem),
                                                                &mem_231116.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223174,
                                                                11,
                                                                sizeof(mem_231121.mem),
                                                                &mem_231121.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223174,
                                                                12,
                                                                sizeof(mem_231125.mem),
                                                                &mem_231125.mem));
                        if (1 * ((size_t) segmap_usable_groups_223169 *
                                 (size_t) segmap_group_sizze_223168) != 0) {
                            const size_t global_work_sizze_237456[1] =
                                         {(size_t) segmap_usable_groups_223169 *
                                         (size_t) segmap_group_sizze_223168};
                            const size_t local_work_sizze_237460[1] =
                                         {(size_t) segmap_group_sizze_223168};
                            int64_t time_start_237457 = 0, time_end_237458 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.segmap_223174",
                                        global_work_sizze_237456[0],
                                        local_work_sizze_237460[0], (int) 0);
                                time_start_237457 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_223174,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237456,
                                                                            local_work_sizze_237460,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_223174_runs,
                                                                                                                      &ctx->mainzisegmap_223174_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237458 = get_wall_time();
                                
                                long time_diff_237459 = time_end_237458 -
                                     time_start_237457;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_223174", time_diff_237459);
                            }
                        }
                        ctx->failure_is_an_option = 1;
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_231116,
                                                  "mem_231116") != 0)
                            return 1;
                        
                        int64_t segmap_usable_groups_223194 =
                                sdiv_up64(nest_sizze_210208,
                                          segmap_group_sizze_223193);
                        struct memblock_device ext_mem_231146;
                        
                        ext_mem_231146.references = NULL;
                        
                        int32_t local_memory_capacity_235678;
                        
                        local_memory_capacity_235678 =
                            ctx->opencl.max_local_memory;
                        if (sle64((int64_t) 0,
                                  sext_i32_i64(local_memory_capacity_235678)) &&
                            suff_outer_par_223197) {
                            struct memblock_device mem_231130;
                            
                            mem_231130.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231130,
                                                      bytes_229535,
                                                      "mem_231130")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223202,
                                                                    1,
                                                                    sizeof(n_203572),
                                                                    &n_203572));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223202,
                                                                    2,
                                                                    sizeof(q_t_203576),
                                                                    &q_t_203576));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223202,
                                                                    3,
                                                                    sizeof(jump_t_203582),
                                                                    &jump_t_203582));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223202,
                                                                    4,
                                                                    sizeof(partition_sizze_203667),
                                                                    &partition_sizze_203667));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223202,
                                                                    5,
                                                                    sizeof(t_n_m_203740),
                                                                    &t_n_m_203740));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223202,
                                                                    6,
                                                                    sizeof(i_203760),
                                                                    &i_203760));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223202,
                                                                    7,
                                                                    sizeof(ext_mem_229304.mem),
                                                                    &ext_mem_229304.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223202,
                                                                    8,
                                                                    sizeof(ext_mem_229305.mem),
                                                                    &ext_mem_229305.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223202,
                                                                    9,
                                                                    sizeof(ext_mem_229568.mem),
                                                                    &ext_mem_229568.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223202,
                                                                    10,
                                                                    sizeof(ext_mem_229569.mem),
                                                                    &ext_mem_229569.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223202,
                                                                    11,
                                                                    sizeof(mem_231121.mem),
                                                                    &mem_231121.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223202,
                                                                    12,
                                                                    sizeof(mem_231125.mem),
                                                                    &mem_231125.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223202,
                                                                    13,
                                                                    sizeof(mem_231130.mem),
                                                                    &mem_231130.mem));
                            if (1 * ((size_t) segmap_usable_groups_223194 *
                                     (size_t) segmap_group_sizze_223193) != 0) {
                                const size_t global_work_sizze_237461[1] =
                                             {(size_t) segmap_usable_groups_223194 *
                                             (size_t) segmap_group_sizze_223193};
                                const size_t local_work_sizze_237465[1] =
                                             {(size_t) segmap_group_sizze_223193};
                                int64_t time_start_237462 = 0, time_end_237463 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                            "main.segmap_223202",
                                            global_work_sizze_237461[0],
                                            local_work_sizze_237465[0],
                                            (int) 0);
                                    time_start_237462 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_223202,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237461,
                                                                                local_work_sizze_237465,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_223202_runs,
                                                                                                                          &ctx->mainzisegmap_223202_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237463 = get_wall_time();
                                    
                                    long time_diff_237464 = time_end_237463 -
                                         time_start_237462;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_223202",
                                            time_diff_237464);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_set_device(ctx, &ext_mem_231146,
                                                    &mem_231130,
                                                    "mem_231130") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231130,
                                                      "mem_231130") != 0)
                                return 1;
                        } else {
                            struct memblock_device mem_231135;
                            
                            mem_231135.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231135,
                                                      bytes_229535,
                                                      "mem_231135")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (slt64(q_t_203576 * (int64_t) 2,
                                      segred_group_sizze_223280)) {
                                int64_t segment_sizze_nonzzero_235524 =
                                        smax64((int64_t) 1, q_t_203576);
                                int64_t num_threads_235525 = num_groups_223281 *
                                        segred_group_sizze_223280;
                                
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n",
                                            "\n# SegRed-small");
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_segments",
                                            (long long) (partition_sizze_203667 *
                                                         t_n_m_203740), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_t_203576, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segments_per_group",
                                            (long long) squot64(segred_group_sizze_223280,
                                                                segment_sizze_nonzzero_235524),
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "required_groups",
                                            (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                               t_n_m_203740,
                                                                               squot64(segred_group_sizze_223280,
                                                                                       segment_sizze_nonzzero_235524))),
                                            '\n');
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223287,
                                                                        1,
                                                                        (size_t) ((int64_t) 8 *
                                                                                  segred_group_sizze_223280),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223287,
                                                                        2,
                                                                        sizeof(n_203572),
                                                                        &n_203572));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223287,
                                                                        3,
                                                                        sizeof(q_t_203576),
                                                                        &q_t_203576));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223287,
                                                                        4,
                                                                        sizeof(jump_t_203582),
                                                                        &jump_t_203582));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223287,
                                                                        5,
                                                                        sizeof(partition_sizze_203667),
                                                                        &partition_sizze_203667));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223287,
                                                                        6,
                                                                        sizeof(t_n_m_203740),
                                                                        &t_n_m_203740));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223287,
                                                                        7,
                                                                        sizeof(i_203760),
                                                                        &i_203760));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223287,
                                                                        8,
                                                                        sizeof(num_groups_223281),
                                                                        &num_groups_223281));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223287,
                                                                        9,
                                                                        sizeof(segment_sizze_nonzzero_235524),
                                                                        &segment_sizze_nonzzero_235524));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223287,
                                                                        10,
                                                                        sizeof(ext_mem_229304.mem),
                                                                        &ext_mem_229304.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223287,
                                                                        11,
                                                                        sizeof(ext_mem_229305.mem),
                                                                        &ext_mem_229305.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223287,
                                                                        12,
                                                                        sizeof(ext_mem_229568.mem),
                                                                        &ext_mem_229568.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223287,
                                                                        13,
                                                                        sizeof(ext_mem_229569.mem),
                                                                        &ext_mem_229569.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223287,
                                                                        14,
                                                                        sizeof(mem_231121.mem),
                                                                        &mem_231121.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223287,
                                                                        15,
                                                                        sizeof(mem_231135.mem),
                                                                        &mem_231135.mem));
                                if (1 * ((size_t) num_groups_223281 *
                                         (size_t) segred_group_sizze_223280) !=
                                    0) {
                                    const size_t global_work_sizze_237466[1] =
                                                 {(size_t) num_groups_223281 *
                                                 (size_t) segred_group_sizze_223280};
                                    const size_t local_work_sizze_237470[1] =
                                                 {(size_t) segred_group_sizze_223280};
                                    int64_t time_start_237467 = 0,
                                            time_end_237468 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                "main.segred_small_223287",
                                                global_work_sizze_237466[0],
                                                local_work_sizze_237470[0],
                                                (int) (0 + (int64_t) 8 *
                                                       segred_group_sizze_223280));
                                        time_start_237467 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegred_small_223287,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237466,
                                                                                    local_work_sizze_237470,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegred_small_223287_runs,
                                                                                                                              &ctx->mainzisegred_small_223287_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237468 = get_wall_time();
                                        
                                        long time_diff_237469 =
                                             time_end_237468 -
                                             time_start_237467;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segred_small_223287",
                                                time_diff_237469);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                            } else {
                                int64_t groups_per_segment_235553 =
                                        sdiv_up64(num_groups_223281,
                                                  smax64((int64_t) 1,
                                                         partition_sizze_203667 *
                                                         t_n_m_203740));
                                int64_t elements_per_thread_235554 =
                                        sdiv_up64(q_t_203576,
                                                  segred_group_sizze_223280 *
                                                  groups_per_segment_235553);
                                int64_t virt_num_groups_235555 =
                                        groups_per_segment_235553 *
                                        (partition_sizze_203667 * t_n_m_203740);
                                int64_t num_threads_235556 = num_groups_223281 *
                                        segred_group_sizze_223280;
                                int64_t threads_per_segment_235557 =
                                        groups_per_segment_235553 *
                                        segred_group_sizze_223280;
                                
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n",
                                            "\n# SegRed-large");
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_segments",
                                            (long long) (partition_sizze_203667 *
                                                         t_n_m_203740), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_t_203576, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "virt_num_groups",
                                            (long long) virt_num_groups_235555,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_groups",
                                            (long long) num_groups_223281,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "group_size",
                                            (long long) segred_group_sizze_223280,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "elems_per_thread",
                                            (long long) elements_per_thread_235554,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "groups_per_segment",
                                            (long long) groups_per_segment_235553,
                                            '\n');
                                
                                struct memblock_device segred_tmp_mem_235558;
                                
                                segred_tmp_mem_235558.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &segred_tmp_mem_235558,
                                                          (int64_t) 8 *
                                                          virt_num_groups_235555,
                                                          "segred_tmp_mem_235558")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mainzicounter_mem_235560
                                                       =
                                                       ctx->mainzicounter_mem_235560;
                                
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223287,
                                                                        1,
                                                                        (size_t) 1,
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223287,
                                                                        2,
                                                                        (size_t) ((int64_t) 8 *
                                                                                  segred_group_sizze_223280),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223287,
                                                                        3,
                                                                        sizeof(n_203572),
                                                                        &n_203572));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223287,
                                                                        4,
                                                                        sizeof(q_t_203576),
                                                                        &q_t_203576));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223287,
                                                                        5,
                                                                        sizeof(jump_t_203582),
                                                                        &jump_t_203582));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223287,
                                                                        6,
                                                                        sizeof(partition_sizze_203667),
                                                                        &partition_sizze_203667));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223287,
                                                                        7,
                                                                        sizeof(t_n_m_203740),
                                                                        &t_n_m_203740));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223287,
                                                                        8,
                                                                        sizeof(i_203760),
                                                                        &i_203760));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223287,
                                                                        9,
                                                                        sizeof(num_groups_223281),
                                                                        &num_groups_223281));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223287,
                                                                        10,
                                                                        sizeof(groups_per_segment_235553),
                                                                        &groups_per_segment_235553));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223287,
                                                                        11,
                                                                        sizeof(elements_per_thread_235554),
                                                                        &elements_per_thread_235554));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223287,
                                                                        12,
                                                                        sizeof(virt_num_groups_235555),
                                                                        &virt_num_groups_235555));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223287,
                                                                        13,
                                                                        sizeof(threads_per_segment_235557),
                                                                        &threads_per_segment_235557));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223287,
                                                                        14,
                                                                        sizeof(ext_mem_229304.mem),
                                                                        &ext_mem_229304.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223287,
                                                                        15,
                                                                        sizeof(ext_mem_229305.mem),
                                                                        &ext_mem_229305.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223287,
                                                                        16,
                                                                        sizeof(ext_mem_229568.mem),
                                                                        &ext_mem_229568.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223287,
                                                                        17,
                                                                        sizeof(ext_mem_229569.mem),
                                                                        &ext_mem_229569.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223287,
                                                                        18,
                                                                        sizeof(mem_231121.mem),
                                                                        &mem_231121.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223287,
                                                                        19,
                                                                        sizeof(mem_231135.mem),
                                                                        &mem_231135.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223287,
                                                                        20,
                                                                        sizeof(segred_tmp_mem_235558.mem),
                                                                        &segred_tmp_mem_235558.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223287,
                                                                        21,
                                                                        sizeof(mainzicounter_mem_235560.mem),
                                                                        &mainzicounter_mem_235560.mem));
                                if (1 * ((size_t) num_groups_223281 *
                                         (size_t) segred_group_sizze_223280) !=
                                    0) {
                                    const size_t global_work_sizze_237472[1] =
                                                 {(size_t) num_groups_223281 *
                                                 (size_t) segred_group_sizze_223280};
                                    const size_t local_work_sizze_237476[1] =
                                                 {(size_t) segred_group_sizze_223280};
                                    int64_t time_start_237473 = 0,
                                            time_end_237474 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                "main.segred_large_223287",
                                                global_work_sizze_237472[0],
                                                local_work_sizze_237476[0],
                                                (int) (0 + 1 + (int64_t) 8 *
                                                       segred_group_sizze_223280));
                                        time_start_237473 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegred_large_223287,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237472,
                                                                                    local_work_sizze_237476,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegred_large_223287_runs,
                                                                                                                              &ctx->mainzisegred_large_223287_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237474 = get_wall_time();
                                        
                                        long time_diff_237475 =
                                             time_end_237474 -
                                             time_start_237473;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segred_large_223287",
                                                time_diff_237475);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx,
                                                          &segred_tmp_mem_235558,
                                                          "segred_tmp_mem_235558") !=
                                    0)
                                    return 1;
                            }
                            
                            int64_t segmap_usable_groups_223322 =
                                    sdiv_up64(nest_sizze_210208,
                                              segmap_group_sizze_223321);
                            struct memblock_device mem_231140;
                            
                            mem_231140.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231140,
                                                      bytes_229535,
                                                      "mem_231140")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223326,
                                                                    1,
                                                                    sizeof(partition_sizze_203667),
                                                                    &partition_sizze_203667));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223326,
                                                                    2,
                                                                    sizeof(t_n_m_203740),
                                                                    &t_n_m_203740));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223326,
                                                                    3,
                                                                    sizeof(mem_231135.mem),
                                                                    &mem_231135.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223326,
                                                                    4,
                                                                    sizeof(mem_231140.mem),
                                                                    &mem_231140.mem));
                            if (1 * ((size_t) segmap_usable_groups_223322 *
                                     (size_t) segmap_group_sizze_223321) != 0) {
                                const size_t global_work_sizze_237477[1] =
                                             {(size_t) segmap_usable_groups_223322 *
                                             (size_t) segmap_group_sizze_223321};
                                const size_t local_work_sizze_237481[1] =
                                             {(size_t) segmap_group_sizze_223321};
                                int64_t time_start_237478 = 0, time_end_237479 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                            "main.segmap_223326",
                                            global_work_sizze_237477[0],
                                            local_work_sizze_237481[0],
                                            (int) 0);
                                    time_start_237478 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_223326,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237477,
                                                                                local_work_sizze_237481,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_223326_runs,
                                                                                                                          &ctx->mainzisegmap_223326_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237479 = get_wall_time();
                                    
                                    long time_diff_237480 = time_end_237479 -
                                         time_start_237478;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_223326",
                                            time_diff_237480);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_231135,
                                                      "mem_231135") != 0)
                                return 1;
                            
                            struct memblock_device mem_231145;
                            
                            mem_231145.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231145,
                                                      bytes_229535,
                                                      "mem_231145")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (slt64(q_t_203576 * (int64_t) 2,
                                      segred_group_sizze_223332)) {
                                int64_t segment_sizze_nonzzero_235606 =
                                        smax64((int64_t) 1, q_t_203576);
                                int64_t num_threads_235607 = num_groups_223333 *
                                        segred_group_sizze_223332;
                                
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n",
                                            "\n# SegRed-small");
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_segments",
                                            (long long) (partition_sizze_203667 *
                                                         t_n_m_203740), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_t_203576, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segments_per_group",
                                            (long long) squot64(segred_group_sizze_223332,
                                                                segment_sizze_nonzzero_235606),
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "required_groups",
                                            (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                               t_n_m_203740,
                                                                               squot64(segred_group_sizze_223332,
                                                                                       segment_sizze_nonzzero_235606))),
                                            '\n');
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223339,
                                                                        1,
                                                                        (size_t) ((int64_t) 8 *
                                                                                  segred_group_sizze_223332),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223339,
                                                                        2,
                                                                        sizeof(n_203572),
                                                                        &n_203572));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223339,
                                                                        3,
                                                                        sizeof(q_t_203576),
                                                                        &q_t_203576));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223339,
                                                                        4,
                                                                        sizeof(jump_t_203582),
                                                                        &jump_t_203582));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223339,
                                                                        5,
                                                                        sizeof(partition_sizze_203667),
                                                                        &partition_sizze_203667));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223339,
                                                                        6,
                                                                        sizeof(t_n_m_203740),
                                                                        &t_n_m_203740));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223339,
                                                                        7,
                                                                        sizeof(i_203760),
                                                                        &i_203760));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223339,
                                                                        8,
                                                                        sizeof(num_groups_223333),
                                                                        &num_groups_223333));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223339,
                                                                        9,
                                                                        sizeof(segment_sizze_nonzzero_235606),
                                                                        &segment_sizze_nonzzero_235606));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223339,
                                                                        10,
                                                                        sizeof(ext_mem_229304.mem),
                                                                        &ext_mem_229304.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223339,
                                                                        11,
                                                                        sizeof(ext_mem_229305.mem),
                                                                        &ext_mem_229305.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223339,
                                                                        12,
                                                                        sizeof(ext_mem_229568.mem),
                                                                        &ext_mem_229568.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223339,
                                                                        13,
                                                                        sizeof(ext_mem_229569.mem),
                                                                        &ext_mem_229569.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223339,
                                                                        14,
                                                                        sizeof(mem_231121.mem),
                                                                        &mem_231121.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223339,
                                                                        15,
                                                                        sizeof(mem_231125.mem),
                                                                        &mem_231125.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223339,
                                                                        16,
                                                                        sizeof(mem_231140.mem),
                                                                        &mem_231140.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223339,
                                                                        17,
                                                                        sizeof(mem_231145.mem),
                                                                        &mem_231145.mem));
                                if (1 * ((size_t) num_groups_223333 *
                                         (size_t) segred_group_sizze_223332) !=
                                    0) {
                                    const size_t global_work_sizze_237482[1] =
                                                 {(size_t) num_groups_223333 *
                                                 (size_t) segred_group_sizze_223332};
                                    const size_t local_work_sizze_237486[1] =
                                                 {(size_t) segred_group_sizze_223332};
                                    int64_t time_start_237483 = 0,
                                            time_end_237484 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                "main.segred_small_223339",
                                                global_work_sizze_237482[0],
                                                local_work_sizze_237486[0],
                                                (int) (0 + (int64_t) 8 *
                                                       segred_group_sizze_223332));
                                        time_start_237483 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegred_small_223339,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237482,
                                                                                    local_work_sizze_237486,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegred_small_223339_runs,
                                                                                                                              &ctx->mainzisegred_small_223339_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237484 = get_wall_time();
                                        
                                        long time_diff_237485 =
                                             time_end_237484 -
                                             time_start_237483;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segred_small_223339",
                                                time_diff_237485);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                            } else {
                                int64_t groups_per_segment_235635 =
                                        sdiv_up64(num_groups_223333,
                                                  smax64((int64_t) 1,
                                                         partition_sizze_203667 *
                                                         t_n_m_203740));
                                int64_t elements_per_thread_235636 =
                                        sdiv_up64(q_t_203576,
                                                  segred_group_sizze_223332 *
                                                  groups_per_segment_235635);
                                int64_t virt_num_groups_235637 =
                                        groups_per_segment_235635 *
                                        (partition_sizze_203667 * t_n_m_203740);
                                int64_t num_threads_235638 = num_groups_223333 *
                                        segred_group_sizze_223332;
                                int64_t threads_per_segment_235639 =
                                        groups_per_segment_235635 *
                                        segred_group_sizze_223332;
                                
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n",
                                            "\n# SegRed-large");
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_segments",
                                            (long long) (partition_sizze_203667 *
                                                         t_n_m_203740), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_t_203576, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "virt_num_groups",
                                            (long long) virt_num_groups_235637,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_groups",
                                            (long long) num_groups_223333,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "group_size",
                                            (long long) segred_group_sizze_223332,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "elems_per_thread",
                                            (long long) elements_per_thread_235636,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "groups_per_segment",
                                            (long long) groups_per_segment_235635,
                                            '\n');
                                
                                struct memblock_device segred_tmp_mem_235640;
                                
                                segred_tmp_mem_235640.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &segred_tmp_mem_235640,
                                                          (int64_t) 8 *
                                                          virt_num_groups_235637,
                                                          "segred_tmp_mem_235640")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mainzicounter_mem_235642
                                                       =
                                                       ctx->mainzicounter_mem_235642;
                                
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223339,
                                                                        1,
                                                                        (size_t) 1,
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223339,
                                                                        2,
                                                                        (size_t) ((int64_t) 8 *
                                                                                  segred_group_sizze_223332),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223339,
                                                                        3,
                                                                        sizeof(n_203572),
                                                                        &n_203572));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223339,
                                                                        4,
                                                                        sizeof(q_t_203576),
                                                                        &q_t_203576));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223339,
                                                                        5,
                                                                        sizeof(jump_t_203582),
                                                                        &jump_t_203582));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223339,
                                                                        6,
                                                                        sizeof(partition_sizze_203667),
                                                                        &partition_sizze_203667));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223339,
                                                                        7,
                                                                        sizeof(t_n_m_203740),
                                                                        &t_n_m_203740));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223339,
                                                                        8,
                                                                        sizeof(i_203760),
                                                                        &i_203760));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223339,
                                                                        9,
                                                                        sizeof(num_groups_223333),
                                                                        &num_groups_223333));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223339,
                                                                        10,
                                                                        sizeof(groups_per_segment_235635),
                                                                        &groups_per_segment_235635));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223339,
                                                                        11,
                                                                        sizeof(elements_per_thread_235636),
                                                                        &elements_per_thread_235636));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223339,
                                                                        12,
                                                                        sizeof(virt_num_groups_235637),
                                                                        &virt_num_groups_235637));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223339,
                                                                        13,
                                                                        sizeof(threads_per_segment_235639),
                                                                        &threads_per_segment_235639));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223339,
                                                                        14,
                                                                        sizeof(ext_mem_229304.mem),
                                                                        &ext_mem_229304.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223339,
                                                                        15,
                                                                        sizeof(ext_mem_229305.mem),
                                                                        &ext_mem_229305.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223339,
                                                                        16,
                                                                        sizeof(ext_mem_229568.mem),
                                                                        &ext_mem_229568.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223339,
                                                                        17,
                                                                        sizeof(ext_mem_229569.mem),
                                                                        &ext_mem_229569.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223339,
                                                                        18,
                                                                        sizeof(mem_231121.mem),
                                                                        &mem_231121.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223339,
                                                                        19,
                                                                        sizeof(mem_231125.mem),
                                                                        &mem_231125.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223339,
                                                                        20,
                                                                        sizeof(mem_231140.mem),
                                                                        &mem_231140.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223339,
                                                                        21,
                                                                        sizeof(mem_231145.mem),
                                                                        &mem_231145.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223339,
                                                                        22,
                                                                        sizeof(segred_tmp_mem_235640.mem),
                                                                        &segred_tmp_mem_235640.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223339,
                                                                        23,
                                                                        sizeof(mainzicounter_mem_235642.mem),
                                                                        &mainzicounter_mem_235642.mem));
                                if (1 * ((size_t) num_groups_223333 *
                                         (size_t) segred_group_sizze_223332) !=
                                    0) {
                                    const size_t global_work_sizze_237488[1] =
                                                 {(size_t) num_groups_223333 *
                                                 (size_t) segred_group_sizze_223332};
                                    const size_t local_work_sizze_237492[1] =
                                                 {(size_t) segred_group_sizze_223332};
                                    int64_t time_start_237489 = 0,
                                            time_end_237490 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                "main.segred_large_223339",
                                                global_work_sizze_237488[0],
                                                local_work_sizze_237492[0],
                                                (int) (0 + 1 + (int64_t) 8 *
                                                       segred_group_sizze_223332));
                                        time_start_237489 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegred_large_223339,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237488,
                                                                                    local_work_sizze_237492,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegred_large_223339_runs,
                                                                                                                              &ctx->mainzisegred_large_223339_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237490 = get_wall_time();
                                        
                                        long time_diff_237491 =
                                             time_end_237490 -
                                             time_start_237489;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segred_large_223339",
                                                time_diff_237491);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx,
                                                          &segred_tmp_mem_235640,
                                                          "segred_tmp_mem_235640") !=
                                    0)
                                    return 1;
                            }
                            if (memblock_unref_device(ctx, &mem_231140,
                                                      "mem_231140") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231146,
                                                    &mem_231145,
                                                    "mem_231145") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231145,
                                                      "mem_231145") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231140,
                                                      "mem_231140") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231135,
                                                      "mem_231135") != 0)
                                return 1;
                        }
                        if (memblock_unref_device(ctx, &mem_231121,
                                                  "mem_231121") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231125,
                                                  "mem_231125") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231152,
                                                &ext_mem_231146,
                                                "ext_mem_231146") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231146,
                                                  "ext_mem_231146") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231125,
                                                  "mem_231125") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231121,
                                                  "mem_231121") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231116,
                                                  "mem_231116") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_231510,
                                            &ext_mem_231152,
                                            "ext_mem_231152") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231509, &mem_231032,
                                            "mem_231032") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231152,
                                              "ext_mem_231152") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231032, "mem_231032") !=
                        0)
                        return 1;
                } else {
                    bool match_lit_206033 = (int64_t) 1 == d_t_203579;
                    struct memblock_device ext_mem_231508;
                    
                    ext_mem_231508.references = NULL;
                    
                    struct memblock_device ext_mem_231507;
                    
                    ext_mem_231507.references = NULL;
                    if (match_lit_206033) {
                        bool suff_outer_par_223382;
                        
                        suff_outer_par_223382 =
                            *ctx->tuning_params.mainzisuff_outer_par_30 <=
                            partition_sizze_203667;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_30",
                                    (long) partition_sizze_203667,
                                    suff_outer_par_223382 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_223507;
                        
                        segmap_group_sizze_223507 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_223386;
                        
                        int64_t num_groups_223508;
                        int32_t max_num_groups_235680;
                        
                        max_num_groups_235680 =
                            *ctx->tuning_params.mainzisegmap_num_groups_223388;
                        num_groups_223508 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(partition_sizze_203667,
                                                                                 segmap_group_sizze_223507),
                                                                       sext_i32_i64(max_num_groups_235680))));
                        
                        int64_t segmap_group_sizze_224158;
                        
                        segmap_group_sizze_224158 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_224132;
                        
                        int64_t segmap_group_sizze_224174;
                        
                        segmap_group_sizze_224174 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_224076;
                        
                        int64_t segmap_group_sizze_224199;
                        
                        segmap_group_sizze_224199 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_223634;
                        
                        bool suff_outer_par_224203;
                        
                        suff_outer_par_224203 =
                            *ctx->tuning_params.mainzisuff_outer_par_31 <=
                            nest_sizze_210208;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_31",
                                    (long) nest_sizze_210208,
                                    suff_outer_par_224203 ? "true" : "false");
                        
                        int64_t nest_sizze_224315 = q_t_203576 *
                                nest_sizze_210208;
                        int64_t segred_group_sizze_224316;
                        
                        segred_group_sizze_224316 =
                            *ctx->tuning_params.mainzisegred_group_sizze_223845;
                        
                        int64_t num_groups_224317;
                        int32_t max_num_groups_235681;
                        
                        max_num_groups_235681 =
                            *ctx->tuning_params.mainzisegred_num_groups_223847;
                        num_groups_224317 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_224315,
                                                                                 segred_group_sizze_224316),
                                                                       sext_i32_i64(max_num_groups_235681))));
                        
                        int64_t segmap_group_sizze_224367;
                        
                        segmap_group_sizze_224367 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_223823;
                        
                        int64_t segred_group_sizze_224389;
                        
                        segred_group_sizze_224389 =
                            *ctx->tuning_params.mainzisegred_group_sizze_223748;
                        
                        int64_t num_groups_224390;
                        int32_t max_num_groups_235682;
                        
                        max_num_groups_235682 =
                            *ctx->tuning_params.mainzisegred_num_groups_223750;
                        num_groups_224390 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_224315,
                                                                                 segred_group_sizze_224389),
                                                                       sext_i32_i64(max_num_groups_235682))));
                        
                        int64_t maxSubHelper_232154 = umax64(bytes_229277,
                                                             bytes_229528);
                        int64_t num_threads_232304 = segmap_group_sizze_223507 *
                                num_groups_223508;
                        int64_t total_sizze_232305 = maxSubHelper_232154 *
                                num_threads_232304;
                        int64_t total_sizze_232306 = bytes_229528 *
                                num_threads_232304;
                        int64_t total_sizze_232307 = bytes_229277 *
                                num_threads_232304;
                        int64_t total_sizze_232308 = bytes_229277 *
                                num_threads_232304;
                        struct memblock_device ext_mem_231321;
                        
                        ext_mem_231321.references = NULL;
                        
                        struct memblock_device ext_mem_231320;
                        
                        ext_mem_231320.references = NULL;
                        
                        int32_t local_memory_capacity_235952;
                        
                        local_memory_capacity_235952 =
                            ctx->opencl.max_local_memory;
                        if ((sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_235952)) &&
                             sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_235952))) &&
                            suff_outer_par_223382) {
                            struct memblock_device mem_231155;
                            
                            mem_231155.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231155,
                                                      binop_y_229284,
                                                      "mem_231155")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231155,
                                                                      (int64_t) 0,
                                                                      mem_231028,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_203572,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231155,
                                                          "mem_231155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231320,
                                                          "ext_mem_231320") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231321,
                                                          "ext_mem_231321") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231507,
                                                          "ext_mem_231507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231508,
                                                          "ext_mem_231508") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231509,
                                                          "ext_mem_231509") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231510,
                                                          "ext_mem_231510") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231612,
                                                          "ext_mem_231612") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231613,
                                                          "ext_mem_231613") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231028,
                                                          "mem_231028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231022,
                                                          "ext_mem_231022") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231158;
                            
                            mem_231158.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231158,
                                                      binop_y_229284,
                                                      "mem_231158")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_231158,
                                                                      (int64_t) 0,
                                                                      ext_mem_229305,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_203572,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231158,
                                                          "mem_231158") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231155,
                                                          "mem_231155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231320,
                                                          "ext_mem_231320") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231321,
                                                          "ext_mem_231321") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231507,
                                                          "ext_mem_231507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231508,
                                                          "ext_mem_231508") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231509,
                                                          "ext_mem_231509") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231510,
                                                          "ext_mem_231510") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231612,
                                                          "ext_mem_231612") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231613,
                                                          "ext_mem_231613") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231028,
                                                          "mem_231028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231022,
                                                          "ext_mem_231022") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231161;
                            
                            mem_231161.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231161,
                                                      binop_y_229534,
                                                      "mem_231161")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_231161,
                                                                      (int64_t) 0,
                                                                      ext_mem_229569,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      t_n_m_203740,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231161,
                                                          "mem_231161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231158,
                                                          "mem_231158") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231155,
                                                          "mem_231155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231320,
                                                          "ext_mem_231320") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231321,
                                                          "ext_mem_231321") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231507,
                                                          "ext_mem_231507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231508,
                                                          "ext_mem_231508") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231509,
                                                          "ext_mem_231509") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231510,
                                                          "ext_mem_231510") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231612,
                                                          "ext_mem_231612") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231613,
                                                          "ext_mem_231613") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231028,
                                                          "mem_231028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231022,
                                                          "ext_mem_231022") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231164;
                            
                            mem_231164.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231164,
                                                      binop_y_229534,
                                                      "mem_231164")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231164,
                                                                      (int64_t) 0,
                                                                      ext_mem_229568,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      t_n_m_203740,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231164,
                                                          "mem_231164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231161,
                                                          "mem_231161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231158,
                                                          "mem_231158") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231155,
                                                          "mem_231155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231320,
                                                          "ext_mem_231320") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231321,
                                                          "ext_mem_231321") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231507,
                                                          "ext_mem_231507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231508,
                                                          "ext_mem_231508") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231509,
                                                          "ext_mem_231509") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231510,
                                                          "ext_mem_231510") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231612,
                                                          "ext_mem_231612") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231613,
                                                          "ext_mem_231613") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231028,
                                                          "mem_231028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231022,
                                                          "ext_mem_231022") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231167;
                            
                            mem_231167.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231167,
                                                      binop_y_229284,
                                                      "mem_231167")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            int64_t group_sizze_235686;
                            
                            group_sizze_235686 =
                                *ctx->tuning_params.mainzigroup_sizze_235686;
                            
                            int64_t num_groups_235687 =
                                    sdiv_up64(partition_sizze_203667 * n_203572,
                                              group_sizze_235686);
                            
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235683,
                                                                    0,
                                                                    sizeof(n_203572),
                                                                    &n_203572));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235683,
                                                                    1,
                                                                    sizeof(partition_sizze_203667),
                                                                    &partition_sizze_203667));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235683,
                                                                    2,
                                                                    sizeof(ctx_param_ext_229596),
                                                                    &ctx_param_ext_229596));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235683,
                                                                    3,
                                                                    sizeof(ctx_param_ext_229597),
                                                                    &ctx_param_ext_229597));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235683,
                                                                    4,
                                                                    sizeof(ctx_param_ext_229599),
                                                                    &ctx_param_ext_229599));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235683,
                                                                    5,
                                                                    sizeof(mem_param_229601.mem),
                                                                    &mem_param_229601.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235683,
                                                                    6,
                                                                    sizeof(mem_231167.mem),
                                                                    &mem_231167.mem));
                            if (1 * ((size_t) num_groups_235687 *
                                     (size_t) group_sizze_235686) != 0) {
                                const size_t global_work_sizze_237493[1] =
                                             {(size_t) num_groups_235687 *
                                             (size_t) group_sizze_235686};
                                const size_t local_work_sizze_237497[1] =
                                             {(size_t) group_sizze_235686};
                                int64_t time_start_237494 = 0, time_end_237495 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                            "main.copy_235683",
                                            global_work_sizze_237493[0],
                                            local_work_sizze_237497[0],
                                            (int) 0);
                                    time_start_237494 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzicopy_235683,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237493,
                                                                                local_work_sizze_237497,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzicopy_235683_runs,
                                                                                                                          &ctx->mainzicopy_235683_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237495 = get_wall_time();
                                    
                                    long time_diff_237496 = time_end_237495 -
                                         time_start_237494;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.copy_235683",
                                            time_diff_237496);
                                }
                            }
                            
                            struct memblock_device mem_231246;
                            
                            mem_231246.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231246,
                                                      binop_y_229534,
                                                      "mem_231246")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231249;
                            
                            mem_231249.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231249,
                                                      binop_y_229534,
                                                      "mem_231249")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232155;
                            
                            color_232155.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232155,
                                                      total_sizze_232305,
                                                      "color_232155")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232156;
                            
                            color_232156.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232156,
                                                      total_sizze_232306,
                                                      "color_232156")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232157;
                            
                            color_232157.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232157,
                                                      total_sizze_232307,
                                                      "color_232157")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232158;
                            
                            color_232158.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232158,
                                                      total_sizze_232308,
                                                      "color_232158")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223513,
                                                                    1,
                                                                    sizeof(ctx->failure_is_an_option),
                                                                    &ctx->failure_is_an_option));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223513,
                                                                    3,
                                                                    sizeof(n_203572),
                                                                    &n_203572));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223513,
                                                                    4,
                                                                    sizeof(q_t_203576),
                                                                    &q_t_203576));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223513,
                                                                    5,
                                                                    sizeof(jump_t_203582),
                                                                    &jump_t_203582));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223513,
                                                                    6,
                                                                    sizeof(partition_sizze_203667),
                                                                    &partition_sizze_203667));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223513,
                                                                    7,
                                                                    sizeof(t_n_m_203740),
                                                                    &t_n_m_203740));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223513,
                                                                    8,
                                                                    sizeof(i_203760),
                                                                    &i_203760));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223513,
                                                                    9,
                                                                    sizeof(num_groups_223508),
                                                                    &num_groups_223508));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223513,
                                                                    10,
                                                                    sizeof(num_threads_232304),
                                                                    &num_threads_232304));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223513,
                                                                    11,
                                                                    sizeof(mem_229269.mem),
                                                                    &mem_229269.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223513,
                                                                    12,
                                                                    sizeof(ext_mem_229304.mem),
                                                                    &ext_mem_229304.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223513,
                                                                    13,
                                                                    sizeof(mem_231155.mem),
                                                                    &mem_231155.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223513,
                                                                    14,
                                                                    sizeof(mem_231158.mem),
                                                                    &mem_231158.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223513,
                                                                    15,
                                                                    sizeof(mem_231161.mem),
                                                                    &mem_231161.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223513,
                                                                    16,
                                                                    sizeof(mem_231164.mem),
                                                                    &mem_231164.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223513,
                                                                    17,
                                                                    sizeof(mem_231167.mem),
                                                                    &mem_231167.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223513,
                                                                    18,
                                                                    sizeof(mem_231246.mem),
                                                                    &mem_231246.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223513,
                                                                    19,
                                                                    sizeof(mem_231249.mem),
                                                                    &mem_231249.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223513,
                                                                    20,
                                                                    sizeof(color_232155.mem),
                                                                    &color_232155.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223513,
                                                                    21,
                                                                    sizeof(color_232156.mem),
                                                                    &color_232156.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223513,
                                                                    22,
                                                                    sizeof(color_232157.mem),
                                                                    &color_232157.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223513,
                                                                    23,
                                                                    sizeof(color_232158.mem),
                                                                    &color_232158.mem));
                            if (1 * ((size_t) num_groups_223508 *
                                     (size_t) segmap_group_sizze_223507) != 0) {
                                const size_t global_work_sizze_237498[1] =
                                             {(size_t) num_groups_223508 *
                                             (size_t) segmap_group_sizze_223507};
                                const size_t local_work_sizze_237502[1] =
                                             {(size_t) segmap_group_sizze_223507};
                                int64_t time_start_237499 = 0, time_end_237500 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                            "main.segmap_223513",
                                            global_work_sizze_237498[0],
                                            local_work_sizze_237502[0],
                                            (int) 0);
                                    time_start_237499 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_223513,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237498,
                                                                                local_work_sizze_237502,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_223513_runs,
                                                                                                                          &ctx->mainzisegmap_223513_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237500 = get_wall_time();
                                    
                                    long time_diff_237501 = time_end_237500 -
                                         time_start_237499;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_223513",
                                            time_diff_237501);
                                }
                            }
                            ctx->failure_is_an_option = 1;
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_231155,
                                                      "mem_231155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231158,
                                                      "mem_231158") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231161,
                                                      "mem_231161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231164,
                                                      "mem_231164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231167,
                                                      "mem_231167") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232155,
                                                      "color_232155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232156,
                                                      "color_232156") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232157,
                                                      "color_232157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232158,
                                                      "color_232158") != 0)
                                return 1;
                            
                            struct memblock_device mem_231313;
                            
                            mem_231313.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231313,
                                                      bytes_229535,
                                                      "mem_231313")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231313,
                                                                      (int64_t) 0,
                                                                      mem_231246,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203667,
                                                                      t_n_m_203740) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231313,
                                                          "mem_231313") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232158,
                                                          "color_232158") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232157,
                                                          "color_232157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232156,
                                                          "color_232156") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232155,
                                                          "color_232155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231249,
                                                          "mem_231249") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231246,
                                                          "mem_231246") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231167,
                                                          "mem_231167") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231164,
                                                          "mem_231164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231161,
                                                          "mem_231161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231158,
                                                          "mem_231158") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231155,
                                                          "mem_231155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231320,
                                                          "ext_mem_231320") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231321,
                                                          "ext_mem_231321") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231507,
                                                          "ext_mem_231507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231508,
                                                          "ext_mem_231508") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231509,
                                                          "ext_mem_231509") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231510,
                                                          "ext_mem_231510") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231612,
                                                          "ext_mem_231612") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231613,
                                                          "ext_mem_231613") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231028,
                                                          "mem_231028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231022,
                                                          "ext_mem_231022") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_231246,
                                                      "mem_231246") != 0)
                                return 1;
                            
                            struct memblock_device mem_231318;
                            
                            mem_231318.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231318,
                                                      bytes_229535,
                                                      "mem_231318")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231318,
                                                                      (int64_t) 0,
                                                                      mem_231249,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203667,
                                                                      t_n_m_203740) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231318,
                                                          "mem_231318") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231313,
                                                          "mem_231313") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232158,
                                                          "color_232158") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232157,
                                                          "color_232157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232156,
                                                          "color_232156") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232155,
                                                          "color_232155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231249,
                                                          "mem_231249") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231246,
                                                          "mem_231246") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231167,
                                                          "mem_231167") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231164,
                                                          "mem_231164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231161,
                                                          "mem_231161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231158,
                                                          "mem_231158") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231155,
                                                          "mem_231155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231320,
                                                          "ext_mem_231320") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231321,
                                                          "ext_mem_231321") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231507,
                                                          "ext_mem_231507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231508,
                                                          "ext_mem_231508") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231509,
                                                          "ext_mem_231509") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231510,
                                                          "ext_mem_231510") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231612,
                                                          "ext_mem_231612") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231613,
                                                          "ext_mem_231613") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231028,
                                                          "mem_231028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231022,
                                                          "ext_mem_231022") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_231249,
                                                      "mem_231249") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231321,
                                                    &mem_231313,
                                                    "mem_231313") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231320,
                                                    &mem_231318,
                                                    "mem_231318") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231318,
                                                      "mem_231318") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231313,
                                                      "mem_231313") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232158,
                                                      "color_232158") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232157,
                                                      "color_232157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232156,
                                                      "color_232156") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232155,
                                                      "color_232155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231249,
                                                      "mem_231249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231246,
                                                      "mem_231246") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231167,
                                                      "mem_231167") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231164,
                                                      "mem_231164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231161,
                                                      "mem_231161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231158,
                                                      "mem_231158") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231155,
                                                      "mem_231155") != 0)
                                return 1;
                        } else {
                            int64_t segmap_usable_groups_224159 =
                                    sdiv_up64(nest_sizze_207090,
                                              segmap_group_sizze_224158);
                            struct memblock_device mem_231254;
                            
                            mem_231254.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231254,
                                                      bytes_229285,
                                                      "mem_231254")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224163,
                                                                    1,
                                                                    sizeof(n_203572),
                                                                    &n_203572));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224163,
                                                                    2,
                                                                    sizeof(partition_sizze_203667),
                                                                    &partition_sizze_203667));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224163,
                                                                    3,
                                                                    sizeof(mem_229269.mem),
                                                                    &mem_229269.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224163,
                                                                    4,
                                                                    sizeof(mem_231028.mem),
                                                                    &mem_231028.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224163,
                                                                    5,
                                                                    sizeof(mem_231254.mem),
                                                                    &mem_231254.mem));
                            if (1 * ((size_t) segmap_usable_groups_224159 *
                                     (size_t) segmap_group_sizze_224158) != 0) {
                                const size_t global_work_sizze_237503[1] =
                                             {(size_t) segmap_usable_groups_224159 *
                                             (size_t) segmap_group_sizze_224158};
                                const size_t local_work_sizze_237507[1] =
                                             {(size_t) segmap_group_sizze_224158};
                                int64_t time_start_237504 = 0, time_end_237505 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                            "main.segmap_224163",
                                            global_work_sizze_237503[0],
                                            local_work_sizze_237507[0],
                                            (int) 0);
                                    time_start_237504 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_224163,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237503,
                                                                                local_work_sizze_237507,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_224163_runs,
                                                                                                                          &ctx->mainzisegmap_224163_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237505 = get_wall_time();
                                    
                                    long time_diff_237506 = time_end_237505 -
                                         time_start_237504;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_224163",
                                            time_diff_237506);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            
                            int64_t segmap_usable_groups_224175 =
                                    sdiv_up64(nest_sizze_207090,
                                              segmap_group_sizze_224174);
                            struct memblock_device mem_231259;
                            
                            mem_231259.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231259,
                                                      bytes_229285,
                                                      "mem_231259")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231263;
                            
                            mem_231263.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231263,
                                                      bytes_229285,
                                                      "mem_231263")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224180,
                                                                    1,
                                                                    sizeof(ctx->failure_is_an_option),
                                                                    &ctx->failure_is_an_option));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224180,
                                                                    3,
                                                                    sizeof(n_203572),
                                                                    &n_203572));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224180,
                                                                    4,
                                                                    sizeof(partition_sizze_203667),
                                                                    &partition_sizze_203667));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224180,
                                                                    5,
                                                                    sizeof(ctx_param_ext_229596),
                                                                    &ctx_param_ext_229596));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224180,
                                                                    6,
                                                                    sizeof(ctx_param_ext_229597),
                                                                    &ctx_param_ext_229597));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224180,
                                                                    7,
                                                                    sizeof(ctx_param_ext_229599),
                                                                    &ctx_param_ext_229599));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224180,
                                                                    8,
                                                                    sizeof(ext_mem_229305.mem),
                                                                    &ext_mem_229305.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224180,
                                                                    9,
                                                                    sizeof(mem_param_229601.mem),
                                                                    &mem_param_229601.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224180,
                                                                    10,
                                                                    sizeof(mem_231254.mem),
                                                                    &mem_231254.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224180,
                                                                    11,
                                                                    sizeof(mem_231259.mem),
                                                                    &mem_231259.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224180,
                                                                    12,
                                                                    sizeof(mem_231263.mem),
                                                                    &mem_231263.mem));
                            if (1 * ((size_t) segmap_usable_groups_224175 *
                                     (size_t) segmap_group_sizze_224174) != 0) {
                                const size_t global_work_sizze_237508[1] =
                                             {(size_t) segmap_usable_groups_224175 *
                                             (size_t) segmap_group_sizze_224174};
                                const size_t local_work_sizze_237512[1] =
                                             {(size_t) segmap_group_sizze_224174};
                                int64_t time_start_237509 = 0, time_end_237510 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                            "main.segmap_224180",
                                            global_work_sizze_237508[0],
                                            local_work_sizze_237512[0],
                                            (int) 0);
                                    time_start_237509 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_224180,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237508,
                                                                                local_work_sizze_237512,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_224180_runs,
                                                                                                                          &ctx->mainzisegmap_224180_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237510 = get_wall_time();
                                    
                                    long time_diff_237511 = time_end_237510 -
                                         time_start_237509;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_224180",
                                            time_diff_237511);
                                }
                            }
                            ctx->failure_is_an_option = 1;
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_231254,
                                                      "mem_231254") != 0)
                                return 1;
                            
                            int64_t segmap_usable_groups_224200 =
                                    sdiv_up64(nest_sizze_210208,
                                              segmap_group_sizze_224199);
                            struct memblock_device ext_mem_231309;
                            
                            ext_mem_231309.references = NULL;
                            
                            struct memblock_device ext_mem_231308;
                            
                            ext_mem_231308.references = NULL;
                            
                            int32_t local_memory_capacity_235951;
                            
                            local_memory_capacity_235951 =
                                ctx->opencl.max_local_memory;
                            if (sle64((int64_t) 0,
                                      sext_i32_i64(local_memory_capacity_235951)) &&
                                suff_outer_par_224203) {
                                struct memblock_device mem_231268;
                                
                                mem_231268.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231268,
                                                          bytes_229535,
                                                          "mem_231268")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231272;
                                
                                mem_231272.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231272,
                                                          bytes_229535,
                                                          "mem_231272")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224210,
                                                                        1,
                                                                        sizeof(n_203572),
                                                                        &n_203572));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224210,
                                                                        2,
                                                                        sizeof(q_t_203576),
                                                                        &q_t_203576));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224210,
                                                                        3,
                                                                        sizeof(jump_t_203582),
                                                                        &jump_t_203582));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224210,
                                                                        4,
                                                                        sizeof(partition_sizze_203667),
                                                                        &partition_sizze_203667));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224210,
                                                                        5,
                                                                        sizeof(t_n_m_203740),
                                                                        &t_n_m_203740));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224210,
                                                                        6,
                                                                        sizeof(i_203760),
                                                                        &i_203760));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224210,
                                                                        7,
                                                                        sizeof(ext_mem_229304.mem),
                                                                        &ext_mem_229304.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224210,
                                                                        8,
                                                                        sizeof(ext_mem_229305.mem),
                                                                        &ext_mem_229305.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224210,
                                                                        9,
                                                                        sizeof(ext_mem_229568.mem),
                                                                        &ext_mem_229568.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224210,
                                                                        10,
                                                                        sizeof(ext_mem_229569.mem),
                                                                        &ext_mem_229569.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224210,
                                                                        11,
                                                                        sizeof(mem_231259.mem),
                                                                        &mem_231259.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224210,
                                                                        12,
                                                                        sizeof(mem_231263.mem),
                                                                        &mem_231263.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224210,
                                                                        13,
                                                                        sizeof(mem_231268.mem),
                                                                        &mem_231268.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224210,
                                                                        14,
                                                                        sizeof(mem_231272.mem),
                                                                        &mem_231272.mem));
                                if (1 * ((size_t) segmap_usable_groups_224200 *
                                         (size_t) segmap_group_sizze_224199) !=
                                    0) {
                                    const size_t global_work_sizze_237513[1] =
                                                 {(size_t) segmap_usable_groups_224200 *
                                                 (size_t) segmap_group_sizze_224199};
                                    const size_t local_work_sizze_237517[1] =
                                                 {(size_t) segmap_group_sizze_224199};
                                    int64_t time_start_237514 = 0,
                                            time_end_237515 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                "main.segmap_224210",
                                                global_work_sizze_237513[0],
                                                local_work_sizze_237517[0],
                                                (int) 0);
                                        time_start_237514 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegmap_224210,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237513,
                                                                                    local_work_sizze_237517,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegmap_224210_runs,
                                                                                                                              &ctx->mainzisegmap_224210_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237515 = get_wall_time();
                                        
                                        long time_diff_237516 =
                                             time_end_237515 -
                                             time_start_237514;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segmap_224210",
                                                time_diff_237516);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_set_device(ctx, &ext_mem_231309,
                                                        &mem_231268,
                                                        "mem_231268") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_231308,
                                                        &mem_231272,
                                                        "mem_231272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231272,
                                                          "mem_231272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231268,
                                                          "mem_231268") != 0)
                                    return 1;
                            } else {
                                struct memblock_device mem_231277;
                                
                                mem_231277.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231277,
                                                          bytes_229535,
                                                          "mem_231277")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231281;
                                
                                mem_231281.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231281,
                                                          bytes_229535,
                                                          "mem_231281")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231285;
                                
                                mem_231285.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231285,
                                                          bytes_229535,
                                                          "mem_231285")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_t_203576 * (int64_t) 2,
                                          segred_group_sizze_224316)) {
                                    int64_t segment_sizze_nonzzero_235755 =
                                            smax64((int64_t) 1, q_t_203576);
                                    int64_t num_threads_235756 =
                                            num_groups_224317 *
                                            segred_group_sizze_224316;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-small");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             t_n_m_203740),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203576, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_224316,
                                                                    segment_sizze_nonzzero_235755),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                                   t_n_m_203740,
                                                                                   squot64(segred_group_sizze_224316,
                                                                                           segment_sizze_nonzzero_235755))),
                                                '\n');
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224325,
                                                                            1,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_224316),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224325,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_224316),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224325,
                                                                            3,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_224316),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224325,
                                                                            4,
                                                                            sizeof(n_203572),
                                                                            &n_203572));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224325,
                                                                            5,
                                                                            sizeof(q_t_203576),
                                                                            &q_t_203576));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224325,
                                                                            6,
                                                                            sizeof(jump_t_203582),
                                                                            &jump_t_203582));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224325,
                                                                            7,
                                                                            sizeof(partition_sizze_203667),
                                                                            &partition_sizze_203667));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224325,
                                                                            8,
                                                                            sizeof(t_n_m_203740),
                                                                            &t_n_m_203740));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224325,
                                                                            9,
                                                                            sizeof(i_203760),
                                                                            &i_203760));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224325,
                                                                            10,
                                                                            sizeof(num_groups_224317),
                                                                            &num_groups_224317));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224325,
                                                                            11,
                                                                            sizeof(segment_sizze_nonzzero_235755),
                                                                            &segment_sizze_nonzzero_235755));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224325,
                                                                            12,
                                                                            sizeof(ext_mem_229304.mem),
                                                                            &ext_mem_229304.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224325,
                                                                            13,
                                                                            sizeof(ext_mem_229305.mem),
                                                                            &ext_mem_229305.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224325,
                                                                            14,
                                                                            sizeof(ext_mem_229568.mem),
                                                                            &ext_mem_229568.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224325,
                                                                            15,
                                                                            sizeof(ext_mem_229569.mem),
                                                                            &ext_mem_229569.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224325,
                                                                            16,
                                                                            sizeof(mem_231259.mem),
                                                                            &mem_231259.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224325,
                                                                            17,
                                                                            sizeof(mem_231277.mem),
                                                                            &mem_231277.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224325,
                                                                            18,
                                                                            sizeof(mem_231281.mem),
                                                                            &mem_231281.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224325,
                                                                            19,
                                                                            sizeof(mem_231285.mem),
                                                                            &mem_231285.mem));
                                    if (1 * ((size_t) num_groups_224317 *
                                             (size_t) segred_group_sizze_224316) !=
                                        0) {
                                        const size_t global_work_sizze_237518[1]
                                                     =
                                                     {(size_t) num_groups_224317 *
                                                     (size_t) segred_group_sizze_224316};
                                        const size_t local_work_sizze_237522[1]
                                                     =
                                                     {(size_t) segred_group_sizze_224316};
                                        int64_t time_start_237519 = 0,
                                                time_end_237520 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                    "main.segred_small_224325",
                                                    global_work_sizze_237518[0],
                                                    local_work_sizze_237522[0],
                                                    (int) (0 + (int64_t) 8 *
                                                           segred_group_sizze_224316 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_224316 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_224316));
                                            time_start_237519 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_small_224325,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237518,
                                                                                        local_work_sizze_237522,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_small_224325_runs,
                                                                                                                                  &ctx->mainzisegred_small_224325_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237520 = get_wall_time();
                                            
                                            long time_diff_237521 =
                                                 time_end_237520 -
                                                 time_start_237519;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_small_224325",
                                                    time_diff_237521);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_235796 =
                                            sdiv_up64(num_groups_224317,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203667 *
                                                             t_n_m_203740));
                                    int64_t elements_per_thread_235797 =
                                            sdiv_up64(q_t_203576,
                                                      segred_group_sizze_224316 *
                                                      groups_per_segment_235796);
                                    int64_t virt_num_groups_235798 =
                                            groups_per_segment_235796 *
                                            (partition_sizze_203667 *
                                             t_n_m_203740);
                                    int64_t num_threads_235799 =
                                            num_groups_224317 *
                                            segred_group_sizze_224316;
                                    int64_t threads_per_segment_235800 =
                                            groups_per_segment_235796 *
                                            segred_group_sizze_224316;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-large");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             t_n_m_203740),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203576, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_235798,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_224317,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_224316,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_235797,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_235796,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235801;
                                    
                                    segred_tmp_mem_235801.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235801,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235798,
                                                              "segred_tmp_mem_235801")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235803;
                                    
                                    segred_tmp_mem_235803.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235803,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235798,
                                                              "segred_tmp_mem_235803")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235805;
                                    
                                    segred_tmp_mem_235805.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235805,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235798,
                                                              "segred_tmp_mem_235805")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_235807 =
                                    ctx->mainzicounter_mem_235807;
                                    
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224325,
                                                                            1,
                                                                            (size_t) 1,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224325,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_224316),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224325,
                                                                            3,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_224316),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224325,
                                                                            4,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_224316),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224325,
                                                                            5,
                                                                            sizeof(n_203572),
                                                                            &n_203572));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224325,
                                                                            6,
                                                                            sizeof(q_t_203576),
                                                                            &q_t_203576));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224325,
                                                                            7,
                                                                            sizeof(jump_t_203582),
                                                                            &jump_t_203582));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224325,
                                                                            8,
                                                                            sizeof(partition_sizze_203667),
                                                                            &partition_sizze_203667));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224325,
                                                                            9,
                                                                            sizeof(t_n_m_203740),
                                                                            &t_n_m_203740));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224325,
                                                                            10,
                                                                            sizeof(i_203760),
                                                                            &i_203760));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224325,
                                                                            11,
                                                                            sizeof(num_groups_224317),
                                                                            &num_groups_224317));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224325,
                                                                            12,
                                                                            sizeof(groups_per_segment_235796),
                                                                            &groups_per_segment_235796));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224325,
                                                                            13,
                                                                            sizeof(elements_per_thread_235797),
                                                                            &elements_per_thread_235797));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224325,
                                                                            14,
                                                                            sizeof(virt_num_groups_235798),
                                                                            &virt_num_groups_235798));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224325,
                                                                            15,
                                                                            sizeof(threads_per_segment_235800),
                                                                            &threads_per_segment_235800));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224325,
                                                                            16,
                                                                            sizeof(ext_mem_229304.mem),
                                                                            &ext_mem_229304.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224325,
                                                                            17,
                                                                            sizeof(ext_mem_229305.mem),
                                                                            &ext_mem_229305.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224325,
                                                                            18,
                                                                            sizeof(ext_mem_229568.mem),
                                                                            &ext_mem_229568.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224325,
                                                                            19,
                                                                            sizeof(ext_mem_229569.mem),
                                                                            &ext_mem_229569.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224325,
                                                                            20,
                                                                            sizeof(mem_231259.mem),
                                                                            &mem_231259.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224325,
                                                                            21,
                                                                            sizeof(mem_231277.mem),
                                                                            &mem_231277.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224325,
                                                                            22,
                                                                            sizeof(mem_231281.mem),
                                                                            &mem_231281.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224325,
                                                                            23,
                                                                            sizeof(mem_231285.mem),
                                                                            &mem_231285.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224325,
                                                                            24,
                                                                            sizeof(segred_tmp_mem_235801.mem),
                                                                            &segred_tmp_mem_235801.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224325,
                                                                            25,
                                                                            sizeof(segred_tmp_mem_235803.mem),
                                                                            &segred_tmp_mem_235803.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224325,
                                                                            26,
                                                                            sizeof(segred_tmp_mem_235805.mem),
                                                                            &segred_tmp_mem_235805.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224325,
                                                                            27,
                                                                            sizeof(mainzicounter_mem_235807.mem),
                                                                            &mainzicounter_mem_235807.mem));
                                    if (1 * ((size_t) num_groups_224317 *
                                             (size_t) segred_group_sizze_224316) !=
                                        0) {
                                        const size_t global_work_sizze_237524[1]
                                                     =
                                                     {(size_t) num_groups_224317 *
                                                     (size_t) segred_group_sizze_224316};
                                        const size_t local_work_sizze_237528[1]
                                                     =
                                                     {(size_t) segred_group_sizze_224316};
                                        int64_t time_start_237525 = 0,
                                                time_end_237526 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                    "main.segred_large_224325",
                                                    global_work_sizze_237524[0],
                                                    local_work_sizze_237528[0],
                                                    (int) (0 + 1 + (int64_t) 8 *
                                                           segred_group_sizze_224316 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_224316 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_224316));
                                            time_start_237525 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_large_224325,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237524,
                                                                                        local_work_sizze_237528,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_large_224325_runs,
                                                                                                                                  &ctx->mainzisegred_large_224325_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237526 = get_wall_time();
                                            
                                            long time_diff_237527 =
                                                 time_end_237526 -
                                                 time_start_237525;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_large_224325",
                                                    time_diff_237527);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235805,
                                                              "segred_tmp_mem_235805") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235803,
                                                              "segred_tmp_mem_235803") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235801,
                                                              "segred_tmp_mem_235801") !=
                                        0)
                                        return 1;
                                }
                                
                                int64_t segmap_usable_groups_224368 =
                                        sdiv_up64(nest_sizze_210208,
                                                  segmap_group_sizze_224367);
                                struct memblock_device mem_231290;
                                
                                mem_231290.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231290,
                                                          bytes_229535,
                                                          "mem_231290")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231294;
                                
                                mem_231294.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231294,
                                                          bytes_229535,
                                                          "mem_231294")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231298;
                                
                                mem_231298.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231298,
                                                          bytes_229535,
                                                          "mem_231298")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224374,
                                                                        1,
                                                                        sizeof(partition_sizze_203667),
                                                                        &partition_sizze_203667));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224374,
                                                                        2,
                                                                        sizeof(t_n_m_203740),
                                                                        &t_n_m_203740));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224374,
                                                                        3,
                                                                        sizeof(mem_231277.mem),
                                                                        &mem_231277.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224374,
                                                                        4,
                                                                        sizeof(mem_231281.mem),
                                                                        &mem_231281.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224374,
                                                                        5,
                                                                        sizeof(mem_231285.mem),
                                                                        &mem_231285.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224374,
                                                                        6,
                                                                        sizeof(mem_231290.mem),
                                                                        &mem_231290.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224374,
                                                                        7,
                                                                        sizeof(mem_231294.mem),
                                                                        &mem_231294.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224374,
                                                                        8,
                                                                        sizeof(mem_231298.mem),
                                                                        &mem_231298.mem));
                                if (1 * ((size_t) segmap_usable_groups_224368 *
                                         (size_t) segmap_group_sizze_224367) !=
                                    0) {
                                    const size_t global_work_sizze_237529[1] =
                                                 {(size_t) segmap_usable_groups_224368 *
                                                 (size_t) segmap_group_sizze_224367};
                                    const size_t local_work_sizze_237533[1] =
                                                 {(size_t) segmap_group_sizze_224367};
                                    int64_t time_start_237530 = 0,
                                            time_end_237531 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                "main.segmap_224374",
                                                global_work_sizze_237529[0],
                                                local_work_sizze_237533[0],
                                                (int) 0);
                                        time_start_237530 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegmap_224374,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237529,
                                                                                    local_work_sizze_237533,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegmap_224374_runs,
                                                                                                                              &ctx->mainzisegmap_224374_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237531 = get_wall_time();
                                        
                                        long time_diff_237532 =
                                             time_end_237531 -
                                             time_start_237530;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segmap_224374",
                                                time_diff_237532);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx, &mem_231277,
                                                          "mem_231277") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231281,
                                                          "mem_231281") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231285,
                                                          "mem_231285") != 0)
                                    return 1;
                                
                                struct memblock_device mem_231303;
                                
                                mem_231303.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231303,
                                                          bytes_229535,
                                                          "mem_231303")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231307;
                                
                                mem_231307.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231307,
                                                          bytes_229535,
                                                          "mem_231307")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_t_203576 * (int64_t) 2,
                                          segred_group_sizze_224389)) {
                                    int64_t segment_sizze_nonzzero_235865 =
                                            smax64((int64_t) 1, q_t_203576);
                                    int64_t num_threads_235866 =
                                            num_groups_224390 *
                                            segred_group_sizze_224389;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-small");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             t_n_m_203740),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203576, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_224389,
                                                                    segment_sizze_nonzzero_235865),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                                   t_n_m_203740,
                                                                                   squot64(segred_group_sizze_224389,
                                                                                           segment_sizze_nonzzero_235865))),
                                                '\n');
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224397,
                                                                            1,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_224389),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224397,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_224389),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224397,
                                                                            3,
                                                                            sizeof(n_203572),
                                                                            &n_203572));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224397,
                                                                            4,
                                                                            sizeof(q_t_203576),
                                                                            &q_t_203576));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224397,
                                                                            5,
                                                                            sizeof(jump_t_203582),
                                                                            &jump_t_203582));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224397,
                                                                            6,
                                                                            sizeof(partition_sizze_203667),
                                                                            &partition_sizze_203667));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224397,
                                                                            7,
                                                                            sizeof(t_n_m_203740),
                                                                            &t_n_m_203740));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224397,
                                                                            8,
                                                                            sizeof(i_203760),
                                                                            &i_203760));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224397,
                                                                            9,
                                                                            sizeof(num_groups_224390),
                                                                            &num_groups_224390));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224397,
                                                                            10,
                                                                            sizeof(segment_sizze_nonzzero_235865),
                                                                            &segment_sizze_nonzzero_235865));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224397,
                                                                            11,
                                                                            sizeof(ext_mem_229304.mem),
                                                                            &ext_mem_229304.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224397,
                                                                            12,
                                                                            sizeof(ext_mem_229305.mem),
                                                                            &ext_mem_229305.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224397,
                                                                            13,
                                                                            sizeof(ext_mem_229568.mem),
                                                                            &ext_mem_229568.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224397,
                                                                            14,
                                                                            sizeof(ext_mem_229569.mem),
                                                                            &ext_mem_229569.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224397,
                                                                            15,
                                                                            sizeof(mem_231259.mem),
                                                                            &mem_231259.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224397,
                                                                            16,
                                                                            sizeof(mem_231263.mem),
                                                                            &mem_231263.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224397,
                                                                            17,
                                                                            sizeof(mem_231290.mem),
                                                                            &mem_231290.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224397,
                                                                            18,
                                                                            sizeof(mem_231294.mem),
                                                                            &mem_231294.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224397,
                                                                            19,
                                                                            sizeof(mem_231298.mem),
                                                                            &mem_231298.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224397,
                                                                            20,
                                                                            sizeof(mem_231303.mem),
                                                                            &mem_231303.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224397,
                                                                            21,
                                                                            sizeof(mem_231307.mem),
                                                                            &mem_231307.mem));
                                    if (1 * ((size_t) num_groups_224390 *
                                             (size_t) segred_group_sizze_224389) !=
                                        0) {
                                        const size_t global_work_sizze_237534[1]
                                                     =
                                                     {(size_t) num_groups_224390 *
                                                     (size_t) segred_group_sizze_224389};
                                        const size_t local_work_sizze_237538[1]
                                                     =
                                                     {(size_t) segred_group_sizze_224389};
                                        int64_t time_start_237535 = 0,
                                                time_end_237536 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                    "main.segred_small_224397",
                                                    global_work_sizze_237534[0],
                                                    local_work_sizze_237538[0],
                                                    (int) (0 + (int64_t) 8 *
                                                           segred_group_sizze_224389 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_224389));
                                            time_start_237535 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_small_224397,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237534,
                                                                                        local_work_sizze_237538,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_small_224397_runs,
                                                                                                                                  &ctx->mainzisegred_small_224397_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237536 = get_wall_time();
                                            
                                            long time_diff_237537 =
                                                 time_end_237536 -
                                                 time_start_237535;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_small_224397",
                                                    time_diff_237537);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_235900 =
                                            sdiv_up64(num_groups_224390,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203667 *
                                                             t_n_m_203740));
                                    int64_t elements_per_thread_235901 =
                                            sdiv_up64(q_t_203576,
                                                      segred_group_sizze_224389 *
                                                      groups_per_segment_235900);
                                    int64_t virt_num_groups_235902 =
                                            groups_per_segment_235900 *
                                            (partition_sizze_203667 *
                                             t_n_m_203740);
                                    int64_t num_threads_235903 =
                                            num_groups_224390 *
                                            segred_group_sizze_224389;
                                    int64_t threads_per_segment_235904 =
                                            groups_per_segment_235900 *
                                            segred_group_sizze_224389;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-large");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             t_n_m_203740),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203576, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_235902,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_224390,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_224389,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_235901,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_235900,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235905;
                                    
                                    segred_tmp_mem_235905.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235905,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235902,
                                                              "segred_tmp_mem_235905")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235907;
                                    
                                    segred_tmp_mem_235907.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235907,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235902,
                                                              "segred_tmp_mem_235907")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_235909 =
                                    ctx->mainzicounter_mem_235909;
                                    
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224397,
                                                                            1,
                                                                            (size_t) 1,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224397,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_224389),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224397,
                                                                            3,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_224389),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224397,
                                                                            4,
                                                                            sizeof(n_203572),
                                                                            &n_203572));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224397,
                                                                            5,
                                                                            sizeof(q_t_203576),
                                                                            &q_t_203576));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224397,
                                                                            6,
                                                                            sizeof(jump_t_203582),
                                                                            &jump_t_203582));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224397,
                                                                            7,
                                                                            sizeof(partition_sizze_203667),
                                                                            &partition_sizze_203667));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224397,
                                                                            8,
                                                                            sizeof(t_n_m_203740),
                                                                            &t_n_m_203740));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224397,
                                                                            9,
                                                                            sizeof(i_203760),
                                                                            &i_203760));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224397,
                                                                            10,
                                                                            sizeof(num_groups_224390),
                                                                            &num_groups_224390));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224397,
                                                                            11,
                                                                            sizeof(groups_per_segment_235900),
                                                                            &groups_per_segment_235900));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224397,
                                                                            12,
                                                                            sizeof(elements_per_thread_235901),
                                                                            &elements_per_thread_235901));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224397,
                                                                            13,
                                                                            sizeof(virt_num_groups_235902),
                                                                            &virt_num_groups_235902));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224397,
                                                                            14,
                                                                            sizeof(threads_per_segment_235904),
                                                                            &threads_per_segment_235904));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224397,
                                                                            15,
                                                                            sizeof(ext_mem_229304.mem),
                                                                            &ext_mem_229304.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224397,
                                                                            16,
                                                                            sizeof(ext_mem_229305.mem),
                                                                            &ext_mem_229305.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224397,
                                                                            17,
                                                                            sizeof(ext_mem_229568.mem),
                                                                            &ext_mem_229568.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224397,
                                                                            18,
                                                                            sizeof(ext_mem_229569.mem),
                                                                            &ext_mem_229569.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224397,
                                                                            19,
                                                                            sizeof(mem_231259.mem),
                                                                            &mem_231259.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224397,
                                                                            20,
                                                                            sizeof(mem_231263.mem),
                                                                            &mem_231263.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224397,
                                                                            21,
                                                                            sizeof(mem_231290.mem),
                                                                            &mem_231290.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224397,
                                                                            22,
                                                                            sizeof(mem_231294.mem),
                                                                            &mem_231294.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224397,
                                                                            23,
                                                                            sizeof(mem_231298.mem),
                                                                            &mem_231298.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224397,
                                                                            24,
                                                                            sizeof(mem_231303.mem),
                                                                            &mem_231303.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224397,
                                                                            25,
                                                                            sizeof(mem_231307.mem),
                                                                            &mem_231307.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224397,
                                                                            26,
                                                                            sizeof(segred_tmp_mem_235905.mem),
                                                                            &segred_tmp_mem_235905.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224397,
                                                                            27,
                                                                            sizeof(segred_tmp_mem_235907.mem),
                                                                            &segred_tmp_mem_235907.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224397,
                                                                            28,
                                                                            sizeof(mainzicounter_mem_235909.mem),
                                                                            &mainzicounter_mem_235909.mem));
                                    if (1 * ((size_t) num_groups_224390 *
                                             (size_t) segred_group_sizze_224389) !=
                                        0) {
                                        const size_t global_work_sizze_237540[1]
                                                     =
                                                     {(size_t) num_groups_224390 *
                                                     (size_t) segred_group_sizze_224389};
                                        const size_t local_work_sizze_237544[1]
                                                     =
                                                     {(size_t) segred_group_sizze_224389};
                                        int64_t time_start_237541 = 0,
                                                time_end_237542 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                    "main.segred_large_224397",
                                                    global_work_sizze_237540[0],
                                                    local_work_sizze_237544[0],
                                                    (int) (0 + 1 + (int64_t) 8 *
                                                           segred_group_sizze_224389 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_224389));
                                            time_start_237541 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_large_224397,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237540,
                                                                                        local_work_sizze_237544,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_large_224397_runs,
                                                                                                                                  &ctx->mainzisegred_large_224397_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237542 = get_wall_time();
                                            
                                            long time_diff_237543 =
                                                 time_end_237542 -
                                                 time_start_237541;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_large_224397",
                                                    time_diff_237543);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235907,
                                                              "segred_tmp_mem_235907") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235905,
                                                              "segred_tmp_mem_235905") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_unref_device(ctx, &mem_231290,
                                                          "mem_231290") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231294,
                                                          "mem_231294") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231298,
                                                          "mem_231298") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_231309,
                                                        &mem_231303,
                                                        "mem_231303") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_231308,
                                                        &mem_231307,
                                                        "mem_231307") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231307,
                                                          "mem_231307") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231303,
                                                          "mem_231303") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231298,
                                                          "mem_231298") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231294,
                                                          "mem_231294") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231290,
                                                          "mem_231290") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231285,
                                                          "mem_231285") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231281,
                                                          "mem_231281") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231277,
                                                          "mem_231277") != 0)
                                    return 1;
                            }
                            if (memblock_unref_device(ctx, &mem_231259,
                                                      "mem_231259") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231263,
                                                      "mem_231263") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231321,
                                                    &ext_mem_231309,
                                                    "ext_mem_231309") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231320,
                                                    &ext_mem_231308,
                                                    "ext_mem_231308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231308,
                                                      "ext_mem_231308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231309,
                                                      "ext_mem_231309") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231263,
                                                      "mem_231263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231259,
                                                      "mem_231259") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231254,
                                                      "mem_231254") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_231508,
                                                &ext_mem_231321,
                                                "ext_mem_231321") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231507,
                                                &ext_mem_231320,
                                                "ext_mem_231320") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231320,
                                                  "ext_mem_231320") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231321,
                                                  "ext_mem_231321") != 0)
                            return 1;
                    } else {
                        bool suff_outer_par_224456;
                        
                        suff_outer_par_224456 =
                            *ctx->tuning_params.mainzisuff_outer_par_32 <=
                            partition_sizze_203667;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_32",
                                    (long) partition_sizze_203667,
                                    suff_outer_par_224456 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_224613;
                        
                        segmap_group_sizze_224613 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_224460;
                        
                        int64_t num_groups_224614;
                        int32_t max_num_groups_235953;
                        
                        max_num_groups_235953 =
                            *ctx->tuning_params.mainzisegmap_num_groups_224462;
                        num_groups_224614 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(partition_sizze_203667,
                                                                                 segmap_group_sizze_224613),
                                                                       sext_i32_i64(max_num_groups_235953))));
                        
                        int64_t segmap_group_sizze_225412;
                        
                        segmap_group_sizze_225412 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_225386;
                        
                        int64_t segmap_group_sizze_225428;
                        
                        segmap_group_sizze_225428 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_225330;
                        
                        int64_t segmap_group_sizze_225453;
                        
                        segmap_group_sizze_225453 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_224772;
                        
                        bool suff_outer_par_225457;
                        
                        suff_outer_par_225457 =
                            *ctx->tuning_params.mainzisuff_outer_par_33 <=
                            nest_sizze_210208;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_33",
                                    (long) nest_sizze_210208,
                                    suff_outer_par_225457 ? "true" : "false");
                        
                        int64_t nest_sizze_225601 = q_t_203576 *
                                nest_sizze_210208;
                        int64_t segred_group_sizze_225602;
                        
                        segred_group_sizze_225602 =
                            *ctx->tuning_params.mainzisegred_group_sizze_225051;
                        
                        int64_t num_groups_225603;
                        int32_t max_num_groups_235954;
                        
                        max_num_groups_235954 =
                            *ctx->tuning_params.mainzisegred_num_groups_225053;
                        num_groups_225603 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_225601,
                                                                                 segred_group_sizze_225602),
                                                                       sext_i32_i64(max_num_groups_235954))));
                        
                        int64_t segmap_group_sizze_225663;
                        
                        segmap_group_sizze_225663 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_225010;
                        
                        int64_t segred_group_sizze_225706;
                        
                        segred_group_sizze_225706 =
                            *ctx->tuning_params.mainzisegred_group_sizze_224922;
                        
                        int64_t num_groups_225707;
                        int32_t max_num_groups_235955;
                        
                        max_num_groups_235955 =
                            *ctx->tuning_params.mainzisegred_num_groups_224924;
                        num_groups_225707 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_225601,
                                                                                 segred_group_sizze_225706),
                                                                       sext_i32_i64(max_num_groups_235955))));
                        
                        int64_t maxSubHelper_232159 = umax64(bytes_229277,
                                                             bytes_229528);
                        int64_t num_threads_232315 = segmap_group_sizze_224613 *
                                num_groups_224614;
                        int64_t total_sizze_232316 = maxSubHelper_232159 *
                                num_threads_232315;
                        int64_t total_sizze_232317 = bytes_229528 *
                                num_threads_232315;
                        int64_t total_sizze_232318 = bytes_229277 *
                                num_threads_232315;
                        int64_t total_sizze_232319 = bytes_229277 *
                                num_threads_232315;
                        struct memblock_device ext_mem_231506;
                        
                        ext_mem_231506.references = NULL;
                        
                        struct memblock_device ext_mem_231505;
                        
                        ext_mem_231505.references = NULL;
                        
                        int32_t local_memory_capacity_236257;
                        
                        local_memory_capacity_236257 =
                            ctx->opencl.max_local_memory;
                        if ((sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_236257)) &&
                             sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_236257))) &&
                            suff_outer_par_224456) {
                            struct memblock_device mem_231324;
                            
                            mem_231324.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231324,
                                                      binop_y_229284,
                                                      "mem_231324")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231324,
                                                                      (int64_t) 0,
                                                                      mem_231028,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_203572,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231324,
                                                          "mem_231324") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231506,
                                                          "ext_mem_231506") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231507,
                                                          "ext_mem_231507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231508,
                                                          "ext_mem_231508") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231509,
                                                          "ext_mem_231509") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231510,
                                                          "ext_mem_231510") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231612,
                                                          "ext_mem_231612") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231613,
                                                          "ext_mem_231613") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231028,
                                                          "mem_231028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231022,
                                                          "ext_mem_231022") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231327;
                            
                            mem_231327.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231327,
                                                      binop_y_229284,
                                                      "mem_231327")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_231327,
                                                                      (int64_t) 0,
                                                                      ext_mem_229305,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_203572,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231327,
                                                          "mem_231327") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231324,
                                                          "mem_231324") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231506,
                                                          "ext_mem_231506") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231507,
                                                          "ext_mem_231507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231508,
                                                          "ext_mem_231508") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231509,
                                                          "ext_mem_231509") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231510,
                                                          "ext_mem_231510") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231612,
                                                          "ext_mem_231612") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231613,
                                                          "ext_mem_231613") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231028,
                                                          "mem_231028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231022,
                                                          "ext_mem_231022") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231330;
                            
                            mem_231330.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231330,
                                                      binop_y_229534,
                                                      "mem_231330")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_231330,
                                                                      (int64_t) 0,
                                                                      ext_mem_229569,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      t_n_m_203740,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231330,
                                                          "mem_231330") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231327,
                                                          "mem_231327") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231324,
                                                          "mem_231324") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231506,
                                                          "ext_mem_231506") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231507,
                                                          "ext_mem_231507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231508,
                                                          "ext_mem_231508") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231509,
                                                          "ext_mem_231509") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231510,
                                                          "ext_mem_231510") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231612,
                                                          "ext_mem_231612") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231613,
                                                          "ext_mem_231613") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231028,
                                                          "mem_231028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231022,
                                                          "ext_mem_231022") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231333;
                            
                            mem_231333.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231333,
                                                      binop_y_229534,
                                                      "mem_231333")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231333,
                                                                      (int64_t) 0,
                                                                      ext_mem_229568,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      t_n_m_203740,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231333,
                                                          "mem_231333") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231330,
                                                          "mem_231330") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231327,
                                                          "mem_231327") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231324,
                                                          "mem_231324") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231506,
                                                          "ext_mem_231506") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231507,
                                                          "ext_mem_231507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231508,
                                                          "ext_mem_231508") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231509,
                                                          "ext_mem_231509") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231510,
                                                          "ext_mem_231510") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231612,
                                                          "ext_mem_231612") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231613,
                                                          "ext_mem_231613") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231028,
                                                          "mem_231028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231022,
                                                          "ext_mem_231022") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231336;
                            
                            mem_231336.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231336,
                                                      binop_y_229284,
                                                      "mem_231336")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            int64_t group_sizze_235959;
                            
                            group_sizze_235959 =
                                *ctx->tuning_params.mainzigroup_sizze_235959;
                            
                            int64_t num_groups_235960 =
                                    sdiv_up64(partition_sizze_203667 * n_203572,
                                              group_sizze_235959);
                            
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235956,
                                                                    0,
                                                                    sizeof(n_203572),
                                                                    &n_203572));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235956,
                                                                    1,
                                                                    sizeof(partition_sizze_203667),
                                                                    &partition_sizze_203667));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235956,
                                                                    2,
                                                                    sizeof(ctx_param_ext_229596),
                                                                    &ctx_param_ext_229596));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235956,
                                                                    3,
                                                                    sizeof(ctx_param_ext_229597),
                                                                    &ctx_param_ext_229597));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235956,
                                                                    4,
                                                                    sizeof(ctx_param_ext_229599),
                                                                    &ctx_param_ext_229599));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235956,
                                                                    5,
                                                                    sizeof(mem_param_229601.mem),
                                                                    &mem_param_229601.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235956,
                                                                    6,
                                                                    sizeof(mem_231336.mem),
                                                                    &mem_231336.mem));
                            if (1 * ((size_t) num_groups_235960 *
                                     (size_t) group_sizze_235959) != 0) {
                                const size_t global_work_sizze_237545[1] =
                                             {(size_t) num_groups_235960 *
                                             (size_t) group_sizze_235959};
                                const size_t local_work_sizze_237549[1] =
                                             {(size_t) group_sizze_235959};
                                int64_t time_start_237546 = 0, time_end_237547 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                            "main.copy_235956",
                                            global_work_sizze_237545[0],
                                            local_work_sizze_237549[0],
                                            (int) 0);
                                    time_start_237546 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzicopy_235956,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237545,
                                                                                local_work_sizze_237549,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzicopy_235956_runs,
                                                                                                                          &ctx->mainzicopy_235956_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237547 = get_wall_time();
                                    
                                    long time_diff_237548 = time_end_237547 -
                                         time_start_237546;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.copy_235956",
                                            time_diff_237548);
                                }
                            }
                            
                            struct memblock_device mem_231415;
                            
                            mem_231415.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231415,
                                                      binop_y_229534,
                                                      "mem_231415")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231418;
                            
                            mem_231418.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231418,
                                                      binop_y_229534,
                                                      "mem_231418")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232160;
                            
                            color_232160.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232160,
                                                      total_sizze_232316,
                                                      "color_232160")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232161;
                            
                            color_232161.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232161,
                                                      total_sizze_232317,
                                                      "color_232161")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232162;
                            
                            color_232162.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232162,
                                                      total_sizze_232318,
                                                      "color_232162")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232163;
                            
                            color_232163.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232163,
                                                      total_sizze_232319,
                                                      "color_232163")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224619,
                                                                    1,
                                                                    sizeof(ctx->failure_is_an_option),
                                                                    &ctx->failure_is_an_option));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224619,
                                                                    3,
                                                                    sizeof(n_203572),
                                                                    &n_203572));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224619,
                                                                    4,
                                                                    sizeof(q_t_203576),
                                                                    &q_t_203576));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224619,
                                                                    5,
                                                                    sizeof(jump_t_203582),
                                                                    &jump_t_203582));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224619,
                                                                    6,
                                                                    sizeof(partition_sizze_203667),
                                                                    &partition_sizze_203667));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224619,
                                                                    7,
                                                                    sizeof(t_n_m_203740),
                                                                    &t_n_m_203740));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224619,
                                                                    8,
                                                                    sizeof(i_203760),
                                                                    &i_203760));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224619,
                                                                    9,
                                                                    sizeof(num_groups_224614),
                                                                    &num_groups_224614));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224619,
                                                                    10,
                                                                    sizeof(num_threads_232315),
                                                                    &num_threads_232315));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224619,
                                                                    11,
                                                                    sizeof(mem_229269.mem),
                                                                    &mem_229269.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224619,
                                                                    12,
                                                                    sizeof(ext_mem_229304.mem),
                                                                    &ext_mem_229304.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224619,
                                                                    13,
                                                                    sizeof(mem_231324.mem),
                                                                    &mem_231324.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224619,
                                                                    14,
                                                                    sizeof(mem_231327.mem),
                                                                    &mem_231327.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224619,
                                                                    15,
                                                                    sizeof(mem_231330.mem),
                                                                    &mem_231330.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224619,
                                                                    16,
                                                                    sizeof(mem_231333.mem),
                                                                    &mem_231333.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224619,
                                                                    17,
                                                                    sizeof(mem_231336.mem),
                                                                    &mem_231336.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224619,
                                                                    18,
                                                                    sizeof(mem_231415.mem),
                                                                    &mem_231415.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224619,
                                                                    19,
                                                                    sizeof(mem_231418.mem),
                                                                    &mem_231418.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224619,
                                                                    20,
                                                                    sizeof(color_232160.mem),
                                                                    &color_232160.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224619,
                                                                    21,
                                                                    sizeof(color_232161.mem),
                                                                    &color_232161.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224619,
                                                                    22,
                                                                    sizeof(color_232162.mem),
                                                                    &color_232162.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224619,
                                                                    23,
                                                                    sizeof(color_232163.mem),
                                                                    &color_232163.mem));
                            if (1 * ((size_t) num_groups_224614 *
                                     (size_t) segmap_group_sizze_224613) != 0) {
                                const size_t global_work_sizze_237550[1] =
                                             {(size_t) num_groups_224614 *
                                             (size_t) segmap_group_sizze_224613};
                                const size_t local_work_sizze_237554[1] =
                                             {(size_t) segmap_group_sizze_224613};
                                int64_t time_start_237551 = 0, time_end_237552 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                            "main.segmap_224619",
                                            global_work_sizze_237550[0],
                                            local_work_sizze_237554[0],
                                            (int) 0);
                                    time_start_237551 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_224619,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237550,
                                                                                local_work_sizze_237554,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_224619_runs,
                                                                                                                          &ctx->mainzisegmap_224619_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237552 = get_wall_time();
                                    
                                    long time_diff_237553 = time_end_237552 -
                                         time_start_237551;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_224619",
                                            time_diff_237553);
                                }
                            }
                            ctx->failure_is_an_option = 1;
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_231324,
                                                      "mem_231324") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231327,
                                                      "mem_231327") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231330,
                                                      "mem_231330") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231333,
                                                      "mem_231333") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231336,
                                                      "mem_231336") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232160,
                                                      "color_232160") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232161,
                                                      "color_232161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232162,
                                                      "color_232162") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232163,
                                                      "color_232163") != 0)
                                return 1;
                            
                            struct memblock_device mem_231498;
                            
                            mem_231498.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231498,
                                                      bytes_229535,
                                                      "mem_231498")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231498,
                                                                      (int64_t) 0,
                                                                      mem_231415,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203667,
                                                                      t_n_m_203740) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231498,
                                                          "mem_231498") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232163,
                                                          "color_232163") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232162,
                                                          "color_232162") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232161,
                                                          "color_232161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232160,
                                                          "color_232160") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231418,
                                                          "mem_231418") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231415,
                                                          "mem_231415") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231336,
                                                          "mem_231336") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231333,
                                                          "mem_231333") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231330,
                                                          "mem_231330") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231327,
                                                          "mem_231327") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231324,
                                                          "mem_231324") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231506,
                                                          "ext_mem_231506") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231507,
                                                          "ext_mem_231507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231508,
                                                          "ext_mem_231508") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231509,
                                                          "ext_mem_231509") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231510,
                                                          "ext_mem_231510") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231612,
                                                          "ext_mem_231612") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231613,
                                                          "ext_mem_231613") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231028,
                                                          "mem_231028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231022,
                                                          "ext_mem_231022") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_231415,
                                                      "mem_231415") != 0)
                                return 1;
                            
                            struct memblock_device mem_231503;
                            
                            mem_231503.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231503,
                                                      bytes_229535,
                                                      "mem_231503")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231503,
                                                                      (int64_t) 0,
                                                                      mem_231418,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203667,
                                                                      t_n_m_203740) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231503,
                                                          "mem_231503") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231498,
                                                          "mem_231498") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232163,
                                                          "color_232163") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232162,
                                                          "color_232162") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232161,
                                                          "color_232161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232160,
                                                          "color_232160") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231418,
                                                          "mem_231418") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231415,
                                                          "mem_231415") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231336,
                                                          "mem_231336") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231333,
                                                          "mem_231333") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231330,
                                                          "mem_231330") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231327,
                                                          "mem_231327") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231324,
                                                          "mem_231324") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231506,
                                                          "ext_mem_231506") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231507,
                                                          "ext_mem_231507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231508,
                                                          "ext_mem_231508") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231509,
                                                          "ext_mem_231509") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231510,
                                                          "ext_mem_231510") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231612,
                                                          "ext_mem_231612") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231613,
                                                          "ext_mem_231613") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231028,
                                                          "mem_231028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231022,
                                                          "ext_mem_231022") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_231418,
                                                      "mem_231418") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231506,
                                                    &mem_231498,
                                                    "mem_231498") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231505,
                                                    &mem_231503,
                                                    "mem_231503") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231503,
                                                      "mem_231503") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231498,
                                                      "mem_231498") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232163,
                                                      "color_232163") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232162,
                                                      "color_232162") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232161,
                                                      "color_232161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232160,
                                                      "color_232160") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231418,
                                                      "mem_231418") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231415,
                                                      "mem_231415") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231336,
                                                      "mem_231336") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231333,
                                                      "mem_231333") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231330,
                                                      "mem_231330") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231327,
                                                      "mem_231327") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231324,
                                                      "mem_231324") != 0)
                                return 1;
                        } else {
                            int64_t segmap_usable_groups_225413 =
                                    sdiv_up64(nest_sizze_207090,
                                              segmap_group_sizze_225412);
                            struct memblock_device mem_231423;
                            
                            mem_231423.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231423,
                                                      bytes_229285,
                                                      "mem_231423")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225417,
                                                                    1,
                                                                    sizeof(n_203572),
                                                                    &n_203572));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225417,
                                                                    2,
                                                                    sizeof(partition_sizze_203667),
                                                                    &partition_sizze_203667));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225417,
                                                                    3,
                                                                    sizeof(mem_229269.mem),
                                                                    &mem_229269.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225417,
                                                                    4,
                                                                    sizeof(mem_231028.mem),
                                                                    &mem_231028.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225417,
                                                                    5,
                                                                    sizeof(mem_231423.mem),
                                                                    &mem_231423.mem));
                            if (1 * ((size_t) segmap_usable_groups_225413 *
                                     (size_t) segmap_group_sizze_225412) != 0) {
                                const size_t global_work_sizze_237555[1] =
                                             {(size_t) segmap_usable_groups_225413 *
                                             (size_t) segmap_group_sizze_225412};
                                const size_t local_work_sizze_237559[1] =
                                             {(size_t) segmap_group_sizze_225412};
                                int64_t time_start_237556 = 0, time_end_237557 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                            "main.segmap_225417",
                                            global_work_sizze_237555[0],
                                            local_work_sizze_237559[0],
                                            (int) 0);
                                    time_start_237556 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_225417,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237555,
                                                                                local_work_sizze_237559,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_225417_runs,
                                                                                                                          &ctx->mainzisegmap_225417_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237557 = get_wall_time();
                                    
                                    long time_diff_237558 = time_end_237557 -
                                         time_start_237556;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_225417",
                                            time_diff_237558);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            
                            int64_t segmap_usable_groups_225429 =
                                    sdiv_up64(nest_sizze_207090,
                                              segmap_group_sizze_225428);
                            struct memblock_device mem_231428;
                            
                            mem_231428.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231428,
                                                      bytes_229285,
                                                      "mem_231428")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231432;
                            
                            mem_231432.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231432,
                                                      bytes_229285,
                                                      "mem_231432")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225434,
                                                                    1,
                                                                    sizeof(ctx->failure_is_an_option),
                                                                    &ctx->failure_is_an_option));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225434,
                                                                    3,
                                                                    sizeof(n_203572),
                                                                    &n_203572));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225434,
                                                                    4,
                                                                    sizeof(partition_sizze_203667),
                                                                    &partition_sizze_203667));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225434,
                                                                    5,
                                                                    sizeof(ctx_param_ext_229596),
                                                                    &ctx_param_ext_229596));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225434,
                                                                    6,
                                                                    sizeof(ctx_param_ext_229597),
                                                                    &ctx_param_ext_229597));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225434,
                                                                    7,
                                                                    sizeof(ctx_param_ext_229599),
                                                                    &ctx_param_ext_229599));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225434,
                                                                    8,
                                                                    sizeof(ext_mem_229305.mem),
                                                                    &ext_mem_229305.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225434,
                                                                    9,
                                                                    sizeof(mem_param_229601.mem),
                                                                    &mem_param_229601.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225434,
                                                                    10,
                                                                    sizeof(mem_231423.mem),
                                                                    &mem_231423.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225434,
                                                                    11,
                                                                    sizeof(mem_231428.mem),
                                                                    &mem_231428.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225434,
                                                                    12,
                                                                    sizeof(mem_231432.mem),
                                                                    &mem_231432.mem));
                            if (1 * ((size_t) segmap_usable_groups_225429 *
                                     (size_t) segmap_group_sizze_225428) != 0) {
                                const size_t global_work_sizze_237560[1] =
                                             {(size_t) segmap_usable_groups_225429 *
                                             (size_t) segmap_group_sizze_225428};
                                const size_t local_work_sizze_237564[1] =
                                             {(size_t) segmap_group_sizze_225428};
                                int64_t time_start_237561 = 0, time_end_237562 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                            "main.segmap_225434",
                                            global_work_sizze_237560[0],
                                            local_work_sizze_237564[0],
                                            (int) 0);
                                    time_start_237561 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_225434,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237560,
                                                                                local_work_sizze_237564,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_225434_runs,
                                                                                                                          &ctx->mainzisegmap_225434_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237562 = get_wall_time();
                                    
                                    long time_diff_237563 = time_end_237562 -
                                         time_start_237561;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_225434",
                                            time_diff_237563);
                                }
                            }
                            ctx->failure_is_an_option = 1;
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_231423,
                                                      "mem_231423") != 0)
                                return 1;
                            
                            int64_t segmap_usable_groups_225454 =
                                    sdiv_up64(nest_sizze_210208,
                                              segmap_group_sizze_225453);
                            struct memblock_device ext_mem_231494;
                            
                            ext_mem_231494.references = NULL;
                            
                            struct memblock_device ext_mem_231493;
                            
                            ext_mem_231493.references = NULL;
                            
                            int32_t local_memory_capacity_236256;
                            
                            local_memory_capacity_236256 =
                                ctx->opencl.max_local_memory;
                            if (sle64((int64_t) 0,
                                      sext_i32_i64(local_memory_capacity_236256)) &&
                                suff_outer_par_225457) {
                                struct memblock_device mem_231437;
                                
                                mem_231437.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231437,
                                                          bytes_229535,
                                                          "mem_231437")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231441;
                                
                                mem_231441.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231441,
                                                          bytes_229535,
                                                          "mem_231441")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225464,
                                                                        1,
                                                                        sizeof(n_203572),
                                                                        &n_203572));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225464,
                                                                        2,
                                                                        sizeof(q_t_203576),
                                                                        &q_t_203576));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225464,
                                                                        3,
                                                                        sizeof(jump_t_203582),
                                                                        &jump_t_203582));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225464,
                                                                        4,
                                                                        sizeof(partition_sizze_203667),
                                                                        &partition_sizze_203667));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225464,
                                                                        5,
                                                                        sizeof(t_n_m_203740),
                                                                        &t_n_m_203740));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225464,
                                                                        6,
                                                                        sizeof(i_203760),
                                                                        &i_203760));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225464,
                                                                        7,
                                                                        sizeof(ext_mem_229304.mem),
                                                                        &ext_mem_229304.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225464,
                                                                        8,
                                                                        sizeof(ext_mem_229305.mem),
                                                                        &ext_mem_229305.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225464,
                                                                        9,
                                                                        sizeof(ext_mem_229568.mem),
                                                                        &ext_mem_229568.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225464,
                                                                        10,
                                                                        sizeof(ext_mem_229569.mem),
                                                                        &ext_mem_229569.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225464,
                                                                        11,
                                                                        sizeof(mem_231428.mem),
                                                                        &mem_231428.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225464,
                                                                        12,
                                                                        sizeof(mem_231432.mem),
                                                                        &mem_231432.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225464,
                                                                        13,
                                                                        sizeof(mem_231437.mem),
                                                                        &mem_231437.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225464,
                                                                        14,
                                                                        sizeof(mem_231441.mem),
                                                                        &mem_231441.mem));
                                if (1 * ((size_t) segmap_usable_groups_225454 *
                                         (size_t) segmap_group_sizze_225453) !=
                                    0) {
                                    const size_t global_work_sizze_237565[1] =
                                                 {(size_t) segmap_usable_groups_225454 *
                                                 (size_t) segmap_group_sizze_225453};
                                    const size_t local_work_sizze_237569[1] =
                                                 {(size_t) segmap_group_sizze_225453};
                                    int64_t time_start_237566 = 0,
                                            time_end_237567 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                "main.segmap_225464",
                                                global_work_sizze_237565[0],
                                                local_work_sizze_237569[0],
                                                (int) 0);
                                        time_start_237566 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegmap_225464,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237565,
                                                                                    local_work_sizze_237569,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegmap_225464_runs,
                                                                                                                              &ctx->mainzisegmap_225464_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237567 = get_wall_time();
                                        
                                        long time_diff_237568 =
                                             time_end_237567 -
                                             time_start_237566;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segmap_225464",
                                                time_diff_237568);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_set_device(ctx, &ext_mem_231494,
                                                        &mem_231437,
                                                        "mem_231437") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_231493,
                                                        &mem_231441,
                                                        "mem_231441") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231441,
                                                          "mem_231441") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231437,
                                                          "mem_231437") != 0)
                                    return 1;
                            } else {
                                struct memblock_device mem_231446;
                                
                                mem_231446.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231446,
                                                          bytes_229535,
                                                          "mem_231446")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231450;
                                
                                mem_231450.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231450,
                                                          bytes_229535,
                                                          "mem_231450")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231454;
                                
                                mem_231454.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231454,
                                                          bytes_229535,
                                                          "mem_231454")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231458;
                                
                                mem_231458.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231458,
                                                          bytes_229535,
                                                          "mem_231458")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231462;
                                
                                mem_231462.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231462,
                                                          bytes_229535,
                                                          "mem_231462")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_t_203576 * (int64_t) 2,
                                          segred_group_sizze_225602)) {
                                    int64_t segment_sizze_nonzzero_236032 =
                                            smax64((int64_t) 1, q_t_203576);
                                    int64_t num_threads_236033 =
                                            num_groups_225603 *
                                            segred_group_sizze_225602;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-small");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             t_n_m_203740),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203576, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_225602,
                                                                    segment_sizze_nonzzero_236032),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                                   t_n_m_203740,
                                                                                   squot64(segred_group_sizze_225602,
                                                                                           segment_sizze_nonzzero_236032))),
                                                '\n');
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225613,
                                                                            1,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_225602),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225613,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_225602),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225613,
                                                                            3,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_225602),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225613,
                                                                            4,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_225602),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225613,
                                                                            5,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_225602),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225613,
                                                                            6,
                                                                            sizeof(n_203572),
                                                                            &n_203572));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225613,
                                                                            7,
                                                                            sizeof(q_t_203576),
                                                                            &q_t_203576));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225613,
                                                                            8,
                                                                            sizeof(jump_t_203582),
                                                                            &jump_t_203582));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225613,
                                                                            9,
                                                                            sizeof(partition_sizze_203667),
                                                                            &partition_sizze_203667));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225613,
                                                                            10,
                                                                            sizeof(t_n_m_203740),
                                                                            &t_n_m_203740));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225613,
                                                                            11,
                                                                            sizeof(i_203760),
                                                                            &i_203760));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225613,
                                                                            12,
                                                                            sizeof(num_groups_225603),
                                                                            &num_groups_225603));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225613,
                                                                            13,
                                                                            sizeof(segment_sizze_nonzzero_236032),
                                                                            &segment_sizze_nonzzero_236032));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225613,
                                                                            14,
                                                                            sizeof(ext_mem_229304.mem),
                                                                            &ext_mem_229304.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225613,
                                                                            15,
                                                                            sizeof(ext_mem_229305.mem),
                                                                            &ext_mem_229305.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225613,
                                                                            16,
                                                                            sizeof(ext_mem_229568.mem),
                                                                            &ext_mem_229568.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225613,
                                                                            17,
                                                                            sizeof(ext_mem_229569.mem),
                                                                            &ext_mem_229569.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225613,
                                                                            18,
                                                                            sizeof(mem_231428.mem),
                                                                            &mem_231428.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225613,
                                                                            19,
                                                                            sizeof(mem_231446.mem),
                                                                            &mem_231446.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225613,
                                                                            20,
                                                                            sizeof(mem_231450.mem),
                                                                            &mem_231450.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225613,
                                                                            21,
                                                                            sizeof(mem_231454.mem),
                                                                            &mem_231454.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225613,
                                                                            22,
                                                                            sizeof(mem_231458.mem),
                                                                            &mem_231458.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225613,
                                                                            23,
                                                                            sizeof(mem_231462.mem),
                                                                            &mem_231462.mem));
                                    if (1 * ((size_t) num_groups_225603 *
                                             (size_t) segred_group_sizze_225602) !=
                                        0) {
                                        const size_t global_work_sizze_237570[1]
                                                     =
                                                     {(size_t) num_groups_225603 *
                                                     (size_t) segred_group_sizze_225602};
                                        const size_t local_work_sizze_237574[1]
                                                     =
                                                     {(size_t) segred_group_sizze_225602};
                                        int64_t time_start_237571 = 0,
                                                time_end_237572 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                    "main.segred_small_225613",
                                                    global_work_sizze_237570[0],
                                                    local_work_sizze_237574[0],
                                                    (int) (0 + (int64_t) 8 *
                                                           segred_group_sizze_225602 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_225602 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_225602 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_225602 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_225602));
                                            time_start_237571 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_small_225613,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237570,
                                                                                        local_work_sizze_237574,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_small_225613_runs,
                                                                                                                                  &ctx->mainzisegred_small_225613_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237572 = get_wall_time();
                                            
                                            long time_diff_237573 =
                                                 time_end_237572 -
                                                 time_start_237571;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_small_225613",
                                                    time_diff_237573);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_236085 =
                                            sdiv_up64(num_groups_225603,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203667 *
                                                             t_n_m_203740));
                                    int64_t elements_per_thread_236086 =
                                            sdiv_up64(q_t_203576,
                                                      segred_group_sizze_225602 *
                                                      groups_per_segment_236085);
                                    int64_t virt_num_groups_236087 =
                                            groups_per_segment_236085 *
                                            (partition_sizze_203667 *
                                             t_n_m_203740);
                                    int64_t num_threads_236088 =
                                            num_groups_225603 *
                                            segred_group_sizze_225602;
                                    int64_t threads_per_segment_236089 =
                                            groups_per_segment_236085 *
                                            segred_group_sizze_225602;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-large");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             t_n_m_203740),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203576, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_236087,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_225603,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_225602,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_236086,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_236085,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236090;
                                    
                                    segred_tmp_mem_236090.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236090,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236087,
                                                              "segred_tmp_mem_236090")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236092;
                                    
                                    segred_tmp_mem_236092.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236092,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236087,
                                                              "segred_tmp_mem_236092")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236094;
                                    
                                    segred_tmp_mem_236094.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236094,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236087,
                                                              "segred_tmp_mem_236094")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236096;
                                    
                                    segred_tmp_mem_236096.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236096,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236087,
                                                              "segred_tmp_mem_236096")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236098;
                                    
                                    segred_tmp_mem_236098.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236098,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236087,
                                                              "segred_tmp_mem_236098")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_236100 =
                                    ctx->mainzicounter_mem_236100;
                                    
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            1,
                                                                            (size_t) 1,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_225602),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            3,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_225602),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            4,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_225602),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            5,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_225602),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            6,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_225602),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            7,
                                                                            sizeof(n_203572),
                                                                            &n_203572));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            8,
                                                                            sizeof(q_t_203576),
                                                                            &q_t_203576));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            9,
                                                                            sizeof(jump_t_203582),
                                                                            &jump_t_203582));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            10,
                                                                            sizeof(partition_sizze_203667),
                                                                            &partition_sizze_203667));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            11,
                                                                            sizeof(t_n_m_203740),
                                                                            &t_n_m_203740));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            12,
                                                                            sizeof(i_203760),
                                                                            &i_203760));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            13,
                                                                            sizeof(num_groups_225603),
                                                                            &num_groups_225603));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            14,
                                                                            sizeof(groups_per_segment_236085),
                                                                            &groups_per_segment_236085));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            15,
                                                                            sizeof(elements_per_thread_236086),
                                                                            &elements_per_thread_236086));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            16,
                                                                            sizeof(virt_num_groups_236087),
                                                                            &virt_num_groups_236087));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            17,
                                                                            sizeof(threads_per_segment_236089),
                                                                            &threads_per_segment_236089));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            18,
                                                                            sizeof(ext_mem_229304.mem),
                                                                            &ext_mem_229304.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            19,
                                                                            sizeof(ext_mem_229305.mem),
                                                                            &ext_mem_229305.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            20,
                                                                            sizeof(ext_mem_229568.mem),
                                                                            &ext_mem_229568.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            21,
                                                                            sizeof(ext_mem_229569.mem),
                                                                            &ext_mem_229569.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            22,
                                                                            sizeof(mem_231428.mem),
                                                                            &mem_231428.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            23,
                                                                            sizeof(mem_231446.mem),
                                                                            &mem_231446.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            24,
                                                                            sizeof(mem_231450.mem),
                                                                            &mem_231450.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            25,
                                                                            sizeof(mem_231454.mem),
                                                                            &mem_231454.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            26,
                                                                            sizeof(mem_231458.mem),
                                                                            &mem_231458.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            27,
                                                                            sizeof(mem_231462.mem),
                                                                            &mem_231462.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            28,
                                                                            sizeof(segred_tmp_mem_236090.mem),
                                                                            &segred_tmp_mem_236090.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            29,
                                                                            sizeof(segred_tmp_mem_236092.mem),
                                                                            &segred_tmp_mem_236092.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            30,
                                                                            sizeof(segred_tmp_mem_236094.mem),
                                                                            &segred_tmp_mem_236094.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            31,
                                                                            sizeof(segred_tmp_mem_236096.mem),
                                                                            &segred_tmp_mem_236096.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            32,
                                                                            sizeof(segred_tmp_mem_236098.mem),
                                                                            &segred_tmp_mem_236098.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225613,
                                                                            33,
                                                                            sizeof(mainzicounter_mem_236100.mem),
                                                                            &mainzicounter_mem_236100.mem));
                                    if (1 * ((size_t) num_groups_225603 *
                                             (size_t) segred_group_sizze_225602) !=
                                        0) {
                                        const size_t global_work_sizze_237576[1]
                                                     =
                                                     {(size_t) num_groups_225603 *
                                                     (size_t) segred_group_sizze_225602};
                                        const size_t local_work_sizze_237580[1]
                                                     =
                                                     {(size_t) segred_group_sizze_225602};
                                        int64_t time_start_237577 = 0,
                                                time_end_237578 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                    "main.segred_large_225613",
                                                    global_work_sizze_237576[0],
                                                    local_work_sizze_237580[0],
                                                    (int) (0 + 1 + (int64_t) 8 *
                                                           segred_group_sizze_225602 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_225602 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_225602 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_225602 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_225602));
                                            time_start_237577 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_large_225613,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237576,
                                                                                        local_work_sizze_237580,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_large_225613_runs,
                                                                                                                                  &ctx->mainzisegred_large_225613_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237578 = get_wall_time();
                                            
                                            long time_diff_237579 =
                                                 time_end_237578 -
                                                 time_start_237577;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_large_225613",
                                                    time_diff_237579);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236098,
                                                              "segred_tmp_mem_236098") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236096,
                                                              "segred_tmp_mem_236096") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236094,
                                                              "segred_tmp_mem_236094") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236092,
                                                              "segred_tmp_mem_236092") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236090,
                                                              "segred_tmp_mem_236090") !=
                                        0)
                                        return 1;
                                }
                                
                                int64_t segmap_usable_groups_225664 =
                                        sdiv_up64(nest_sizze_210208,
                                                  segmap_group_sizze_225663);
                                struct memblock_device mem_231467;
                                
                                mem_231467.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231467,
                                                          bytes_229535,
                                                          "mem_231467")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231471;
                                
                                mem_231471.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231471,
                                                          bytes_229535,
                                                          "mem_231471")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231475;
                                
                                mem_231475.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231475,
                                                          bytes_229535,
                                                          "mem_231475")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231479;
                                
                                mem_231479.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231479,
                                                          bytes_229535,
                                                          "mem_231479")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231483;
                                
                                mem_231483.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231483,
                                                          bytes_229535,
                                                          "mem_231483")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225672,
                                                                        1,
                                                                        sizeof(partition_sizze_203667),
                                                                        &partition_sizze_203667));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225672,
                                                                        2,
                                                                        sizeof(t_n_m_203740),
                                                                        &t_n_m_203740));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225672,
                                                                        3,
                                                                        sizeof(mem_231446.mem),
                                                                        &mem_231446.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225672,
                                                                        4,
                                                                        sizeof(mem_231450.mem),
                                                                        &mem_231450.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225672,
                                                                        5,
                                                                        sizeof(mem_231454.mem),
                                                                        &mem_231454.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225672,
                                                                        6,
                                                                        sizeof(mem_231458.mem),
                                                                        &mem_231458.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225672,
                                                                        7,
                                                                        sizeof(mem_231462.mem),
                                                                        &mem_231462.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225672,
                                                                        8,
                                                                        sizeof(mem_231467.mem),
                                                                        &mem_231467.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225672,
                                                                        9,
                                                                        sizeof(mem_231471.mem),
                                                                        &mem_231471.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225672,
                                                                        10,
                                                                        sizeof(mem_231475.mem),
                                                                        &mem_231475.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225672,
                                                                        11,
                                                                        sizeof(mem_231479.mem),
                                                                        &mem_231479.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225672,
                                                                        12,
                                                                        sizeof(mem_231483.mem),
                                                                        &mem_231483.mem));
                                if (1 * ((size_t) segmap_usable_groups_225664 *
                                         (size_t) segmap_group_sizze_225663) !=
                                    0) {
                                    const size_t global_work_sizze_237581[1] =
                                                 {(size_t) segmap_usable_groups_225664 *
                                                 (size_t) segmap_group_sizze_225663};
                                    const size_t local_work_sizze_237585[1] =
                                                 {(size_t) segmap_group_sizze_225663};
                                    int64_t time_start_237582 = 0,
                                            time_end_237583 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                "main.segmap_225672",
                                                global_work_sizze_237581[0],
                                                local_work_sizze_237585[0],
                                                (int) 0);
                                        time_start_237582 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegmap_225672,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237581,
                                                                                    local_work_sizze_237585,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegmap_225672_runs,
                                                                                                                              &ctx->mainzisegmap_225672_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237583 = get_wall_time();
                                        
                                        long time_diff_237584 =
                                             time_end_237583 -
                                             time_start_237582;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segmap_225672",
                                                time_diff_237584);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx, &mem_231446,
                                                          "mem_231446") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231450,
                                                          "mem_231450") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231454,
                                                          "mem_231454") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231458,
                                                          "mem_231458") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231462,
                                                          "mem_231462") != 0)
                                    return 1;
                                
                                struct memblock_device mem_231488;
                                
                                mem_231488.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231488,
                                                          bytes_229535,
                                                          "mem_231488")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231492;
                                
                                mem_231492.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231492,
                                                          bytes_229535,
                                                          "mem_231492")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_t_203576 * (int64_t) 2,
                                          segred_group_sizze_225706)) {
                                    int64_t segment_sizze_nonzzero_236170 =
                                            smax64((int64_t) 1, q_t_203576);
                                    int64_t num_threads_236171 =
                                            num_groups_225707 *
                                            segred_group_sizze_225706;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-small");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             t_n_m_203740),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203576, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_225706,
                                                                    segment_sizze_nonzzero_236170),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                                   t_n_m_203740,
                                                                                   squot64(segred_group_sizze_225706,
                                                                                           segment_sizze_nonzzero_236170))),
                                                '\n');
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225714,
                                                                            1,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_225706),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225714,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_225706),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225714,
                                                                            3,
                                                                            sizeof(n_203572),
                                                                            &n_203572));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225714,
                                                                            4,
                                                                            sizeof(q_t_203576),
                                                                            &q_t_203576));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225714,
                                                                            5,
                                                                            sizeof(jump_t_203582),
                                                                            &jump_t_203582));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225714,
                                                                            6,
                                                                            sizeof(partition_sizze_203667),
                                                                            &partition_sizze_203667));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225714,
                                                                            7,
                                                                            sizeof(t_n_m_203740),
                                                                            &t_n_m_203740));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225714,
                                                                            8,
                                                                            sizeof(i_203760),
                                                                            &i_203760));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225714,
                                                                            9,
                                                                            sizeof(num_groups_225707),
                                                                            &num_groups_225707));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225714,
                                                                            10,
                                                                            sizeof(segment_sizze_nonzzero_236170),
                                                                            &segment_sizze_nonzzero_236170));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225714,
                                                                            11,
                                                                            sizeof(ext_mem_229304.mem),
                                                                            &ext_mem_229304.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225714,
                                                                            12,
                                                                            sizeof(ext_mem_229305.mem),
                                                                            &ext_mem_229305.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225714,
                                                                            13,
                                                                            sizeof(ext_mem_229568.mem),
                                                                            &ext_mem_229568.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225714,
                                                                            14,
                                                                            sizeof(ext_mem_229569.mem),
                                                                            &ext_mem_229569.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225714,
                                                                            15,
                                                                            sizeof(mem_231428.mem),
                                                                            &mem_231428.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225714,
                                                                            16,
                                                                            sizeof(mem_231432.mem),
                                                                            &mem_231432.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225714,
                                                                            17,
                                                                            sizeof(mem_231467.mem),
                                                                            &mem_231467.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225714,
                                                                            18,
                                                                            sizeof(mem_231471.mem),
                                                                            &mem_231471.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225714,
                                                                            19,
                                                                            sizeof(mem_231475.mem),
                                                                            &mem_231475.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225714,
                                                                            20,
                                                                            sizeof(mem_231479.mem),
                                                                            &mem_231479.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225714,
                                                                            21,
                                                                            sizeof(mem_231483.mem),
                                                                            &mem_231483.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225714,
                                                                            22,
                                                                            sizeof(mem_231488.mem),
                                                                            &mem_231488.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225714,
                                                                            23,
                                                                            sizeof(mem_231492.mem),
                                                                            &mem_231492.mem));
                                    if (1 * ((size_t) num_groups_225707 *
                                             (size_t) segred_group_sizze_225706) !=
                                        0) {
                                        const size_t global_work_sizze_237586[1]
                                                     =
                                                     {(size_t) num_groups_225707 *
                                                     (size_t) segred_group_sizze_225706};
                                        const size_t local_work_sizze_237590[1]
                                                     =
                                                     {(size_t) segred_group_sizze_225706};
                                        int64_t time_start_237587 = 0,
                                                time_end_237588 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                    "main.segred_small_225714",
                                                    global_work_sizze_237586[0],
                                                    local_work_sizze_237590[0],
                                                    (int) (0 + (int64_t) 8 *
                                                           segred_group_sizze_225706 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_225706));
                                            time_start_237587 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_small_225714,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237586,
                                                                                        local_work_sizze_237590,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_small_225714_runs,
                                                                                                                                  &ctx->mainzisegred_small_225714_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237588 = get_wall_time();
                                            
                                            long time_diff_237589 =
                                                 time_end_237588 -
                                                 time_start_237587;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_small_225714",
                                                    time_diff_237589);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_236205 =
                                            sdiv_up64(num_groups_225707,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203667 *
                                                             t_n_m_203740));
                                    int64_t elements_per_thread_236206 =
                                            sdiv_up64(q_t_203576,
                                                      segred_group_sizze_225706 *
                                                      groups_per_segment_236205);
                                    int64_t virt_num_groups_236207 =
                                            groups_per_segment_236205 *
                                            (partition_sizze_203667 *
                                             t_n_m_203740);
                                    int64_t num_threads_236208 =
                                            num_groups_225707 *
                                            segred_group_sizze_225706;
                                    int64_t threads_per_segment_236209 =
                                            groups_per_segment_236205 *
                                            segred_group_sizze_225706;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-large");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             t_n_m_203740),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203576, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_236207,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_225707,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_225706,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_236206,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_236205,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236210;
                                    
                                    segred_tmp_mem_236210.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236210,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236207,
                                                              "segred_tmp_mem_236210")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236212;
                                    
                                    segred_tmp_mem_236212.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236212,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236207,
                                                              "segred_tmp_mem_236212")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_236214 =
                                    ctx->mainzicounter_mem_236214;
                                    
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            1,
                                                                            (size_t) 1,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_225706),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            3,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_225706),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            4,
                                                                            sizeof(n_203572),
                                                                            &n_203572));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            5,
                                                                            sizeof(q_t_203576),
                                                                            &q_t_203576));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            6,
                                                                            sizeof(jump_t_203582),
                                                                            &jump_t_203582));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            7,
                                                                            sizeof(partition_sizze_203667),
                                                                            &partition_sizze_203667));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            8,
                                                                            sizeof(t_n_m_203740),
                                                                            &t_n_m_203740));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            9,
                                                                            sizeof(i_203760),
                                                                            &i_203760));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            10,
                                                                            sizeof(num_groups_225707),
                                                                            &num_groups_225707));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            11,
                                                                            sizeof(groups_per_segment_236205),
                                                                            &groups_per_segment_236205));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            12,
                                                                            sizeof(elements_per_thread_236206),
                                                                            &elements_per_thread_236206));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            13,
                                                                            sizeof(virt_num_groups_236207),
                                                                            &virt_num_groups_236207));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            14,
                                                                            sizeof(threads_per_segment_236209),
                                                                            &threads_per_segment_236209));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            15,
                                                                            sizeof(ext_mem_229304.mem),
                                                                            &ext_mem_229304.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            16,
                                                                            sizeof(ext_mem_229305.mem),
                                                                            &ext_mem_229305.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            17,
                                                                            sizeof(ext_mem_229568.mem),
                                                                            &ext_mem_229568.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            18,
                                                                            sizeof(ext_mem_229569.mem),
                                                                            &ext_mem_229569.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            19,
                                                                            sizeof(mem_231428.mem),
                                                                            &mem_231428.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            20,
                                                                            sizeof(mem_231432.mem),
                                                                            &mem_231432.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            21,
                                                                            sizeof(mem_231467.mem),
                                                                            &mem_231467.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            22,
                                                                            sizeof(mem_231471.mem),
                                                                            &mem_231471.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            23,
                                                                            sizeof(mem_231475.mem),
                                                                            &mem_231475.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            24,
                                                                            sizeof(mem_231479.mem),
                                                                            &mem_231479.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            25,
                                                                            sizeof(mem_231483.mem),
                                                                            &mem_231483.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            26,
                                                                            sizeof(mem_231488.mem),
                                                                            &mem_231488.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            27,
                                                                            sizeof(mem_231492.mem),
                                                                            &mem_231492.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            28,
                                                                            sizeof(segred_tmp_mem_236210.mem),
                                                                            &segred_tmp_mem_236210.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            29,
                                                                            sizeof(segred_tmp_mem_236212.mem),
                                                                            &segred_tmp_mem_236212.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225714,
                                                                            30,
                                                                            sizeof(mainzicounter_mem_236214.mem),
                                                                            &mainzicounter_mem_236214.mem));
                                    if (1 * ((size_t) num_groups_225707 *
                                             (size_t) segred_group_sizze_225706) !=
                                        0) {
                                        const size_t global_work_sizze_237592[1]
                                                     =
                                                     {(size_t) num_groups_225707 *
                                                     (size_t) segred_group_sizze_225706};
                                        const size_t local_work_sizze_237596[1]
                                                     =
                                                     {(size_t) segred_group_sizze_225706};
                                        int64_t time_start_237593 = 0,
                                                time_end_237594 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                    "main.segred_large_225714",
                                                    global_work_sizze_237592[0],
                                                    local_work_sizze_237596[0],
                                                    (int) (0 + 1 + (int64_t) 8 *
                                                           segred_group_sizze_225706 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_225706));
                                            time_start_237593 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_large_225714,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237592,
                                                                                        local_work_sizze_237596,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_large_225714_runs,
                                                                                                                                  &ctx->mainzisegred_large_225714_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237594 = get_wall_time();
                                            
                                            long time_diff_237595 =
                                                 time_end_237594 -
                                                 time_start_237593;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_large_225714",
                                                    time_diff_237595);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236212,
                                                              "segred_tmp_mem_236212") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236210,
                                                              "segred_tmp_mem_236210") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_unref_device(ctx, &mem_231467,
                                                          "mem_231467") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231471,
                                                          "mem_231471") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231475,
                                                          "mem_231475") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231479,
                                                          "mem_231479") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231483,
                                                          "mem_231483") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_231494,
                                                        &mem_231488,
                                                        "mem_231488") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_231493,
                                                        &mem_231492,
                                                        "mem_231492") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231492,
                                                          "mem_231492") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231488,
                                                          "mem_231488") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231483,
                                                          "mem_231483") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231479,
                                                          "mem_231479") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231475,
                                                          "mem_231475") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231471,
                                                          "mem_231471") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231467,
                                                          "mem_231467") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231462,
                                                          "mem_231462") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231458,
                                                          "mem_231458") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231454,
                                                          "mem_231454") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231450,
                                                          "mem_231450") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231446,
                                                          "mem_231446") != 0)
                                    return 1;
                            }
                            if (memblock_unref_device(ctx, &mem_231428,
                                                      "mem_231428") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231432,
                                                      "mem_231432") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231506,
                                                    &ext_mem_231494,
                                                    "ext_mem_231494") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231505,
                                                    &ext_mem_231493,
                                                    "ext_mem_231493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231493,
                                                      "ext_mem_231493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231494,
                                                      "ext_mem_231494") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231432,
                                                      "mem_231432") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231428,
                                                      "mem_231428") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231423,
                                                      "mem_231423") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_231508,
                                                &ext_mem_231506,
                                                "ext_mem_231506") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231507,
                                                &ext_mem_231505,
                                                "ext_mem_231505") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231505,
                                                  "ext_mem_231505") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231506,
                                                  "ext_mem_231506") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_231510,
                                            &ext_mem_231508,
                                            "ext_mem_231508") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231509,
                                            &ext_mem_231507,
                                            "ext_mem_231507") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231507,
                                              "ext_mem_231507") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231508,
                                              "ext_mem_231508") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_231613, &ext_mem_231510,
                                        "ext_mem_231510") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231612, &ext_mem_231509,
                                        "ext_mem_231509") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231509,
                                          "ext_mem_231509") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231510,
                                          "ext_mem_231510") != 0)
                    return 1;
            } else {
                bool match_lit_206304 = (int64_t) 0 == d_t_203579;
                int64_t binop_y_231531 = (int64_t) 8 * q_t_203576;
                int64_t bytes_231532 = smax64((int64_t) 0, binop_y_231531);
                struct memblock_device ext_mem_231611;
                
                ext_mem_231611.references = NULL;
                
                struct memblock_device ext_mem_231610;
                
                ext_mem_231610.references = NULL;
                if (match_lit_206304) {
                    struct memblock_device mem_231514;
                    
                    mem_231514.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231514, bytes_229535,
                                              "mem_231514")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f64(ctx, mem_231514,
                                                      partition_sizze_203667 *
                                                      t_n_m_203740, 0.0) != 0) {
                        if (memblock_unref_device(ctx, &mem_231514,
                                                  "mem_231514") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231610,
                                                  "ext_mem_231610") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231611,
                                                  "ext_mem_231611") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231612,
                                                  "ext_mem_231612") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231613,
                                                  "ext_mem_231613") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231028,
                                                  "mem_231028") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231022,
                                                  "ext_mem_231022") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231015,
                                                  "ext_mem_231015") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231016,
                                                  "ext_mem_231016") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230654,
                                                  "ext_mem_230654") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230637,
                                                  "ext_mem_230637") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230620,
                                                  "ext_mem_230620") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230602,
                                                  "ext_mem_230602") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230594,
                                                  "ext_mem_230594") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230595,
                                                  "ext_mem_230595") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229623,
                                                  "mem_param_229623") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229615,
                                                  "mem_param_229615") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231625,
                                                  "ext_mem_231625") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231626,
                                                  "ext_mem_231626") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229601,
                                                  "mem_param_229601") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229593,
                                                  "mem_param_229593") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229585,
                                                  "mem_param_229585") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231968,
                                                  "ext_mem_231968") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231969,
                                                  "ext_mem_231969") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231970,
                                                  "ext_mem_231970") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230659,
                                                  "mem_230659") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230642,
                                                  "mem_230642") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230625,
                                                  "mem_230625") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230608,
                                                  "mem_230608") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229639,
                                                  "mem_229639") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229634,
                                                  "mem_229634") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229628,
                                                  "mem_229628") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229577,
                                                  "mem_229577") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229573,
                                                  "mem_229573") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229568,
                                                  "ext_mem_229568") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229569,
                                                  "ext_mem_229569") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229519,
                                                  "ext_mem_229519") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229520,
                                                  "ext_mem_229520") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229470,
                                                  "ext_mem_229470") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229471,
                                                  "ext_mem_229471") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229372,
                                                  "ext_mem_229372") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229373,
                                                  "ext_mem_229373") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229314,
                                                  "mem_229314") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229308,
                                                  "mem_229308") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229304,
                                                  "ext_mem_229304") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229305,
                                                  "ext_mem_229305") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229272,
                                                  "mem_229272") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229269,
                                                  "mem_229269") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232074,
                                                  "color_232074") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229265,
                                                  "mem_229265") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229263,
                                                  "mem_229263") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229260,
                                                  "mem_229260") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229242,
                                                  "mem_229242") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232361,
                                                  "mem_out_232361") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232360,
                                                  "mem_out_232360") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232359,
                                                  "mem_out_232359") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    int64_t segmap_group_sizze_225958;
                    
                    segmap_group_sizze_225958 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_225932;
                    
                    int64_t segmap_usable_groups_225959 =
                            sdiv_up64(nest_sizze_207090,
                                      segmap_group_sizze_225958);
                    struct memblock_device mem_231519;
                    
                    mem_231519.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231519, bytes_229285,
                                              "mem_231519")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225963,
                                                            1, sizeof(n_203572),
                                                            &n_203572));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225963,
                                                            2,
                                                            sizeof(partition_sizze_203667),
                                                            &partition_sizze_203667));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225963,
                                                            3,
                                                            sizeof(mem_229269.mem),
                                                            &mem_229269.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225963,
                                                            4,
                                                            sizeof(mem_231028.mem),
                                                            &mem_231028.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225963,
                                                            5,
                                                            sizeof(mem_231519.mem),
                                                            &mem_231519.mem));
                    if (1 * ((size_t) segmap_usable_groups_225959 *
                             (size_t) segmap_group_sizze_225958) != 0) {
                        const size_t global_work_sizze_237597[1] =
                                     {(size_t) segmap_usable_groups_225959 *
                                     (size_t) segmap_group_sizze_225958};
                        const size_t local_work_sizze_237601[1] =
                                     {(size_t) segmap_group_sizze_225958};
                        int64_t time_start_237598 = 0, time_end_237599 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.segmap_225963",
                                    global_work_sizze_237597[0],
                                    local_work_sizze_237601[0], (int) 0);
                            time_start_237598 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_225963,
                                                                        1, NULL,
                                                                        global_work_sizze_237597,
                                                                        local_work_sizze_237601,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_225963_runs,
                                                                                                                  &ctx->mainzisegmap_225963_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_237599 = get_wall_time();
                            
                            long time_diff_237600 = time_end_237599 -
                                 time_start_237598;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_225963", time_diff_237600);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    
                    int64_t segmap_group_sizze_225974;
                    
                    segmap_group_sizze_225974 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_225876;
                    
                    int64_t segmap_usable_groups_225975 =
                            sdiv_up64(nest_sizze_207090,
                                      segmap_group_sizze_225974);
                    struct memblock_device mem_231524;
                    
                    mem_231524.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231524, bytes_229285,
                                              "mem_231524")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_231528;
                    
                    mem_231528.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231528, bytes_229285,
                                              "mem_231528")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225980,
                                                            1,
                                                            sizeof(ctx->failure_is_an_option),
                                                            &ctx->failure_is_an_option));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225980,
                                                            3, sizeof(n_203572),
                                                            &n_203572));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225980,
                                                            4,
                                                            sizeof(partition_sizze_203667),
                                                            &partition_sizze_203667));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225980,
                                                            5,
                                                            sizeof(ctx_param_ext_229596),
                                                            &ctx_param_ext_229596));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225980,
                                                            6,
                                                            sizeof(ctx_param_ext_229597),
                                                            &ctx_param_ext_229597));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225980,
                                                            7,
                                                            sizeof(ctx_param_ext_229599),
                                                            &ctx_param_ext_229599));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225980,
                                                            8,
                                                            sizeof(ext_mem_229305.mem),
                                                            &ext_mem_229305.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225980,
                                                            9,
                                                            sizeof(mem_param_229601.mem),
                                                            &mem_param_229601.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225980,
                                                            10,
                                                            sizeof(mem_231519.mem),
                                                            &mem_231519.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225980,
                                                            11,
                                                            sizeof(mem_231524.mem),
                                                            &mem_231524.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225980,
                                                            12,
                                                            sizeof(mem_231528.mem),
                                                            &mem_231528.mem));
                    if (1 * ((size_t) segmap_usable_groups_225975 *
                             (size_t) segmap_group_sizze_225974) != 0) {
                        const size_t global_work_sizze_237602[1] =
                                     {(size_t) segmap_usable_groups_225975 *
                                     (size_t) segmap_group_sizze_225974};
                        const size_t local_work_sizze_237606[1] =
                                     {(size_t) segmap_group_sizze_225974};
                        int64_t time_start_237603 = 0, time_end_237604 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.segmap_225980",
                                    global_work_sizze_237602[0],
                                    local_work_sizze_237606[0], (int) 0);
                            time_start_237603 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_225980,
                                                                        1, NULL,
                                                                        global_work_sizze_237602,
                                                                        local_work_sizze_237606,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_225980_runs,
                                                                                                                  &ctx->mainzisegmap_225980_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_237604 = get_wall_time();
                            
                            long time_diff_237605 = time_end_237604 -
                                 time_start_237603;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_225980", time_diff_237605);
                        }
                    }
                    ctx->failure_is_an_option = 1;
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &mem_231519, "mem_231519") !=
                        0)
                        return 1;
                    
                    struct memblock_device mem_231538;
                    
                    mem_231538.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231538, bytes_229535,
                                              "mem_231538")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226007,
                                                            1,
                                                            (size_t) ((int64_t) 8 *
                                                                      q_t_203576),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226007,
                                                            2,
                                                            (size_t) ((int64_t) 8 *
                                                                      q_t_203576),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226007,
                                                            3,
                                                            (size_t) bytes_231532,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226007,
                                                            4, sizeof(n_203572),
                                                            &n_203572));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226007,
                                                            5,
                                                            sizeof(q_t_203576),
                                                            &q_t_203576));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226007,
                                                            6,
                                                            sizeof(jump_t_203582),
                                                            &jump_t_203582));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226007,
                                                            7,
                                                            sizeof(partition_sizze_203667),
                                                            &partition_sizze_203667));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226007,
                                                            8,
                                                            sizeof(t_n_m_203740),
                                                            &t_n_m_203740));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226007,
                                                            9, sizeof(i_203760),
                                                            &i_203760));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226007,
                                                            10,
                                                            sizeof(ext_mem_229304.mem),
                                                            &ext_mem_229304.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226007,
                                                            11,
                                                            sizeof(ext_mem_229305.mem),
                                                            &ext_mem_229305.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226007,
                                                            12,
                                                            sizeof(ext_mem_229568.mem),
                                                            &ext_mem_229568.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226007,
                                                            13,
                                                            sizeof(ext_mem_229569.mem),
                                                            &ext_mem_229569.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226007,
                                                            14,
                                                            sizeof(mem_231524.mem),
                                                            &mem_231524.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226007,
                                                            15,
                                                            sizeof(mem_231528.mem),
                                                            &mem_231528.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226007,
                                                            16,
                                                            sizeof(mem_231538.mem),
                                                            &mem_231538.mem));
                    if (1 * ((size_t) nest_sizze_210208 *
                             (size_t) q_t_203576) != 0) {
                        const size_t global_work_sizze_237607[1] =
                                     {(size_t) nest_sizze_210208 *
                                     (size_t) q_t_203576};
                        const size_t local_work_sizze_237611[1] =
                                     {(size_t) q_t_203576};
                        int64_t time_start_237608 = 0, time_end_237609 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.segmap_intragroup_226007",
                                    global_work_sizze_237607[0],
                                    local_work_sizze_237611[0], (int) (0 +
                                                                       (int64_t) 8 *
                                                                       q_t_203576 +
                                                                       (int64_t) 8 *
                                                                       q_t_203576 +
                                                                       bytes_231532));
                            time_start_237608 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_intragroup_226007,
                                                                        1, NULL,
                                                                        global_work_sizze_237607,
                                                                        local_work_sizze_237611,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_intragroup_226007_runs,
                                                                                                                  &ctx->mainzisegmap_intragroup_226007_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_237609 = get_wall_time();
                            
                            long time_diff_237610 = time_end_237609 -
                                 time_start_237608;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_intragroup_226007",
                                    time_diff_237610);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &mem_231524, "mem_231524") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231528, "mem_231528") !=
                        0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231611, &mem_231538,
                                            "mem_231538") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231610, &mem_231514,
                                            "mem_231514") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231538, "mem_231538") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231528, "mem_231528") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231524, "mem_231524") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231519, "mem_231519") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231514, "mem_231514") !=
                        0)
                        return 1;
                } else {
                    bool match_lit_206381 = (int64_t) 1 == d_t_203579;
                    struct memblock_device ext_mem_231609;
                    
                    ext_mem_231609.references = NULL;
                    
                    struct memblock_device ext_mem_231608;
                    
                    ext_mem_231608.references = NULL;
                    if (match_lit_206381) {
                        int64_t segmap_group_sizze_226270;
                        
                        segmap_group_sizze_226270 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_226244;
                        
                        int64_t segmap_usable_groups_226271 =
                                sdiv_up64(nest_sizze_207090,
                                          segmap_group_sizze_226270);
                        struct memblock_device mem_231543;
                        
                        mem_231543.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231543,
                                                  bytes_229285, "mem_231543")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226275,
                                                                1,
                                                                sizeof(n_203572),
                                                                &n_203572));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226275,
                                                                2,
                                                                sizeof(partition_sizze_203667),
                                                                &partition_sizze_203667));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226275,
                                                                3,
                                                                sizeof(mem_229269.mem),
                                                                &mem_229269.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226275,
                                                                4,
                                                                sizeof(mem_231028.mem),
                                                                &mem_231028.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226275,
                                                                5,
                                                                sizeof(mem_231543.mem),
                                                                &mem_231543.mem));
                        if (1 * ((size_t) segmap_usable_groups_226271 *
                                 (size_t) segmap_group_sizze_226270) != 0) {
                            const size_t global_work_sizze_237612[1] =
                                         {(size_t) segmap_usable_groups_226271 *
                                         (size_t) segmap_group_sizze_226270};
                            const size_t local_work_sizze_237616[1] =
                                         {(size_t) segmap_group_sizze_226270};
                            int64_t time_start_237613 = 0, time_end_237614 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.segmap_226275",
                                        global_work_sizze_237612[0],
                                        local_work_sizze_237616[0], (int) 0);
                                time_start_237613 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_226275,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237612,
                                                                            local_work_sizze_237616,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_226275_runs,
                                                                                                                      &ctx->mainzisegmap_226275_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237614 = get_wall_time();
                                
                                long time_diff_237615 = time_end_237614 -
                                     time_start_237613;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_226275", time_diff_237615);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        
                        int64_t segmap_group_sizze_226286;
                        
                        segmap_group_sizze_226286 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_226188;
                        
                        int64_t segmap_usable_groups_226287 =
                                sdiv_up64(nest_sizze_207090,
                                          segmap_group_sizze_226286);
                        struct memblock_device mem_231548;
                        
                        mem_231548.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231548,
                                                  bytes_229285, "mem_231548")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231552;
                        
                        mem_231552.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231552,
                                                  bytes_229285, "mem_231552")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226292,
                                                                1,
                                                                sizeof(ctx->failure_is_an_option),
                                                                &ctx->failure_is_an_option));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226292,
                                                                3,
                                                                sizeof(n_203572),
                                                                &n_203572));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226292,
                                                                4,
                                                                sizeof(partition_sizze_203667),
                                                                &partition_sizze_203667));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226292,
                                                                5,
                                                                sizeof(ctx_param_ext_229596),
                                                                &ctx_param_ext_229596));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226292,
                                                                6,
                                                                sizeof(ctx_param_ext_229597),
                                                                &ctx_param_ext_229597));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226292,
                                                                7,
                                                                sizeof(ctx_param_ext_229599),
                                                                &ctx_param_ext_229599));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226292,
                                                                8,
                                                                sizeof(ext_mem_229305.mem),
                                                                &ext_mem_229305.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226292,
                                                                9,
                                                                sizeof(mem_param_229601.mem),
                                                                &mem_param_229601.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226292,
                                                                10,
                                                                sizeof(mem_231543.mem),
                                                                &mem_231543.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226292,
                                                                11,
                                                                sizeof(mem_231548.mem),
                                                                &mem_231548.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226292,
                                                                12,
                                                                sizeof(mem_231552.mem),
                                                                &mem_231552.mem));
                        if (1 * ((size_t) segmap_usable_groups_226287 *
                                 (size_t) segmap_group_sizze_226286) != 0) {
                            const size_t global_work_sizze_237617[1] =
                                         {(size_t) segmap_usable_groups_226287 *
                                         (size_t) segmap_group_sizze_226286};
                            const size_t local_work_sizze_237621[1] =
                                         {(size_t) segmap_group_sizze_226286};
                            int64_t time_start_237618 = 0, time_end_237619 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.segmap_226292",
                                        global_work_sizze_237617[0],
                                        local_work_sizze_237621[0], (int) 0);
                                time_start_237618 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_226292,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237617,
                                                                            local_work_sizze_237621,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_226292_runs,
                                                                                                                      &ctx->mainzisegmap_226292_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237619 = get_wall_time();
                                
                                long time_diff_237620 = time_end_237619 -
                                     time_start_237618;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_226292", time_diff_237620);
                            }
                        }
                        ctx->failure_is_an_option = 1;
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_231543,
                                                  "mem_231543") != 0)
                            return 1;
                        
                        struct memblock_device mem_231565;
                        
                        mem_231565.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231565,
                                                  bytes_229535, "mem_231565")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231569;
                        
                        mem_231569.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231569,
                                                  bytes_229535, "mem_231569")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226320,
                                                                1,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_t_203576),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226320,
                                                                2,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_t_203576),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226320,
                                                                3,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_t_203576),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226320,
                                                                4,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_t_203576),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226320,
                                                                5,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_t_203576),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226320,
                                                                6,
                                                                (size_t) bytes_231532,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226320,
                                                                7,
                                                                (size_t) bytes_231532,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226320,
                                                                8,
                                                                sizeof(n_203572),
                                                                &n_203572));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226320,
                                                                9,
                                                                sizeof(q_t_203576),
                                                                &q_t_203576));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226320,
                                                                10,
                                                                sizeof(jump_t_203582),
                                                                &jump_t_203582));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226320,
                                                                11,
                                                                sizeof(partition_sizze_203667),
                                                                &partition_sizze_203667));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226320,
                                                                12,
                                                                sizeof(t_n_m_203740),
                                                                &t_n_m_203740));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226320,
                                                                13,
                                                                sizeof(i_203760),
                                                                &i_203760));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226320,
                                                                14,
                                                                sizeof(ext_mem_229304.mem),
                                                                &ext_mem_229304.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226320,
                                                                15,
                                                                sizeof(ext_mem_229305.mem),
                                                                &ext_mem_229305.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226320,
                                                                16,
                                                                sizeof(ext_mem_229568.mem),
                                                                &ext_mem_229568.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226320,
                                                                17,
                                                                sizeof(ext_mem_229569.mem),
                                                                &ext_mem_229569.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226320,
                                                                18,
                                                                sizeof(mem_231548.mem),
                                                                &mem_231548.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226320,
                                                                19,
                                                                sizeof(mem_231552.mem),
                                                                &mem_231552.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226320,
                                                                20,
                                                                sizeof(mem_231565.mem),
                                                                &mem_231565.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226320,
                                                                21,
                                                                sizeof(mem_231569.mem),
                                                                &mem_231569.mem));
                        if (1 * ((size_t) nest_sizze_210208 *
                                 (size_t) q_t_203576) != 0) {
                            const size_t global_work_sizze_237622[1] =
                                         {(size_t) nest_sizze_210208 *
                                         (size_t) q_t_203576};
                            const size_t local_work_sizze_237626[1] =
                                         {(size_t) q_t_203576};
                            int64_t time_start_237623 = 0, time_end_237624 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.segmap_intragroup_226320",
                                        global_work_sizze_237622[0],
                                        local_work_sizze_237626[0], (int) (0 +
                                                                           (int64_t) 8 *
                                                                           q_t_203576 +
                                                                           (int64_t) 8 *
                                                                           q_t_203576 +
                                                                           (int64_t) 8 *
                                                                           q_t_203576 +
                                                                           (int64_t) 8 *
                                                                           q_t_203576 +
                                                                           (int64_t) 8 *
                                                                           q_t_203576 +
                                                                           bytes_231532 +
                                                                           bytes_231532));
                                time_start_237623 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_intragroup_226320,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237622,
                                                                            local_work_sizze_237626,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_intragroup_226320_runs,
                                                                                                                      &ctx->mainzisegmap_intragroup_226320_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237624 = get_wall_time();
                                
                                long time_diff_237625 = time_end_237624 -
                                     time_start_237623;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_226320",
                                        time_diff_237625);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_231548,
                                                  "mem_231548") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231552,
                                                  "mem_231552") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231609,
                                                &mem_231565, "mem_231565") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231608,
                                                &mem_231569, "mem_231569") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231569,
                                                  "mem_231569") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231565,
                                                  "mem_231565") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231552,
                                                  "mem_231552") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231548,
                                                  "mem_231548") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231543,
                                                  "mem_231543") != 0)
                            return 1;
                    } else {
                        int64_t segmap_group_sizze_226674;
                        
                        segmap_group_sizze_226674 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_226648;
                        
                        int64_t segmap_usable_groups_226675 =
                                sdiv_up64(nest_sizze_207090,
                                          segmap_group_sizze_226674);
                        struct memblock_device mem_231574;
                        
                        mem_231574.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231574,
                                                  bytes_229285, "mem_231574")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226679,
                                                                1,
                                                                sizeof(n_203572),
                                                                &n_203572));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226679,
                                                                2,
                                                                sizeof(partition_sizze_203667),
                                                                &partition_sizze_203667));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226679,
                                                                3,
                                                                sizeof(mem_229269.mem),
                                                                &mem_229269.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226679,
                                                                4,
                                                                sizeof(mem_231028.mem),
                                                                &mem_231028.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226679,
                                                                5,
                                                                sizeof(mem_231574.mem),
                                                                &mem_231574.mem));
                        if (1 * ((size_t) segmap_usable_groups_226675 *
                                 (size_t) segmap_group_sizze_226674) != 0) {
                            const size_t global_work_sizze_237627[1] =
                                         {(size_t) segmap_usable_groups_226675 *
                                         (size_t) segmap_group_sizze_226674};
                            const size_t local_work_sizze_237631[1] =
                                         {(size_t) segmap_group_sizze_226674};
                            int64_t time_start_237628 = 0, time_end_237629 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.segmap_226679",
                                        global_work_sizze_237627[0],
                                        local_work_sizze_237631[0], (int) 0);
                                time_start_237628 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_226679,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237627,
                                                                            local_work_sizze_237631,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_226679_runs,
                                                                                                                      &ctx->mainzisegmap_226679_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237629 = get_wall_time();
                                
                                long time_diff_237630 = time_end_237629 -
                                     time_start_237628;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_226679", time_diff_237630);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        
                        int64_t segmap_group_sizze_226690;
                        
                        segmap_group_sizze_226690 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_226592;
                        
                        int64_t segmap_usable_groups_226691 =
                                sdiv_up64(nest_sizze_207090,
                                          segmap_group_sizze_226690);
                        struct memblock_device mem_231579;
                        
                        mem_231579.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231579,
                                                  bytes_229285, "mem_231579")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231583;
                        
                        mem_231583.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231583,
                                                  bytes_229285, "mem_231583")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226696,
                                                                1,
                                                                sizeof(ctx->failure_is_an_option),
                                                                &ctx->failure_is_an_option));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226696,
                                                                3,
                                                                sizeof(n_203572),
                                                                &n_203572));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226696,
                                                                4,
                                                                sizeof(partition_sizze_203667),
                                                                &partition_sizze_203667));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226696,
                                                                5,
                                                                sizeof(ctx_param_ext_229596),
                                                                &ctx_param_ext_229596));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226696,
                                                                6,
                                                                sizeof(ctx_param_ext_229597),
                                                                &ctx_param_ext_229597));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226696,
                                                                7,
                                                                sizeof(ctx_param_ext_229599),
                                                                &ctx_param_ext_229599));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226696,
                                                                8,
                                                                sizeof(ext_mem_229305.mem),
                                                                &ext_mem_229305.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226696,
                                                                9,
                                                                sizeof(mem_param_229601.mem),
                                                                &mem_param_229601.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226696,
                                                                10,
                                                                sizeof(mem_231574.mem),
                                                                &mem_231574.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226696,
                                                                11,
                                                                sizeof(mem_231579.mem),
                                                                &mem_231579.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226696,
                                                                12,
                                                                sizeof(mem_231583.mem),
                                                                &mem_231583.mem));
                        if (1 * ((size_t) segmap_usable_groups_226691 *
                                 (size_t) segmap_group_sizze_226690) != 0) {
                            const size_t global_work_sizze_237632[1] =
                                         {(size_t) segmap_usable_groups_226691 *
                                         (size_t) segmap_group_sizze_226690};
                            const size_t local_work_sizze_237636[1] =
                                         {(size_t) segmap_group_sizze_226690};
                            int64_t time_start_237633 = 0, time_end_237634 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.segmap_226696",
                                        global_work_sizze_237632[0],
                                        local_work_sizze_237636[0], (int) 0);
                                time_start_237633 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_226696,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237632,
                                                                            local_work_sizze_237636,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_226696_runs,
                                                                                                                      &ctx->mainzisegmap_226696_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237634 = get_wall_time();
                                
                                long time_diff_237635 = time_end_237634 -
                                     time_start_237633;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_226696", time_diff_237635);
                            }
                        }
                        ctx->failure_is_an_option = 1;
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_231574,
                                                  "mem_231574") != 0)
                            return 1;
                        
                        struct memblock_device mem_231603;
                        
                        mem_231603.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231603,
                                                  bytes_229535, "mem_231603")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231607;
                        
                        mem_231607.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231607,
                                                  bytes_229535, "mem_231607")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226724,
                                                                1,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_t_203576),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226724,
                                                                2,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_t_203576),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226724,
                                                                3,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_t_203576),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226724,
                                                                4,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_t_203576),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226724,
                                                                5,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_t_203576),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226724,
                                                                6,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_t_203576),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226724,
                                                                7,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_t_203576),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226724,
                                                                8,
                                                                (size_t) bytes_231532,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226724,
                                                                9,
                                                                (size_t) bytes_231532,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226724,
                                                                10,
                                                                (size_t) bytes_231532,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226724,
                                                                11,
                                                                (size_t) bytes_231532,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226724,
                                                                12,
                                                                sizeof(n_203572),
                                                                &n_203572));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226724,
                                                                13,
                                                                sizeof(q_t_203576),
                                                                &q_t_203576));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226724,
                                                                14,
                                                                sizeof(jump_t_203582),
                                                                &jump_t_203582));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226724,
                                                                15,
                                                                sizeof(partition_sizze_203667),
                                                                &partition_sizze_203667));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226724,
                                                                16,
                                                                sizeof(t_n_m_203740),
                                                                &t_n_m_203740));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226724,
                                                                17,
                                                                sizeof(i_203760),
                                                                &i_203760));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226724,
                                                                18,
                                                                sizeof(ext_mem_229304.mem),
                                                                &ext_mem_229304.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226724,
                                                                19,
                                                                sizeof(ext_mem_229305.mem),
                                                                &ext_mem_229305.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226724,
                                                                20,
                                                                sizeof(ext_mem_229568.mem),
                                                                &ext_mem_229568.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226724,
                                                                21,
                                                                sizeof(ext_mem_229569.mem),
                                                                &ext_mem_229569.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226724,
                                                                22,
                                                                sizeof(mem_231579.mem),
                                                                &mem_231579.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226724,
                                                                23,
                                                                sizeof(mem_231583.mem),
                                                                &mem_231583.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226724,
                                                                24,
                                                                sizeof(mem_231603.mem),
                                                                &mem_231603.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226724,
                                                                25,
                                                                sizeof(mem_231607.mem),
                                                                &mem_231607.mem));
                        if (1 * ((size_t) nest_sizze_210208 *
                                 (size_t) q_t_203576) != 0) {
                            const size_t global_work_sizze_237637[1] =
                                         {(size_t) nest_sizze_210208 *
                                         (size_t) q_t_203576};
                            const size_t local_work_sizze_237641[1] =
                                         {(size_t) q_t_203576};
                            int64_t time_start_237638 = 0, time_end_237639 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.segmap_intragroup_226724",
                                        global_work_sizze_237637[0],
                                        local_work_sizze_237641[0], (int) (0 +
                                                                           (int64_t) 8 *
                                                                           q_t_203576 +
                                                                           (int64_t) 8 *
                                                                           q_t_203576 +
                                                                           (int64_t) 8 *
                                                                           q_t_203576 +
                                                                           (int64_t) 8 *
                                                                           q_t_203576 +
                                                                           (int64_t) 8 *
                                                                           q_t_203576 +
                                                                           (int64_t) 8 *
                                                                           q_t_203576 +
                                                                           (int64_t) 8 *
                                                                           q_t_203576 +
                                                                           bytes_231532 +
                                                                           bytes_231532 +
                                                                           bytes_231532 +
                                                                           bytes_231532));
                                time_start_237638 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_intragroup_226724,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237637,
                                                                            local_work_sizze_237641,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_intragroup_226724_runs,
                                                                                                                      &ctx->mainzisegmap_intragroup_226724_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237639 = get_wall_time();
                                
                                long time_diff_237640 = time_end_237639 -
                                     time_start_237638;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_226724",
                                        time_diff_237640);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_231579,
                                                  "mem_231579") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231583,
                                                  "mem_231583") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231609,
                                                &mem_231603, "mem_231603") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231608,
                                                &mem_231607, "mem_231607") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231607,
                                                  "mem_231607") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231603,
                                                  "mem_231603") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231583,
                                                  "mem_231583") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231579,
                                                  "mem_231579") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231574,
                                                  "mem_231574") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_231611,
                                            &ext_mem_231609,
                                            "ext_mem_231609") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231610,
                                            &ext_mem_231608,
                                            "ext_mem_231608") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231608,
                                              "ext_mem_231608") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231609,
                                              "ext_mem_231609") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_231613, &ext_mem_231611,
                                        "ext_mem_231611") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231612, &ext_mem_231610,
                                        "ext_mem_231610") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231610,
                                          "ext_mem_231610") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231611,
                                          "ext_mem_231611") != 0)
                    return 1;
            }
            
            struct memblock_device ext_mem_231619;
            
            ext_mem_231619.references = NULL;
            if (cond_204198) {
                bool zzero_206670 = jump_t_203582 == (int64_t) 0;
                bool nonzzero_206671 = !zzero_206670;
                bool nonzzero_cert_206672;
                
                if (!nonzzero_206671) {
                    ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                           "division by zero",
                                           "-> #0  loess.fut:547:20-27\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:546:3-550:9\n   #5  stl.fut:304:23-75\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:303:15-305:43\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n");
                    if (memblock_unref_device(ctx, &ext_mem_231619,
                                              "ext_mem_231619") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231612,
                                              "ext_mem_231612") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231613,
                                              "ext_mem_231613") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231028, "mem_231028") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231022,
                                              "ext_mem_231022") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231015,
                                              "ext_mem_231015") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231016,
                                              "ext_mem_231016") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230654,
                                              "ext_mem_230654") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230637,
                                              "ext_mem_230637") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230620,
                                              "ext_mem_230620") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230602,
                                              "ext_mem_230602") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230594,
                                              "ext_mem_230594") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230595,
                                              "ext_mem_230595") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229623,
                                              "mem_param_229623") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229615,
                                              "mem_param_229615") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231625,
                                              "ext_mem_231625") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231626,
                                              "ext_mem_231626") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229601,
                                              "mem_param_229601") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229593,
                                              "mem_param_229593") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229585,
                                              "mem_param_229585") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231968,
                                              "ext_mem_231968") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231969,
                                              "ext_mem_231969") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231970,
                                              "ext_mem_231970") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230659, "mem_230659") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230642, "mem_230642") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230625, "mem_230625") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230608, "mem_230608") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229639, "mem_229639") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229634, "mem_229634") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229628, "mem_229628") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229577, "mem_229577") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229573, "mem_229573") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229568,
                                              "ext_mem_229568") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229569,
                                              "ext_mem_229569") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229519,
                                              "ext_mem_229519") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229520,
                                              "ext_mem_229520") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229470,
                                              "ext_mem_229470") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229471,
                                              "ext_mem_229471") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229372,
                                              "ext_mem_229372") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229373,
                                              "ext_mem_229373") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229304,
                                              "ext_mem_229304") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229305,
                                              "ext_mem_229305") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232074,
                                              "color_232074") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232361,
                                              "mem_out_232361") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232360,
                                              "mem_out_232360") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232359,
                                              "mem_out_232359") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                int64_t y_206673 = sub64(t_n_m_203740, (int64_t) 1);
                int64_t segmap_group_sizze_226979;
                
                segmap_group_sizze_226979 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_226861;
                
                int64_t segmap_usable_groups_226980 =
                        sdiv_up64(nest_sizze_207090, segmap_group_sizze_226979);
                struct memblock_device mem_231618;
                
                mem_231618.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231618, bytes_229285,
                                          "mem_231618")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226984,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226984,
                                                        3, sizeof(n_203572),
                                                        &n_203572));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226984,
                                                        4,
                                                        sizeof(jump_t_203582),
                                                        &jump_t_203582));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226984,
                                                        5,
                                                        sizeof(partition_sizze_203667),
                                                        &partition_sizze_203667));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226984,
                                                        6, sizeof(t_n_m_203740),
                                                        &t_n_m_203740));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226984,
                                                        7, sizeof(i_203760),
                                                        &i_203760));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226984,
                                                        8, sizeof(y_206673),
                                                        &y_206673));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226984,
                                                        9,
                                                        sizeof(ext_mem_231612.mem),
                                                        &ext_mem_231612.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226984,
                                                        10,
                                                        sizeof(ext_mem_231613.mem),
                                                        &ext_mem_231613.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226984,
                                                        11,
                                                        sizeof(mem_231618.mem),
                                                        &mem_231618.mem));
                if (1 * ((size_t) segmap_usable_groups_226980 *
                         (size_t) segmap_group_sizze_226979) != 0) {
                    const size_t global_work_sizze_237642[1] =
                                 {(size_t) segmap_usable_groups_226980 *
                                 (size_t) segmap_group_sizze_226979};
                    const size_t local_work_sizze_237646[1] =
                                 {(size_t) segmap_group_sizze_226979};
                    int64_t time_start_237643 = 0, time_end_237644 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.segmap_226984",
                                global_work_sizze_237642[0],
                                local_work_sizze_237646[0], (int) 0);
                        time_start_237643 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_226984,
                                                                    1, NULL,
                                                                    global_work_sizze_237642,
                                                                    local_work_sizze_237646,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_226984_runs,
                                                                                                              &ctx->mainzisegmap_226984_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237644 = get_wall_time();
                        
                        long time_diff_237645 = time_end_237644 -
                             time_start_237643;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_226984", time_diff_237645);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_set_device(ctx, &ext_mem_231619, &mem_231618,
                                        "mem_231618") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231618, "mem_231618") != 0)
                    return 1;
            } else {
                bool dim_match_206726 = n_203572 == t_n_m_203740;
                bool empty_or_match_cert_206727;
                
                if (!dim_match_206726) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Value of (core language) shape (",
                                  (long long) partition_sizze_203667, ", ",
                                  (long long) t_n_m_203740,
                                  ") cannot match shape of type `[",
                                  (long long) partition_sizze_203667, "][",
                                  (long long) n_203572, "]t`.",
                                  "-> #0  stl.fut:307:15-36\n   #1  stl.fut:415:61-429:75\n   #2  stl.fut:455:3-469:34\n   #3  stl.fut:439:1-469:34\n");
                    if (memblock_unref_device(ctx, &ext_mem_231619,
                                              "ext_mem_231619") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231612,
                                              "ext_mem_231612") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231613,
                                              "ext_mem_231613") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231028, "mem_231028") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231022,
                                              "ext_mem_231022") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231015,
                                              "ext_mem_231015") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231016,
                                              "ext_mem_231016") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230654,
                                              "ext_mem_230654") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230637,
                                              "ext_mem_230637") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230620,
                                              "ext_mem_230620") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230602,
                                              "ext_mem_230602") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230594,
                                              "ext_mem_230594") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230595,
                                              "ext_mem_230595") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229623,
                                              "mem_param_229623") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229615,
                                              "mem_param_229615") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231625,
                                              "ext_mem_231625") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231626,
                                              "ext_mem_231626") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229601,
                                              "mem_param_229601") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229593,
                                              "mem_param_229593") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229585,
                                              "mem_param_229585") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231968,
                                              "ext_mem_231968") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231969,
                                              "ext_mem_231969") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231970,
                                              "ext_mem_231970") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230659, "mem_230659") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230642, "mem_230642") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230625, "mem_230625") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230608, "mem_230608") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229639, "mem_229639") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229634, "mem_229634") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229628, "mem_229628") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229577, "mem_229577") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229573, "mem_229573") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229568,
                                              "ext_mem_229568") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229569,
                                              "ext_mem_229569") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229519,
                                              "ext_mem_229519") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229520,
                                              "ext_mem_229520") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229470,
                                              "ext_mem_229470") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229471,
                                              "ext_mem_229471") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229372,
                                              "ext_mem_229372") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229373,
                                              "ext_mem_229373") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229304,
                                              "ext_mem_229304") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229305,
                                              "ext_mem_229305") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232074,
                                              "color_232074") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232361,
                                              "mem_out_232361") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232360,
                                              "mem_out_232360") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232359,
                                              "mem_out_232359") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                if (memblock_set_device(ctx, &ext_mem_231619, &ext_mem_231613,
                                        "ext_mem_231613") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &ext_mem_231612, "ext_mem_231612") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231613, "ext_mem_231613") !=
                0)
                return 1;
            
            int64_t ctx_param_ext_tmp_232980 = ext_231620;
            int64_t ctx_param_ext_tmp_232981 = ext_231620;
            struct memblock_device mem_param_tmp_232982;
            
            mem_param_tmp_232982.references = NULL;
            if (memblock_set_device(ctx, &mem_param_tmp_232982, &mem_231028,
                                    "mem_231028") != 0)
                return 1;
            
            struct memblock_device mem_param_tmp_232983;
            
            mem_param_tmp_232983.references = NULL;
            if (memblock_set_device(ctx, &mem_param_tmp_232983, &ext_mem_231619,
                                    "ext_mem_231619") != 0)
                return 1;
            ctx_param_ext_229617 = ctx_param_ext_tmp_232980;
            ctx_param_ext_229619 = ctx_param_ext_tmp_232981;
            if (memblock_set_device(ctx, &mem_param_229615,
                                    &mem_param_tmp_232982,
                                    "mem_param_tmp_232982") != 0)
                return 1;
            if (memblock_set_device(ctx, &mem_param_229623,
                                    &mem_param_tmp_232983,
                                    "mem_param_tmp_232983") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_param_tmp_232983,
                                      "mem_param_tmp_232983") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_param_tmp_232982,
                                      "mem_param_tmp_232982") != 0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231619, "ext_mem_231619") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231612, "ext_mem_231612") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231613, "ext_mem_231613") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_231028, "mem_231028") != 0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231022, "ext_mem_231022") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231015, "ext_mem_231015") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231016, "ext_mem_231016") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230654, "ext_mem_230654") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230637, "ext_mem_230637") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230620, "ext_mem_230620") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230602, "ext_mem_230602") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230594, "ext_mem_230594") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230595, "ext_mem_230595") !=
                0)
                return 1;
        }
        ext_231632 = ctx_param_ext_229617;
        ext_231630 = ctx_param_ext_229619;
        if (memblock_set_device(ctx, &ext_mem_231626, &mem_param_229615,
                                "mem_param_229615") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_231625, &mem_param_229623,
                                "mem_param_229623") != 0)
            return 1;
        
        bool cond_206729 = slt64(i_outer_204282, y_204199);
        int64_t ext_231967;
        
        if (cond_206729) {
            ext_231967 = partition_sizze_203667;
        } else {
            ext_231967 = ctx_param_ext_229598;
        }
        
        int64_t ext_231966;
        
        if (cond_206729) {
            ext_231966 = n_203572;
        } else {
            ext_231966 = ctx_param_ext_229600;
        }
        
        int64_t ext_231965;
        
        if (cond_206729) {
            ext_231965 = partition_sizze_203667;
        } else {
            ext_231965 = ctx_param_ext_229594;
        }
        
        int64_t ext_231964;
        
        if (cond_206729) {
            ext_231964 = n_203572;
        } else {
            ext_231964 = ctx_param_ext_229595;
        }
        
        int64_t ext_231963;
        
        if (cond_206729) {
            ext_231963 = n_203572;
        } else {
            ext_231963 = ctx_param_ext_229597;
        }
        
        int64_t ext_231962;
        
        if (cond_206729) {
            ext_231962 = (int64_t) 1;
        } else {
            ext_231962 = ctx_param_ext_229599;
        }
        
        int64_t ext_231961;
        
        if (cond_206729) {
            ext_231961 = (int64_t) 0;
        } else {
            ext_231961 = ctx_param_ext_229596;
        }
        
        struct memblock_device ext_mem_231960;
        
        ext_mem_231960.references = NULL;
        if (cond_206729) {
            bool suff_intra_par_227067;
            
            suff_intra_par_227067 =
                *ctx->tuning_params.mainzisuff_intra_par_34 <= n_203572;
            if (ctx->logging)
                fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                        "main.suff_intra_par_34", (long) n_203572,
                        suff_intra_par_227067 ? "true" : "false");
            
            bool intra_suff_and_fits_227070 = fits_206978 &&
                 suff_intra_par_227067;
            int64_t segmap_group_sizze_227196;
            
            segmap_group_sizze_227196 =
                *ctx->tuning_params.mainzisegmap_group_sizze_227160;
            
            int64_t segmap_group_sizze_227217;
            
            segmap_group_sizze_227217 =
                *ctx->tuning_params.mainzisegmap_group_sizze_227117;
            
            struct memblock_device ext_mem_231669;
            
            ext_mem_231669.references = NULL;
            
            struct memblock_device ext_mem_231668;
            
            ext_mem_231668.references = NULL;
            
            int32_t local_memory_capacity_236436;
            
            local_memory_capacity_236436 = ctx->opencl.max_local_memory;
            if (sle64(bytes_229277 + srem64((int64_t) 8 - srem64(bytes_229277,
                                                                 (int64_t) 8),
                                            (int64_t) 8) + (bytes_229277 +
                                                            srem64((int64_t) 8 -
                                                                   srem64(bytes_229277,
                                                                          (int64_t) 8),
                                                                   (int64_t) 8)),
                      sext_i32_i64(local_memory_capacity_236436)) &&
                intra_suff_and_fits_227070) {
                struct memblock_device mem_231653;
                
                mem_231653.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231653, bytes_229285,
                                          "mem_231653")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_231657;
                
                mem_231657.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231657, bytes_229285,
                                          "mem_231657")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227074,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227074,
                                                        3,
                                                        (size_t) bytes_229277,
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227074,
                                                        4,
                                                        (size_t) bytes_229277,
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227074,
                                                        5, sizeof(n_203572),
                                                        &n_203572));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227074,
                                                        6,
                                                        sizeof(partition_sizze_203667),
                                                        &partition_sizze_203667));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227074,
                                                        7, sizeof(ext_231630),
                                                        &ext_231630));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227074,
                                                        8,
                                                        sizeof(mem_229269.mem),
                                                        &mem_229269.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227074,
                                                        9,
                                                        sizeof(ext_mem_229305.mem),
                                                        &ext_mem_229305.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227074,
                                                        10,
                                                        sizeof(ext_mem_231625.mem),
                                                        &ext_mem_231625.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227074,
                                                        11,
                                                        sizeof(ext_mem_231626.mem),
                                                        &ext_mem_231626.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227074,
                                                        12,
                                                        sizeof(mem_231653.mem),
                                                        &mem_231653.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227074,
                                                        13,
                                                        sizeof(mem_231657.mem),
                                                        &mem_231657.mem));
                if (1 * ((size_t) partition_sizze_203667 * (size_t) n_203572) !=
                    0) {
                    const size_t global_work_sizze_237647[1] =
                                 {(size_t) partition_sizze_203667 *
                                 (size_t) n_203572};
                    const size_t local_work_sizze_237651[1] =
                                 {(size_t) n_203572};
                    int64_t time_start_237648 = 0, time_end_237649 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.segmap_intragroup_227074",
                                global_work_sizze_237647[0],
                                local_work_sizze_237651[0], (int) (0 +
                                                                   bytes_229277 +
                                                                   bytes_229277));
                        time_start_237648 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_intragroup_227074,
                                                                    1, NULL,
                                                                    global_work_sizze_237647,
                                                                    local_work_sizze_237651,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_intragroup_227074_runs,
                                                                                                              &ctx->mainzisegmap_intragroup_227074_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237649 = get_wall_time();
                        
                        long time_diff_237650 = time_end_237649 -
                             time_start_237648;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_intragroup_227074",
                                time_diff_237650);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_set_device(ctx, &ext_mem_231669, &mem_231653,
                                        "mem_231653") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231668, &mem_231657,
                                        "mem_231657") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231657, "mem_231657") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231653, "mem_231653") != 0)
                    return 1;
            } else {
                int64_t segmap_usable_groups_227197 =
                        sdiv_up64(nest_sizze_207090, segmap_group_sizze_227196);
                struct memblock_device mem_231662;
                
                mem_231662.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231662, bytes_229285,
                                          "mem_231662")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227201,
                                                        1, sizeof(n_203572),
                                                        &n_203572));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227201,
                                                        2,
                                                        sizeof(partition_sizze_203667),
                                                        &partition_sizze_203667));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227201,
                                                        3, sizeof(ext_231630),
                                                        &ext_231630));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227201,
                                                        4,
                                                        sizeof(mem_229269.mem),
                                                        &mem_229269.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227201,
                                                        5,
                                                        sizeof(ext_mem_231625.mem),
                                                        &ext_mem_231625.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227201,
                                                        6,
                                                        sizeof(ext_mem_231626.mem),
                                                        &ext_mem_231626.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227201,
                                                        7,
                                                        sizeof(mem_231662.mem),
                                                        &mem_231662.mem));
                if (1 * ((size_t) segmap_usable_groups_227197 *
                         (size_t) segmap_group_sizze_227196) != 0) {
                    const size_t global_work_sizze_237652[1] =
                                 {(size_t) segmap_usable_groups_227197 *
                                 (size_t) segmap_group_sizze_227196};
                    const size_t local_work_sizze_237656[1] =
                                 {(size_t) segmap_group_sizze_227196};
                    int64_t time_start_237653 = 0, time_end_237654 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.segmap_227201",
                                global_work_sizze_237652[0],
                                local_work_sizze_237656[0], (int) 0);
                        time_start_237653 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_227201,
                                                                    1, NULL,
                                                                    global_work_sizze_237652,
                                                                    local_work_sizze_237656,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_227201_runs,
                                                                                                              &ctx->mainzisegmap_227201_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237654 = get_wall_time();
                        
                        long time_diff_237655 = time_end_237654 -
                             time_start_237653;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_227201", time_diff_237655);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                
                int64_t segmap_usable_groups_227218 =
                        sdiv_up64(nest_sizze_207090, segmap_group_sizze_227217);
                struct memblock_device mem_231667;
                
                mem_231667.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231667, bytes_229285,
                                          "mem_231667")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227222,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227222,
                                                        3, sizeof(n_203572),
                                                        &n_203572));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227222,
                                                        4,
                                                        sizeof(partition_sizze_203667),
                                                        &partition_sizze_203667));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227222,
                                                        5,
                                                        sizeof(ext_mem_229305.mem),
                                                        &ext_mem_229305.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227222,
                                                        6,
                                                        sizeof(mem_231662.mem),
                                                        &mem_231662.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227222,
                                                        7,
                                                        sizeof(mem_231667.mem),
                                                        &mem_231667.mem));
                if (1 * ((size_t) segmap_usable_groups_227218 *
                         (size_t) segmap_group_sizze_227217) != 0) {
                    const size_t global_work_sizze_237657[1] =
                                 {(size_t) segmap_usable_groups_227218 *
                                 (size_t) segmap_group_sizze_227217};
                    const size_t local_work_sizze_237661[1] =
                                 {(size_t) segmap_group_sizze_227217};
                    int64_t time_start_237658 = 0, time_end_237659 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.segmap_227222",
                                global_work_sizze_237657[0],
                                local_work_sizze_237661[0], (int) 0);
                        time_start_237658 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_227222,
                                                                    1, NULL,
                                                                    global_work_sizze_237657,
                                                                    local_work_sizze_237661,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_227222_runs,
                                                                                                              &ctx->mainzisegmap_227222_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237659 = get_wall_time();
                        
                        long time_diff_237660 = time_end_237659 -
                             time_start_237658;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_227222", time_diff_237660);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_set_device(ctx, &ext_mem_231669, &mem_231667,
                                        "mem_231667") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231668, &mem_231662,
                                        "mem_231662") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231667, "mem_231667") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231662, "mem_231662") != 0)
                    return 1;
            }
            
            int32_t iters_206755;
            
            if (empty_slice_204209) {
                iters_206755 = 0;
            } else {
                iters_206755 = 32;
            }
            
            bool loop_nonempty_206756 = slt32(0, iters_206755);
            bool loop_not_taken_206757 = !loop_nonempty_206756;
            bool protect_assert_disj_206758 = bounds_check_203763 ||
                 loop_not_taken_206757;
            bool index_certs_206759;
            
            if (!protect_assert_disj_206758) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) i_203760,
                              "] out of bounds for array of shape [",
                              (long long) n_203572, "].",
                              "-> #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:338:35-77\n   #5  stl.fut:337:28-339:40\n   #6  stl.fut:415:61-429:75\n   #7  stl.fut:455:3-469:34\n   #8  stl.fut:439:1-469:34\n");
                if (memblock_unref_device(ctx, &ext_mem_231668,
                                          "ext_mem_231668") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231669,
                                          "ext_mem_231669") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231960,
                                          "ext_mem_231960") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229623,
                                          "mem_param_229623") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229615,
                                          "mem_param_229615") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231625,
                                          "ext_mem_231625") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231626,
                                          "ext_mem_231626") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229601,
                                          "mem_param_229601") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229593,
                                          "mem_param_229593") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229585,
                                          "mem_param_229585") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231968,
                                          "ext_mem_231968") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231969,
                                          "ext_mem_231969") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231970,
                                          "ext_mem_231970") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230659, "mem_230659") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230642, "mem_230642") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230625, "mem_230625") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230608, "mem_230608") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229639, "mem_229639") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229634, "mem_229634") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229628, "mem_229628") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229568,
                                          "ext_mem_229568") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229569,
                                          "ext_mem_229569") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229519,
                                          "ext_mem_229519") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229520,
                                          "ext_mem_229520") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229470,
                                          "ext_mem_229470") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229471,
                                          "ext_mem_229471") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229372,
                                          "ext_mem_229372") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229373,
                                          "ext_mem_229373") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229304,
                                          "ext_mem_229304") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229305,
                                          "ext_mem_229305") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232074, "color_232074") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232361,
                                          "mem_out_232361") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232360,
                                          "mem_out_232360") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232359,
                                          "mem_out_232359") != 0)
                    return 1;
                err = 1;
                goto cleanup;
            }
            
            bool suff_outer_par_227244;
            
            suff_outer_par_227244 =
                *ctx->tuning_params.mainzisuff_outer_par_35 <=
                partition_sizze_203667;
            if (ctx->logging)
                fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                        "main.suff_outer_par_35", (long) partition_sizze_203667,
                        suff_outer_par_227244 ? "true" : "false");
            
            bool suff_intra_par_227443;
            
            suff_intra_par_227443 =
                *ctx->tuning_params.mainzisuff_intra_par_36 <= n_203572;
            if (ctx->logging)
                fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                        "main.suff_intra_par_36", (long) n_203572,
                        suff_intra_par_227443 ? "true" : "false");
            
            bool intra_suff_and_fits_227446 = fits_206978 &&
                 suff_intra_par_227443;
            int64_t segmap_group_sizze_227346;
            
            segmap_group_sizze_227346 =
                *ctx->tuning_params.mainzisegmap_group_sizze_227248;
            
            int64_t num_groups_227347;
            int32_t max_num_groups_236437;
            
            max_num_groups_236437 =
                *ctx->tuning_params.mainzisegmap_num_groups_227250;
            num_groups_227347 = sext_i64_i32(smax64((int64_t) 1,
                                                    smin64(sdiv_up64(partition_sizze_203667,
                                                                     segmap_group_sizze_227346),
                                                           sext_i32_i64(max_num_groups_236437))));
            
            bool suff_intra_par_227900;
            
            suff_intra_par_227900 =
                *ctx->tuning_params.mainzisuff_intra_par_37 <= n_203572;
            if (ctx->logging)
                fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                        "main.suff_intra_par_37", (long) n_203572,
                        suff_intra_par_227900 ? "true" : "false");
            
            bool intra_suff_and_fits_227901 = fits_206978 &&
                 suff_intra_par_227900;
            int64_t segscan_group_sizze_227995;
            
            segscan_group_sizze_227995 =
                *ctx->tuning_params.mainzisegscan_group_sizze_227715;
            
            int64_t num_groups_227996;
            int32_t max_num_groups_236438;
            
            max_num_groups_236438 =
                *ctx->tuning_params.mainzisegscan_num_groups_227717;
            num_groups_227996 = sext_i64_i32(smax64((int64_t) 1,
                                                    smin64(sdiv_up64(nest_sizze_207090,
                                                                     segscan_group_sizze_227995),
                                                           sext_i32_i64(max_num_groups_236438))));
            
            int64_t segmap_group_sizze_228071;
            
            segmap_group_sizze_228071 =
                *ctx->tuning_params.mainzisegmap_group_sizze_227667;
            
            int64_t segmap_usable_groups_228072 =
                    sdiv_up_safe64(nest_sizze_207090,
                                   segmap_group_sizze_228071);
            int64_t binop_y_231697 = (int64_t) 4 * n_203572;
            int64_t bytes_231698 = smax64((int64_t) 0, binop_y_231697);
            int64_t binop_y_231891 = (int64_t) 4 * nest_sizze_207090;
            int64_t bytes_231892 = smax64((int64_t) 0, binop_y_231891);
            int64_t num_bytes_232064 = (int64_t) 8 * n_203572;
            int64_t num_bytes_232069 = (int64_t) 8 * n_203572;
            int64_t num_threads_232339 = segmap_group_sizze_227346 *
                    num_groups_227347;
            int64_t total_sizze_232340 = num_bytes_232064 * num_threads_232339;
            int64_t total_sizze_232341 = bytes_229277 * num_threads_232339;
            int64_t total_sizze_232342 = bytes_231698 * num_threads_232339;
            int64_t total_sizze_232343 = bytes_229277 * num_threads_232339;
            int64_t total_sizze_232344 = bytes_229277 * num_threads_232339;
            int64_t total_sizze_232345 = bytes_229277 * num_threads_232339;
            int64_t total_sizze_232346 = bytes_229277 * num_threads_232339;
            int64_t total_sizze_232348 = partition_sizze_203667 *
                    num_bytes_232069;
            int64_t total_sizze_232349 = partition_sizze_203667 * bytes_229277;
            struct memblock_device ext_mem_231924;
            
            ext_mem_231924.references = NULL;
            
            int32_t local_memory_capacity_236680;
            
            local_memory_capacity_236680 = ctx->opencl.max_local_memory;
            if (sle64((int64_t) 0,
                      sext_i32_i64(local_memory_capacity_236680)) &&
                suff_outer_par_227244) {
                struct memblock_device mem_231672;
                
                mem_231672.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231672, binop_y_229284,
                                          "mem_231672")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_231672,
                                                          (int64_t) 0,
                                                          ext_mem_231669,
                                                          (int64_t) 0,
                                                          (int64_t) 1, n_203572,
                                                          partition_sizze_203667) !=
                    0) {
                    if (memblock_unref_device(ctx, &mem_231672, "mem_231672") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231924,
                                              "ext_mem_231924") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231668,
                                              "ext_mem_231668") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231669,
                                              "ext_mem_231669") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231960,
                                              "ext_mem_231960") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229623,
                                              "mem_param_229623") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229615,
                                              "mem_param_229615") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231625,
                                              "ext_mem_231625") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231626,
                                              "ext_mem_231626") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229601,
                                              "mem_param_229601") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229593,
                                              "mem_param_229593") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229585,
                                              "mem_param_229585") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231968,
                                              "ext_mem_231968") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231969,
                                              "ext_mem_231969") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231970,
                                              "ext_mem_231970") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230659, "mem_230659") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230642, "mem_230642") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230625, "mem_230625") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230608, "mem_230608") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229639, "mem_229639") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229634, "mem_229634") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229628, "mem_229628") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229577, "mem_229577") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229573, "mem_229573") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229568,
                                              "ext_mem_229568") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229569,
                                              "ext_mem_229569") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229519,
                                              "ext_mem_229519") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229520,
                                              "ext_mem_229520") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229470,
                                              "ext_mem_229470") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229471,
                                              "ext_mem_229471") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229372,
                                              "ext_mem_229372") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229373,
                                              "ext_mem_229373") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229304,
                                              "ext_mem_229304") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229305,
                                              "ext_mem_229305") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232074,
                                              "color_232074") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232361,
                                              "mem_out_232361") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232360,
                                              "mem_out_232360") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232359,
                                              "mem_out_232359") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_231782;
                
                mem_231782.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231782, binop_y_229284,
                                          "mem_231782")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_232173;
                
                color_232173.references = NULL;
                if (memblock_alloc_device(ctx, &color_232173,
                                          total_sizze_232340, "color_232173")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_232174;
                
                color_232174.references = NULL;
                if (memblock_alloc_device(ctx, &color_232174,
                                          total_sizze_232341, "color_232174")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_232175;
                
                color_232175.references = NULL;
                if (memblock_alloc_device(ctx, &color_232175,
                                          total_sizze_232342, "color_232175")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_232176;
                
                color_232176.references = NULL;
                if (memblock_alloc_device(ctx, &color_232176,
                                          total_sizze_232343, "color_232176")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_232177;
                
                color_232177.references = NULL;
                if (memblock_alloc_device(ctx, &color_232177,
                                          total_sizze_232344, "color_232177")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_232178;
                
                color_232178.references = NULL;
                if (memblock_alloc_device(ctx, &color_232178,
                                          total_sizze_232345, "color_232178")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_232179;
                
                color_232179.references = NULL;
                if (memblock_alloc_device(ctx, &color_232179,
                                          total_sizze_232346, "color_232179")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227351,
                                                        1, sizeof(n_203572),
                                                        &n_203572));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227351,
                                                        2,
                                                        sizeof(partition_sizze_203667),
                                                        &partition_sizze_203667));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227351,
                                                        3, sizeof(i_203760),
                                                        &i_203760));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227351,
                                                        4, sizeof(iters_206755),
                                                        &iters_206755));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227351,
                                                        5,
                                                        sizeof(num_groups_227347),
                                                        &num_groups_227347));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227351,
                                                        6,
                                                        sizeof(num_threads_232339),
                                                        &num_threads_232339));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227351,
                                                        7,
                                                        sizeof(mem_231672.mem),
                                                        &mem_231672.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227351,
                                                        8,
                                                        sizeof(mem_231782.mem),
                                                        &mem_231782.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227351,
                                                        9,
                                                        sizeof(color_232173.mem),
                                                        &color_232173.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227351,
                                                        10,
                                                        sizeof(color_232174.mem),
                                                        &color_232174.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227351,
                                                        11,
                                                        sizeof(color_232175.mem),
                                                        &color_232175.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227351,
                                                        12,
                                                        sizeof(color_232176.mem),
                                                        &color_232176.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227351,
                                                        13,
                                                        sizeof(color_232177.mem),
                                                        &color_232177.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227351,
                                                        14,
                                                        sizeof(color_232178.mem),
                                                        &color_232178.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227351,
                                                        15,
                                                        sizeof(color_232179.mem),
                                                        &color_232179.mem));
                if (1 * ((size_t) num_groups_227347 *
                         (size_t) segmap_group_sizze_227346) != 0) {
                    const size_t global_work_sizze_237662[1] =
                                 {(size_t) num_groups_227347 *
                                 (size_t) segmap_group_sizze_227346};
                    const size_t local_work_sizze_237666[1] =
                                 {(size_t) segmap_group_sizze_227346};
                    int64_t time_start_237663 = 0, time_end_237664 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.segmap_227351",
                                global_work_sizze_237662[0],
                                local_work_sizze_237666[0], (int) 0);
                        time_start_237663 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_227351,
                                                                    1, NULL,
                                                                    global_work_sizze_237662,
                                                                    local_work_sizze_237666,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_227351_runs,
                                                                                                              &ctx->mainzisegmap_227351_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237664 = get_wall_time();
                        
                        long time_diff_237665 = time_end_237664 -
                             time_start_237663;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_227351", time_diff_237665);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_231672, "mem_231672") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232173, "color_232173") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232174, "color_232174") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232175, "color_232175") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232176, "color_232176") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232177, "color_232177") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232178, "color_232178") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232179, "color_232179") !=
                    0)
                    return 1;
                
                struct memblock_device mem_231917;
                
                mem_231917.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231917, bytes_229285,
                                          "mem_231917")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_231917,
                                                          (int64_t) 0,
                                                          mem_231782,
                                                          (int64_t) 0,
                                                          (int64_t) 1,
                                                          partition_sizze_203667,
                                                          n_203572) != 0) {
                    if (memblock_unref_device(ctx, &mem_231917, "mem_231917") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232179,
                                              "color_232179") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232178,
                                              "color_232178") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232177,
                                              "color_232177") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232176,
                                              "color_232176") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232175,
                                              "color_232175") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232174,
                                              "color_232174") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232173,
                                              "color_232173") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231782, "mem_231782") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231672, "mem_231672") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231924,
                                              "ext_mem_231924") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231668,
                                              "ext_mem_231668") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231669,
                                              "ext_mem_231669") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231960,
                                              "ext_mem_231960") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229623,
                                              "mem_param_229623") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229615,
                                              "mem_param_229615") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231625,
                                              "ext_mem_231625") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231626,
                                              "ext_mem_231626") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229601,
                                              "mem_param_229601") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229593,
                                              "mem_param_229593") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229585,
                                              "mem_param_229585") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231968,
                                              "ext_mem_231968") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231969,
                                              "ext_mem_231969") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231970,
                                              "ext_mem_231970") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230659, "mem_230659") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230642, "mem_230642") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230625, "mem_230625") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230608, "mem_230608") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229639, "mem_229639") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229634, "mem_229634") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229628, "mem_229628") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229577, "mem_229577") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229573, "mem_229573") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229568,
                                              "ext_mem_229568") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229569,
                                              "ext_mem_229569") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229519,
                                              "ext_mem_229519") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229520,
                                              "ext_mem_229520") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229470,
                                              "ext_mem_229470") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229471,
                                              "ext_mem_229471") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229372,
                                              "ext_mem_229372") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229373,
                                              "ext_mem_229373") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229304,
                                              "ext_mem_229304") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229305,
                                              "ext_mem_229305") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232074,
                                              "color_232074") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232361,
                                              "mem_out_232361") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232360,
                                              "mem_out_232360") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232359,
                                              "mem_out_232359") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                if (memblock_unref_device(ctx, &mem_231782, "mem_231782") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231924, &mem_231917,
                                        "mem_231917") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231917, "mem_231917") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232179, "color_232179") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232178, "color_232178") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232177, "color_232177") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232176, "color_232176") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232175, "color_232175") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232174, "color_232174") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232173, "color_232173") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231782, "mem_231782") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231672, "mem_231672") != 0)
                    return 1;
            } else {
                struct memblock_device ext_mem_231906;
                
                ext_mem_231906.references = NULL;
                
                int32_t local_memory_capacity_236679;
                
                local_memory_capacity_236679 = ctx->opencl.max_local_memory;
                if (sle64(bytes_229277 + srem64((int64_t) 8 -
                                                srem64(bytes_229277,
                                                       (int64_t) 8),
                                                (int64_t) 8) + (bytes_231698 +
                                                                srem64((int64_t) 8 -
                                                                       srem64(bytes_231698,
                                                                              (int64_t) 8),
                                                                       (int64_t) 8)) +
                          (bytes_229277 + srem64((int64_t) 8 -
                                                 srem64(bytes_229277,
                                                        (int64_t) 8),
                                                 (int64_t) 8)) + (bytes_229277 +
                                                                  srem64((int64_t) 8 -
                                                                         srem64(bytes_229277,
                                                                                (int64_t) 8),
                                                                         (int64_t) 8)) +
                          (bytes_229277 + srem64((int64_t) 8 -
                                                 srem64(bytes_229277,
                                                        (int64_t) 8),
                                                 (int64_t) 8)) + (bytes_229277 +
                                                                  srem64((int64_t) 8 -
                                                                         srem64(bytes_229277,
                                                                                (int64_t) 8),
                                                                         (int64_t) 8)),
                          sext_i32_i64(local_memory_capacity_236679)) &&
                    intra_suff_and_fits_227446) {
                    struct memblock_device mem_231829;
                    
                    mem_231829.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231829, bytes_229285,
                                              "mem_231829")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_232180;
                    
                    color_232180.references = NULL;
                    if (memblock_alloc_device(ctx, &color_232180,
                                              total_sizze_232348,
                                              "color_232180")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_232181;
                    
                    color_232181.references = NULL;
                    if (memblock_alloc_device(ctx, &color_232181,
                                              total_sizze_232349,
                                              "color_232181")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227449,
                                                            1,
                                                            (size_t) bytes_229277,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227449,
                                                            2,
                                                            (size_t) bytes_229277,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227449,
                                                            3,
                                                            (size_t) bytes_229277,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227449,
                                                            4,
                                                            (size_t) bytes_229277,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227449,
                                                            5,
                                                            (size_t) bytes_231698,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227449,
                                                            6,
                                                            (size_t) bytes_229277,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227449,
                                                            7, sizeof(n_203572),
                                                            &n_203572));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227449,
                                                            8,
                                                            sizeof(partition_sizze_203667),
                                                            &partition_sizze_203667));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227449,
                                                            9, sizeof(i_203760),
                                                            &i_203760));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227449,
                                                            10,
                                                            sizeof(iters_206755),
                                                            &iters_206755));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227449,
                                                            11,
                                                            sizeof(ext_mem_231669.mem),
                                                            &ext_mem_231669.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227449,
                                                            12,
                                                            sizeof(mem_231829.mem),
                                                            &mem_231829.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227449,
                                                            13,
                                                            sizeof(color_232180.mem),
                                                            &color_232180.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227449,
                                                            14,
                                                            sizeof(color_232181.mem),
                                                            &color_232181.mem));
                    if (1 * ((size_t) partition_sizze_203667 *
                             (size_t) n_203572) != 0) {
                        const size_t global_work_sizze_237667[1] =
                                     {(size_t) partition_sizze_203667 *
                                     (size_t) n_203572};
                        const size_t local_work_sizze_237671[1] =
                                     {(size_t) n_203572};
                        int64_t time_start_237668 = 0, time_end_237669 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.segmap_intragroup_227449",
                                    global_work_sizze_237667[0],
                                    local_work_sizze_237671[0], (int) (0 +
                                                                       bytes_229277 +
                                                                       bytes_229277 +
                                                                       bytes_229277 +
                                                                       bytes_229277 +
                                                                       bytes_231698 +
                                                                       bytes_229277));
                            time_start_237668 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_intragroup_227449,
                                                                        1, NULL,
                                                                        global_work_sizze_237667,
                                                                        local_work_sizze_237671,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_intragroup_227449_runs,
                                                                                                                  &ctx->mainzisegmap_intragroup_227449_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_237669 = get_wall_time();
                            
                            long time_diff_237670 = time_end_237669 -
                                 time_start_237668;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_intragroup_227449",
                                    time_diff_237670);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &color_232180,
                                              "color_232180") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232181,
                                              "color_232181") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231906, &mem_231829,
                                            "mem_231829") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232181,
                                              "color_232181") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232180,
                                              "color_232180") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231829, "mem_231829") !=
                        0)
                        return 1;
                } else {
                    struct memblock_device mem_231833;
                    
                    mem_231833.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231833, bytes_229285,
                                              "mem_231833")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (partition_sizze_203667 * n_203572 * (int64_t) 8 > 0) {
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueCopyBuffer(ctx->opencl.queue,
                                                                     ext_mem_231669.mem,
                                                                     mem_231833.mem,
                                                                     (size_t) (int64_t) 0,
                                                                     (size_t) (int64_t) 0,
                                                                     (size_t) (partition_sizze_203667 *
                                                                               n_203572 *
                                                                               (int64_t) 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));
                    }
                    
                    struct memblock_device ext_mem_231898;
                    
                    ext_mem_231898.references = NULL;
                    
                    struct memblock_device mem_param_231841;
                    
                    mem_param_231841.references = NULL;
                    if (memblock_set_device(ctx, &mem_param_231841, &mem_231833,
                                            "mem_231833") != 0)
                        return 1;
                    for (int32_t i_227886 = 0; i_227886 < iters_206755;
                         i_227886++) {
                        struct memblock_device mem_231847;
                        
                        mem_231847.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231847,
                                                  bytes_229285, "mem_231847")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (partition_sizze_203667 * n_203572 * (int64_t) 8 >
                            0) {
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueCopyBuffer(ctx->opencl.queue,
                                                                         mem_param_231841.mem,
                                                                         mem_231847.mem,
                                                                         (size_t) (int64_t) 0,
                                                                         (size_t) (int64_t) 0,
                                                                         (size_t) (partition_sizze_203667 *
                                                                                   n_203572 *
                                                                                   (int64_t) 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));
                        }
                        
                        int32_t defunc_2_radix_sort_step_arg_227889 = mul32(2,
                                                                            i_227886);
                        int32_t defunc_0_get_bit_arg_227890 = add32(1,
                                                                    defunc_2_radix_sort_step_arg_227889);
                        bool cond_f_res_227891 = defunc_0_get_bit_arg_227890 ==
                             63;
                        bool cond_f_res_227892 =
                             defunc_2_radix_sort_step_arg_227889 == 63;
                        int64_t unsign_arg_227893 =
                                zext_i32_i64(defunc_0_get_bit_arg_227890);
                        int64_t unsign_arg_227894 =
                                zext_i32_i64(defunc_2_radix_sort_step_arg_227889);
                        struct memblock_device ext_mem_231895;
                        
                        ext_mem_231895.references = NULL;
                        
                        int32_t local_memory_capacity_236678;
                        
                        local_memory_capacity_236678 =
                            ctx->opencl.max_local_memory;
                        if (sle64(bytes_231698 + srem64((int64_t) 8 -
                                                        srem64(bytes_231698,
                                                               (int64_t) 8),
                                                        (int64_t) 8) +
                                  (bytes_229277 + srem64((int64_t) 8 -
                                                         srem64(bytes_229277,
                                                                (int64_t) 8),
                                                         (int64_t) 8)) +
                                  (bytes_229277 + srem64((int64_t) 8 -
                                                         srem64(bytes_229277,
                                                                (int64_t) 8),
                                                         (int64_t) 8)) +
                                  (bytes_229277 + srem64((int64_t) 8 -
                                                         srem64(bytes_229277,
                                                                (int64_t) 8),
                                                         (int64_t) 8)) +
                                  (bytes_229277 + srem64((int64_t) 8 -
                                                         srem64(bytes_229277,
                                                                (int64_t) 8),
                                                         (int64_t) 8)) +
                                  (bytes_229277 + srem64((int64_t) 8 -
                                                         srem64(bytes_229277,
                                                                (int64_t) 8),
                                                         (int64_t) 8)),
                                  sext_i32_i64(local_memory_capacity_236678)) &&
                            intra_suff_and_fits_227901) {
                            struct memblock_device mem_231872;
                            
                            mem_231872.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231872,
                                                      bytes_229285,
                                                      "mem_231872")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227905,
                                                                    1,
                                                                    (size_t) bytes_229277,
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227905,
                                                                    2,
                                                                    (size_t) bytes_229277,
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227905,
                                                                    3,
                                                                    (size_t) bytes_229277,
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227905,
                                                                    4,
                                                                    (size_t) bytes_229277,
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227905,
                                                                    5,
                                                                    (size_t) bytes_229277,
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227905,
                                                                    6,
                                                                    (size_t) bytes_231698,
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227905,
                                                                    7,
                                                                    sizeof(n_203572),
                                                                    &n_203572));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227905,
                                                                    8,
                                                                    sizeof(partition_sizze_203667),
                                                                    &partition_sizze_203667));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227905,
                                                                    9,
                                                                    sizeof(i_203760),
                                                                    &i_203760));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227905,
                                                                    10,
                                                                    sizeof(cond_f_res_227891),
                                                                    &cond_f_res_227891));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227905,
                                                                    11,
                                                                    sizeof(cond_f_res_227892),
                                                                    &cond_f_res_227892));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227905,
                                                                    12,
                                                                    sizeof(unsign_arg_227893),
                                                                    &unsign_arg_227893));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227905,
                                                                    13,
                                                                    sizeof(unsign_arg_227894),
                                                                    &unsign_arg_227894));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227905,
                                                                    14,
                                                                    sizeof(mem_param_231841.mem),
                                                                    &mem_param_231841.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227905,
                                                                    15,
                                                                    sizeof(mem_231872.mem),
                                                                    &mem_231872.mem));
                            if (1 * ((size_t) partition_sizze_203667 *
                                     (size_t) n_203572) != 0) {
                                const size_t global_work_sizze_237672[1] =
                                             {(size_t) partition_sizze_203667 *
                                             (size_t) n_203572};
                                const size_t local_work_sizze_237676[1] =
                                             {(size_t) n_203572};
                                int64_t time_start_237673 = 0, time_end_237674 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                            "main.segmap_intragroup_227905",
                                            global_work_sizze_237672[0],
                                            local_work_sizze_237676[0],
                                            (int) (0 + bytes_229277 +
                                                   bytes_229277 + bytes_229277 +
                                                   bytes_229277 + bytes_229277 +
                                                   bytes_231698));
                                    time_start_237673 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_intragroup_227905,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237672,
                                                                                local_work_sizze_237676,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_intragroup_227905_runs,
                                                                                                                          &ctx->mainzisegmap_intragroup_227905_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237674 = get_wall_time();
                                    
                                    long time_diff_237675 = time_end_237674 -
                                         time_start_237673;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_intragroup_227905",
                                            time_diff_237675);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_set_device(ctx, &ext_mem_231895,
                                                    &mem_231872,
                                                    "mem_231872") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231872,
                                                      "mem_231872") != 0)
                                return 1;
                        } else {
                            struct memblock_device mem_231877;
                            
                            mem_231877.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231877,
                                                      bytes_229285,
                                                      "mem_231877")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231881;
                            
                            mem_231881.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231881,
                                                      bytes_229285,
                                                      "mem_231881")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231885;
                            
                            mem_231885.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231885,
                                                      bytes_229285,
                                                      "mem_231885")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231889;
                            
                            mem_231889.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231889,
                                                      bytes_229285,
                                                      "mem_231889")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231893;
                            
                            mem_231893.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231893,
                                                      bytes_231892,
                                                      "mem_231893")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (slt64((int64_t) 0, partition_sizze_203667 *
                                      n_203572)) {
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegScan");
                                
                                int64_t stage1_max_num_groups_236555;
                                
                                stage1_max_num_groups_236555 =
                                    ctx->opencl.max_group_size;
                                
                                int64_t stage1_num_groups_236556 =
                                        smin64(stage1_max_num_groups_236555,
                                               num_groups_227996);
                                int32_t num_threads_236557 =
                                        sext_i64_i32(stage1_num_groups_236556 *
                                        segscan_group_sizze_227995);
                                
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_228005,
                                                                        1,
                                                                        (size_t) smax64((int64_t) 1,
                                                                                        (int64_t) 8 *
                                                                                        segscan_group_sizze_227995),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_228005,
                                                                        2,
                                                                        (size_t) smax64((int64_t) 1,
                                                                                        (int64_t) 8 *
                                                                                        segscan_group_sizze_227995),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_228005,
                                                                        3,
                                                                        (size_t) smax64((int64_t) 1,
                                                                                        (int64_t) 8 *
                                                                                        segscan_group_sizze_227995),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_228005,
                                                                        4,
                                                                        (size_t) smax64((int64_t) 1,
                                                                                        (int64_t) 8 *
                                                                                        segscan_group_sizze_227995),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_228005,
                                                                        5,
                                                                        sizeof(n_203572),
                                                                        &n_203572));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_228005,
                                                                        6,
                                                                        sizeof(partition_sizze_203667),
                                                                        &partition_sizze_203667));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_228005,
                                                                        7,
                                                                        sizeof(cond_f_res_227891),
                                                                        &cond_f_res_227891));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_228005,
                                                                        8,
                                                                        sizeof(cond_f_res_227892),
                                                                        &cond_f_res_227892));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_228005,
                                                                        9,
                                                                        sizeof(unsign_arg_227893),
                                                                        &unsign_arg_227893));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_228005,
                                                                        10,
                                                                        sizeof(unsign_arg_227894),
                                                                        &unsign_arg_227894));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_228005,
                                                                        11,
                                                                        sizeof(num_threads_236557),
                                                                        &num_threads_236557));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_228005,
                                                                        12,
                                                                        sizeof(mem_param_231841.mem),
                                                                        &mem_param_231841.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_228005,
                                                                        13,
                                                                        sizeof(mem_231877.mem),
                                                                        &mem_231877.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_228005,
                                                                        14,
                                                                        sizeof(mem_231881.mem),
                                                                        &mem_231881.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_228005,
                                                                        15,
                                                                        sizeof(mem_231885.mem),
                                                                        &mem_231885.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_228005,
                                                                        16,
                                                                        sizeof(mem_231889.mem),
                                                                        &mem_231889.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_228005,
                                                                        17,
                                                                        sizeof(mem_231893.mem),
                                                                        &mem_231893.mem));
                                if (1 * ((size_t) stage1_num_groups_236556 *
                                         (size_t) segscan_group_sizze_227995) !=
                                    0) {
                                    const size_t global_work_sizze_237677[1] =
                                                 {(size_t) stage1_num_groups_236556 *
                                                 (size_t) segscan_group_sizze_227995};
                                    const size_t local_work_sizze_237681[1] =
                                                 {(size_t) segscan_group_sizze_227995};
                                    int64_t time_start_237678 = 0,
                                            time_end_237679 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                "main.scan_stage1_228005",
                                                global_work_sizze_237677[0],
                                                local_work_sizze_237681[0],
                                                (int) (0 + smax64((int64_t) 1,
                                                                  (int64_t) 8 *
                                                                  segscan_group_sizze_227995) +
                                                       smax64((int64_t) 1,
                                                              (int64_t) 8 *
                                                              segscan_group_sizze_227995) +
                                                       smax64((int64_t) 1,
                                                              (int64_t) 8 *
                                                              segscan_group_sizze_227995) +
                                                       smax64((int64_t) 1,
                                                              (int64_t) 8 *
                                                              segscan_group_sizze_227995)));
                                        time_start_237678 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainziscan_stage1_228005,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237677,
                                                                                    local_work_sizze_237681,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainziscan_stage1_228005_runs,
                                                                                                                              &ctx->mainziscan_stage1_228005_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237679 = get_wall_time();
                                        
                                        long time_diff_237680 =
                                             time_end_237679 -
                                             time_start_237678;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.scan_stage1_228005",
                                                time_diff_237680);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "elems_per_group",
                                            (long long) (segscan_group_sizze_227995 *
                                                         sdiv_up64(partition_sizze_203667 *
                                                                   n_203572,
                                                                   sext_i32_i64(num_threads_236557))),
                                            '\n');
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_228005,
                                                                        1,
                                                                        (size_t) smax64((int64_t) 1,
                                                                                        (int64_t) 8 *
                                                                                        stage1_num_groups_236556),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_228005,
                                                                        2,
                                                                        (size_t) smax64((int64_t) 1,
                                                                                        (int64_t) 8 *
                                                                                        stage1_num_groups_236556),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_228005,
                                                                        3,
                                                                        (size_t) smax64((int64_t) 1,
                                                                                        (int64_t) 8 *
                                                                                        stage1_num_groups_236556),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_228005,
                                                                        4,
                                                                        (size_t) smax64((int64_t) 1,
                                                                                        (int64_t) 8 *
                                                                                        stage1_num_groups_236556),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_228005,
                                                                        5,
                                                                        sizeof(n_203572),
                                                                        &n_203572));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_228005,
                                                                        6,
                                                                        sizeof(partition_sizze_203667),
                                                                        &partition_sizze_203667));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_228005,
                                                                        7,
                                                                        sizeof(stage1_num_groups_236556),
                                                                        &stage1_num_groups_236556));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_228005,
                                                                        8,
                                                                        sizeof(num_threads_236557),
                                                                        &num_threads_236557));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_228005,
                                                                        9,
                                                                        sizeof(mem_231877.mem),
                                                                        &mem_231877.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_228005,
                                                                        10,
                                                                        sizeof(mem_231881.mem),
                                                                        &mem_231881.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_228005,
                                                                        11,
                                                                        sizeof(mem_231885.mem),
                                                                        &mem_231885.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_228005,
                                                                        12,
                                                                        sizeof(mem_231889.mem),
                                                                        &mem_231889.mem));
                                if (1 * ((size_t) (int64_t) 1 *
                                         (size_t) stage1_num_groups_236556) !=
                                    0) {
                                    const size_t global_work_sizze_237682[1] =
                                                 {(size_t) (int64_t) 1 *
                                                 (size_t) stage1_num_groups_236556};
                                    const size_t local_work_sizze_237686[1] =
                                                 {(size_t) stage1_num_groups_236556};
                                    int64_t time_start_237683 = 0,
                                            time_end_237684 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                "main.scan_stage2_228005",
                                                global_work_sizze_237682[0],
                                                local_work_sizze_237686[0],
                                                (int) (0 + smax64((int64_t) 1,
                                                                  (int64_t) 8 *
                                                                  stage1_num_groups_236556) +
                                                       smax64((int64_t) 1,
                                                              (int64_t) 8 *
                                                              stage1_num_groups_236556) +
                                                       smax64((int64_t) 1,
                                                              (int64_t) 8 *
                                                              stage1_num_groups_236556) +
                                                       smax64((int64_t) 1,
                                                              (int64_t) 8 *
                                                              stage1_num_groups_236556)));
                                        time_start_237683 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainziscan_stage2_228005,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237682,
                                                                                    local_work_sizze_237686,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainziscan_stage2_228005_runs,
                                                                                                                              &ctx->mainziscan_stage2_228005_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237684 = get_wall_time();
                                        
                                        long time_diff_237685 =
                                             time_end_237684 -
                                             time_start_237683;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.scan_stage2_228005",
                                                time_diff_237685);
                                    }
                                }
                                
                                int32_t required_groups_236656 =
                                        sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                               n_203572,
                                                               segscan_group_sizze_227995));
                                
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_228005,
                                                                        1,
                                                                        sizeof(n_203572),
                                                                        &n_203572));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_228005,
                                                                        2,
                                                                        sizeof(partition_sizze_203667),
                                                                        &partition_sizze_203667));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_228005,
                                                                        3,
                                                                        sizeof(num_groups_227996),
                                                                        &num_groups_227996));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_228005,
                                                                        4,
                                                                        sizeof(num_threads_236557),
                                                                        &num_threads_236557));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_228005,
                                                                        5,
                                                                        sizeof(required_groups_236656),
                                                                        &required_groups_236656));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_228005,
                                                                        6,
                                                                        sizeof(mem_231877.mem),
                                                                        &mem_231877.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_228005,
                                                                        7,
                                                                        sizeof(mem_231881.mem),
                                                                        &mem_231881.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_228005,
                                                                        8,
                                                                        sizeof(mem_231885.mem),
                                                                        &mem_231885.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_228005,
                                                                        9,
                                                                        sizeof(mem_231889.mem),
                                                                        &mem_231889.mem));
                                if (1 * ((size_t) num_groups_227996 *
                                         (size_t) segscan_group_sizze_227995) !=
                                    0) {
                                    const size_t global_work_sizze_237687[1] =
                                                 {(size_t) num_groups_227996 *
                                                 (size_t) segscan_group_sizze_227995};
                                    const size_t local_work_sizze_237691[1] =
                                                 {(size_t) segscan_group_sizze_227995};
                                    int64_t time_start_237688 = 0,
                                            time_end_237689 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                                "main.scan_stage3_228005",
                                                global_work_sizze_237687[0],
                                                local_work_sizze_237691[0],
                                                (int) 0);
                                        time_start_237688 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainziscan_stage3_228005,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237687,
                                                                                    local_work_sizze_237691,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainziscan_stage3_228005_runs,
                                                                                                                              &ctx->mainziscan_stage3_228005_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237689 = get_wall_time();
                                        
                                        long time_diff_237690 =
                                             time_end_237689 -
                                             time_start_237688;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.scan_stage3_228005",
                                                time_diff_237690);
                                    }
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228076,
                                                                    1,
                                                                    sizeof(n_203572),
                                                                    &n_203572));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228076,
                                                                    2,
                                                                    sizeof(partition_sizze_203667),
                                                                    &partition_sizze_203667));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228076,
                                                                    3,
                                                                    sizeof(i_203760),
                                                                    &i_203760));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228076,
                                                                    4,
                                                                    sizeof(mem_param_231841.mem),
                                                                    &mem_param_231841.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228076,
                                                                    5,
                                                                    sizeof(mem_231847.mem),
                                                                    &mem_231847.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228076,
                                                                    6,
                                                                    sizeof(mem_231877.mem),
                                                                    &mem_231877.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228076,
                                                                    7,
                                                                    sizeof(mem_231881.mem),
                                                                    &mem_231881.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228076,
                                                                    8,
                                                                    sizeof(mem_231885.mem),
                                                                    &mem_231885.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228076,
                                                                    9,
                                                                    sizeof(mem_231889.mem),
                                                                    &mem_231889.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228076,
                                                                    10,
                                                                    sizeof(mem_231893.mem),
                                                                    &mem_231893.mem));
                            if (1 * ((size_t) segmap_usable_groups_228072 *
                                     (size_t) segmap_group_sizze_228071) != 0) {
                                const size_t global_work_sizze_237692[1] =
                                             {(size_t) segmap_usable_groups_228072 *
                                             (size_t) segmap_group_sizze_228071};
                                const size_t local_work_sizze_237696[1] =
                                             {(size_t) segmap_group_sizze_228071};
                                int64_t time_start_237693 = 0, time_end_237694 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                            "main.segmap_228076",
                                            global_work_sizze_237692[0],
                                            local_work_sizze_237696[0],
                                            (int) 0);
                                    time_start_237693 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_228076,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237692,
                                                                                local_work_sizze_237696,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_228076_runs,
                                                                                                                          &ctx->mainzisegmap_228076_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237694 = get_wall_time();
                                    
                                    long time_diff_237695 = time_end_237694 -
                                         time_start_237693;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_228076",
                                            time_diff_237695);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_231877,
                                                      "mem_231877") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231881,
                                                      "mem_231881") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231885,
                                                      "mem_231885") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231889,
                                                      "mem_231889") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231893,
                                                      "mem_231893") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231895,
                                                    &mem_231847,
                                                    "mem_231847") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231893,
                                                      "mem_231893") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231889,
                                                      "mem_231889") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231885,
                                                      "mem_231885") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231881,
                                                      "mem_231881") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231877,
                                                      "mem_231877") != 0)
                                return 1;
                        }
                        if (memblock_unref_device(ctx, &mem_231847,
                                                  "mem_231847") != 0)
                            return 1;
                        
                        struct memblock_device mem_param_tmp_236515;
                        
                        mem_param_tmp_236515.references = NULL;
                        if (memblock_set_device(ctx, &mem_param_tmp_236515,
                                                &ext_mem_231895,
                                                "ext_mem_231895") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &mem_param_231841,
                                                &mem_param_tmp_236515,
                                                "mem_param_tmp_236515") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_tmp_236515,
                                                  "mem_param_tmp_236515") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231895,
                                                  "ext_mem_231895") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231847,
                                                  "mem_231847") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_231898,
                                            &mem_param_231841,
                                            "mem_param_231841") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231833, "mem_231833") !=
                        0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231906,
                                            &ext_mem_231898,
                                            "ext_mem_231898") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_231841,
                                              "mem_param_231841") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231898,
                                              "ext_mem_231898") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231833, "mem_231833") !=
                        0)
                        return 1;
                }
                
                struct memblock_device mem_231922;
                
                mem_231922.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231922, bytes_229285,
                                          "mem_231922")) {
                    err = 1;
                    goto cleanup;
                }
                if (partition_sizze_203667 * n_203572 * (int64_t) 8 > 0) {
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueCopyBuffer(ctx->opencl.queue,
                                                                 ext_mem_231906.mem,
                                                                 mem_231922.mem,
                                                                 (size_t) (int64_t) 0,
                                                                 (size_t) (int64_t) 0,
                                                                 (size_t) (partition_sizze_203667 *
                                                                           n_203572 *
                                                                           (int64_t) 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));
                }
                if (memblock_unref_device(ctx, &ext_mem_231906,
                                          "ext_mem_231906") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231924, &mem_231922,
                                        "mem_231922") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231922, "mem_231922") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231906,
                                          "ext_mem_231906") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &ext_mem_231669, "ext_mem_231669") !=
                0)
                return 1;
            
            bool empty_slice_206881 = j_m_i_204223 == (int64_t) 0;
            int64_t m_206882 = sub64(j_m_i_204223, (int64_t) 1);
            int64_t i_p_m_t_s_206883 = add64(stl_res_203754, m_206882);
            bool zzero_leq_i_p_m_t_s_206884 = sle64((int64_t) 0,
                                                    i_p_m_t_s_206883);
            bool i_p_m_t_s_leq_w_206885 = slt64(i_p_m_t_s_206883, n_203572);
            bool zzero_lte_i_206886 = sle64((int64_t) 0, stl_res_203754);
            bool i_lte_j_206887 = sle64(stl_res_203754, stl_res_203755);
            bool y_206888 = i_p_m_t_s_leq_w_206885 && zzero_lte_i_206886;
            bool y_206889 = zzero_leq_i_p_m_t_s_206884 && y_206888;
            bool y_206890 = i_lte_j_206887 && y_206889;
            bool forwards_ok_206891 = zzero_lte_i_206886 && y_206890;
            bool ok_or_empty_206892 = empty_slice_206881 || forwards_ok_206891;
            bool index_certs_206893;
            
            if (!ok_or_empty_206892) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) stl_res_203754, ":",
                              (long long) stl_res_203755,
                              "] out of bounds for array of shape [",
                              (long long) n_203572, "].",
                              "-> #0  stl.fut:344:33-51\n   #1  stl.fut:342:13-349:28\n   #2  stl.fut:415:61-429:75\n   #3  stl.fut:455:3-469:34\n   #4  stl.fut:439:1-469:34\n");
                if (memblock_unref_device(ctx, &ext_mem_231924,
                                          "ext_mem_231924") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231668,
                                          "ext_mem_231668") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231669,
                                          "ext_mem_231669") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231960,
                                          "ext_mem_231960") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229623,
                                          "mem_param_229623") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229615,
                                          "mem_param_229615") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231625,
                                          "ext_mem_231625") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231626,
                                          "ext_mem_231626") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229601,
                                          "mem_param_229601") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229593,
                                          "mem_param_229593") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229585,
                                          "mem_param_229585") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231968,
                                          "ext_mem_231968") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231969,
                                          "ext_mem_231969") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231970,
                                          "ext_mem_231970") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230659, "mem_230659") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230642, "mem_230642") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230625, "mem_230625") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230608, "mem_230608") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229639, "mem_229639") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229634, "mem_229634") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229628, "mem_229628") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229568,
                                          "ext_mem_229568") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229569,
                                          "ext_mem_229569") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229519,
                                          "ext_mem_229519") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229520,
                                          "ext_mem_229520") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229470,
                                          "ext_mem_229470") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229471,
                                          "ext_mem_229471") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229372,
                                          "ext_mem_229372") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229373,
                                          "ext_mem_229373") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229304,
                                          "ext_mem_229304") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229305,
                                          "ext_mem_229305") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232074, "color_232074") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232361,
                                          "mem_out_232361") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232360,
                                          "mem_out_232360") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232359,
                                          "mem_out_232359") != 0)
                    return 1;
                err = 1;
                goto cleanup;
            }
            
            bool suff_outer_par_228106;
            
            suff_outer_par_228106 =
                *ctx->tuning_params.mainzisuff_outer_par_38 <=
                partition_sizze_203667;
            if (ctx->logging)
                fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                        "main.suff_outer_par_38", (long) partition_sizze_203667,
                        suff_outer_par_228106 ? "true" : "false");
            
            int64_t segmap_group_sizze_228125;
            
            segmap_group_sizze_228125 =
                *ctx->tuning_params.mainzisegmap_group_sizze_228110;
            
            int64_t nest_sizze_228173 = partition_sizze_203667 * j_m_i_204223;
            int64_t segred_group_sizze_228174;
            
            segred_group_sizze_228174 =
                *ctx->tuning_params.mainzisegred_group_sizze_228157;
            
            int64_t num_groups_228175;
            int32_t max_num_groups_236681;
            
            max_num_groups_236681 =
                *ctx->tuning_params.mainzisegred_num_groups_228159;
            num_groups_228175 = sext_i64_i32(smax64((int64_t) 1,
                                                    smin64(sdiv_up64(nest_sizze_228173,
                                                                     segred_group_sizze_228174),
                                                           sext_i32_i64(max_num_groups_236681))));
            
            int64_t segmap_group_sizze_228187;
            
            segmap_group_sizze_228187 =
                *ctx->tuning_params.mainzisegmap_group_sizze_228145;
            
            struct memblock_device ext_mem_231954;
            
            ext_mem_231954.references = NULL;
            
            struct memblock_device ext_mem_231953;
            
            ext_mem_231953.references = NULL;
            
            struct memblock_device ext_mem_231952;
            
            ext_mem_231952.references = NULL;
            
            int32_t local_memory_capacity_236767;
            
            local_memory_capacity_236767 = ctx->opencl.max_local_memory;
            if (sle64((int64_t) 0,
                      sext_i32_i64(local_memory_capacity_236767)) &&
                suff_outer_par_228106) {
                int64_t segmap_usable_groups_228126 =
                        sdiv_up64(partition_sizze_203667,
                                  segmap_group_sizze_228125);
                struct memblock_device mem_231927;
                
                mem_231927.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231927, binop_y_229284,
                                          "mem_231927")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_231927,
                                                          (int64_t) 0,
                                                          ext_mem_231924,
                                                          (int64_t) 0,
                                                          (int64_t) 1, n_203572,
                                                          partition_sizze_203667) !=
                    0) {
                    if (memblock_unref_device(ctx, &mem_231927, "mem_231927") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231952,
                                              "ext_mem_231952") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231953,
                                              "ext_mem_231953") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231954,
                                              "ext_mem_231954") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231924,
                                              "ext_mem_231924") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231668,
                                              "ext_mem_231668") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231669,
                                              "ext_mem_231669") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231960,
                                              "ext_mem_231960") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229623,
                                              "mem_param_229623") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229615,
                                              "mem_param_229615") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231625,
                                              "ext_mem_231625") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231626,
                                              "ext_mem_231626") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229601,
                                              "mem_param_229601") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229593,
                                              "mem_param_229593") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229585,
                                              "mem_param_229585") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231968,
                                              "ext_mem_231968") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231969,
                                              "ext_mem_231969") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231970,
                                              "ext_mem_231970") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230659, "mem_230659") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230642, "mem_230642") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230625, "mem_230625") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230608, "mem_230608") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229639, "mem_229639") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229634, "mem_229634") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229628, "mem_229628") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229577, "mem_229577") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229573, "mem_229573") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229568,
                                              "ext_mem_229568") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229569,
                                              "ext_mem_229569") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229519,
                                              "ext_mem_229519") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229520,
                                              "ext_mem_229520") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229470,
                                              "ext_mem_229470") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229471,
                                              "ext_mem_229471") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229372,
                                              "ext_mem_229372") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229373,
                                              "ext_mem_229373") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229304,
                                              "ext_mem_229304") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229305,
                                              "ext_mem_229305") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232074,
                                              "color_232074") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232361,
                                              "mem_out_232361") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232360,
                                              "mem_out_232360") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232359,
                                              "mem_out_232359") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_231931;
                
                mem_231931.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231931, bytes_229288,
                                          "mem_231931")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_231934;
                
                mem_231934.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231934, bytes_229288,
                                          "mem_231934")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_231937;
                
                mem_231937.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231937, bytes_229288,
                                          "mem_231937")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228131,
                                                        1,
                                                        sizeof(partition_sizze_203667),
                                                        &partition_sizze_203667));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228131,
                                                        2,
                                                        sizeof(stl_res_203754),
                                                        &stl_res_203754));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228131,
                                                        3, sizeof(j_m_i_204223),
                                                        &j_m_i_204223));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228131,
                                                        4,
                                                        sizeof(mem_231927.mem),
                                                        &mem_231927.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228131,
                                                        5,
                                                        sizeof(mem_231931.mem),
                                                        &mem_231931.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228131,
                                                        6,
                                                        sizeof(mem_231934.mem),
                                                        &mem_231934.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228131,
                                                        7,
                                                        sizeof(mem_231937.mem),
                                                        &mem_231937.mem));
                if (1 * ((size_t) segmap_usable_groups_228126 *
                         (size_t) segmap_group_sizze_228125) != 0) {
                    const size_t global_work_sizze_237697[1] =
                                 {(size_t) segmap_usable_groups_228126 *
                                 (size_t) segmap_group_sizze_228125};
                    const size_t local_work_sizze_237701[1] =
                                 {(size_t) segmap_group_sizze_228125};
                    int64_t time_start_237698 = 0, time_end_237699 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.segmap_228131",
                                global_work_sizze_237697[0],
                                local_work_sizze_237701[0], (int) 0);
                        time_start_237698 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_228131,
                                                                    1, NULL,
                                                                    global_work_sizze_237697,
                                                                    local_work_sizze_237701,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_228131_runs,
                                                                                                              &ctx->mainzisegmap_228131_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237699 = get_wall_time();
                        
                        long time_diff_237700 = time_end_237699 -
                             time_start_237698;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_228131", time_diff_237700);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_231927, "mem_231927") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231954, &mem_231931,
                                        "mem_231931") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231953, &mem_231934,
                                        "mem_231934") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231952, &mem_231937,
                                        "mem_231937") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231937, "mem_231937") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231934, "mem_231934") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231931, "mem_231931") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231927, "mem_231927") != 0)
                    return 1;
            } else {
                struct memblock_device mem_231941;
                
                mem_231941.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231941, bytes_229288,
                                          "mem_231941")) {
                    err = 1;
                    goto cleanup;
                }
                if (slt64(j_m_i_204223 * (int64_t) 2,
                          segred_group_sizze_228174)) {
                    int64_t segment_sizze_nonzzero_236691 = smax64((int64_t) 1,
                                                                   j_m_i_204223);
                    int64_t num_threads_236692 = num_groups_228175 *
                            segred_group_sizze_228174;
                    
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegRed-small");
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                (long long) partition_sizze_203667, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) j_m_i_204223, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segments_per_group",
                                (long long) squot64(segred_group_sizze_228174,
                                                    segment_sizze_nonzzero_236691),
                                '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "required_groups",
                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667,
                                                                   squot64(segred_group_sizze_228174,
                                                                           segment_sizze_nonzzero_236691))),
                                '\n');
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_228180,
                                                            1,
                                                            (size_t) ((int64_t) 8 *
                                                                      segred_group_sizze_228174),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_228180,
                                                            2, sizeof(n_203572),
                                                            &n_203572));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_228180,
                                                            3,
                                                            sizeof(partition_sizze_203667),
                                                            &partition_sizze_203667));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_228180,
                                                            4,
                                                            sizeof(stl_res_203754),
                                                            &stl_res_203754));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_228180,
                                                            5,
                                                            sizeof(j_m_i_204223),
                                                            &j_m_i_204223));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_228180,
                                                            6,
                                                            sizeof(num_groups_228175),
                                                            &num_groups_228175));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_228180,
                                                            7,
                                                            sizeof(segment_sizze_nonzzero_236691),
                                                            &segment_sizze_nonzzero_236691));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_228180,
                                                            8,
                                                            sizeof(ext_mem_231924.mem),
                                                            &ext_mem_231924.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_228180,
                                                            9,
                                                            sizeof(mem_231941.mem),
                                                            &mem_231941.mem));
                    if (1 * ((size_t) num_groups_228175 *
                             (size_t) segred_group_sizze_228174) != 0) {
                        const size_t global_work_sizze_237702[1] =
                                     {(size_t) num_groups_228175 *
                                     (size_t) segred_group_sizze_228174};
                        const size_t local_work_sizze_237706[1] =
                                     {(size_t) segred_group_sizze_228174};
                        int64_t time_start_237703 = 0, time_end_237704 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.segred_small_228180",
                                    global_work_sizze_237702[0],
                                    local_work_sizze_237706[0], (int) (0 +
                                                                       (int64_t) 8 *
                                                                       segred_group_sizze_228174));
                            time_start_237703 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegred_small_228180,
                                                                        1, NULL,
                                                                        global_work_sizze_237702,
                                                                        local_work_sizze_237706,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegred_small_228180_runs,
                                                                                                                  &ctx->mainzisegred_small_228180_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_237704 = get_wall_time();
                            
                            long time_diff_237705 = time_end_237704 -
                                 time_start_237703;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segred_small_228180",
                                    time_diff_237705);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                } else {
                    int64_t groups_per_segment_236718 =
                            sdiv_up64(num_groups_228175, smax64((int64_t) 1,
                                                                partition_sizze_203667));
                    int64_t elements_per_thread_236719 = sdiv_up64(j_m_i_204223,
                                                                   segred_group_sizze_228174 *
                                                                   groups_per_segment_236718);
                    int64_t virt_num_groups_236720 = groups_per_segment_236718 *
                            partition_sizze_203667;
                    int64_t num_threads_236721 = num_groups_228175 *
                            segred_group_sizze_228174;
                    int64_t threads_per_segment_236722 =
                            groups_per_segment_236718 *
                            segred_group_sizze_228174;
                    
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegRed-large");
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                (long long) partition_sizze_203667, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) j_m_i_204223, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "virt_num_groups",
                                (long long) virt_num_groups_236720, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                (long long) num_groups_228175, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "group_size",
                                (long long) segred_group_sizze_228174, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "elems_per_thread",
                                (long long) elements_per_thread_236719, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "groups_per_segment",
                                (long long) groups_per_segment_236718, '\n');
                    
                    struct memblock_device segred_tmp_mem_236723;
                    
                    segred_tmp_mem_236723.references = NULL;
                    if (memblock_alloc_device(ctx, &segred_tmp_mem_236723,
                                              (int64_t) 8 *
                                              virt_num_groups_236720,
                                              "segred_tmp_mem_236723")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mainzicounter_mem_236725 =
                                           ctx->mainzicounter_mem_236725;
                    
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228180,
                                                            1, (size_t) 1,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228180,
                                                            2,
                                                            (size_t) ((int64_t) 8 *
                                                                      segred_group_sizze_228174),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228180,
                                                            3, sizeof(n_203572),
                                                            &n_203572));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228180,
                                                            4,
                                                            sizeof(partition_sizze_203667),
                                                            &partition_sizze_203667));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228180,
                                                            5,
                                                            sizeof(stl_res_203754),
                                                            &stl_res_203754));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228180,
                                                            6,
                                                            sizeof(j_m_i_204223),
                                                            &j_m_i_204223));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228180,
                                                            7,
                                                            sizeof(num_groups_228175),
                                                            &num_groups_228175));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228180,
                                                            8,
                                                            sizeof(groups_per_segment_236718),
                                                            &groups_per_segment_236718));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228180,
                                                            9,
                                                            sizeof(elements_per_thread_236719),
                                                            &elements_per_thread_236719));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228180,
                                                            10,
                                                            sizeof(virt_num_groups_236720),
                                                            &virt_num_groups_236720));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228180,
                                                            11,
                                                            sizeof(threads_per_segment_236722),
                                                            &threads_per_segment_236722));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228180,
                                                            12,
                                                            sizeof(ext_mem_231924.mem),
                                                            &ext_mem_231924.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228180,
                                                            13,
                                                            sizeof(mem_231941.mem),
                                                            &mem_231941.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228180,
                                                            14,
                                                            sizeof(segred_tmp_mem_236723.mem),
                                                            &segred_tmp_mem_236723.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228180,
                                                            15,
                                                            sizeof(mainzicounter_mem_236725.mem),
                                                            &mainzicounter_mem_236725.mem));
                    if (1 * ((size_t) num_groups_228175 *
                             (size_t) segred_group_sizze_228174) != 0) {
                        const size_t global_work_sizze_237708[1] =
                                     {(size_t) num_groups_228175 *
                                     (size_t) segred_group_sizze_228174};
                        const size_t local_work_sizze_237712[1] =
                                     {(size_t) segred_group_sizze_228174};
                        int64_t time_start_237709 = 0, time_end_237710 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.segred_large_228180",
                                    global_work_sizze_237708[0],
                                    local_work_sizze_237712[0], (int) (0 + 1 +
                                                                       (int64_t) 8 *
                                                                       segred_group_sizze_228174));
                            time_start_237709 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegred_large_228180,
                                                                        1, NULL,
                                                                        global_work_sizze_237708,
                                                                        local_work_sizze_237712,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegred_large_228180_runs,
                                                                                                                  &ctx->mainzisegred_large_228180_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_237710 = get_wall_time();
                            
                            long time_diff_237711 = time_end_237710 -
                                 time_start_237709;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segred_large_228180",
                                    time_diff_237711);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &segred_tmp_mem_236723,
                                              "segred_tmp_mem_236723") != 0)
                        return 1;
                }
                
                int64_t segmap_usable_groups_228188 =
                        sdiv_up64(partition_sizze_203667,
                                  segmap_group_sizze_228187);
                struct memblock_device mem_231945;
                
                mem_231945.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231945, bytes_229288,
                                          "mem_231945")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_231948;
                
                mem_231948.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231948, bytes_229288,
                                          "mem_231948")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_231951;
                
                mem_231951.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231951, bytes_229288,
                                          "mem_231951")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228193,
                                                        1,
                                                        sizeof(partition_sizze_203667),
                                                        &partition_sizze_203667));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228193,
                                                        2,
                                                        sizeof(mem_231941.mem),
                                                        &mem_231941.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228193,
                                                        3,
                                                        sizeof(mem_231945.mem),
                                                        &mem_231945.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228193,
                                                        4,
                                                        sizeof(mem_231948.mem),
                                                        &mem_231948.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228193,
                                                        5,
                                                        sizeof(mem_231951.mem),
                                                        &mem_231951.mem));
                if (1 * ((size_t) segmap_usable_groups_228188 *
                         (size_t) segmap_group_sizze_228187) != 0) {
                    const size_t global_work_sizze_237713[1] =
                                 {(size_t) segmap_usable_groups_228188 *
                                 (size_t) segmap_group_sizze_228187};
                    const size_t local_work_sizze_237717[1] =
                                 {(size_t) segmap_group_sizze_228187};
                    int64_t time_start_237714 = 0, time_end_237715 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.segmap_228193",
                                global_work_sizze_237713[0],
                                local_work_sizze_237717[0], (int) 0);
                        time_start_237714 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_228193,
                                                                    1, NULL,
                                                                    global_work_sizze_237713,
                                                                    local_work_sizze_237717,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_228193_runs,
                                                                                                              &ctx->mainzisegmap_228193_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237715 = get_wall_time();
                        
                        long time_diff_237716 = time_end_237715 -
                             time_start_237714;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_228193", time_diff_237716);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_231941, "mem_231941") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231954, &mem_231945,
                                        "mem_231945") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231953, &mem_231948,
                                        "mem_231948") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231952, &mem_231951,
                                        "mem_231951") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231951, "mem_231951") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231948, "mem_231948") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231945, "mem_231945") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231941, "mem_231941") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &ext_mem_231924, "ext_mem_231924") !=
                0)
                return 1;
            
            int64_t segmap_group_sizze_228274;
            
            segmap_group_sizze_228274 =
                *ctx->tuning_params.mainzisegmap_group_sizze_228214;
            
            int64_t segmap_usable_groups_228275 = sdiv_up64(nest_sizze_207090,
                                                            segmap_group_sizze_228274);
            struct memblock_device mem_231959;
            
            mem_231959.references = NULL;
            if (memblock_alloc_device(ctx, &mem_231959, bytes_229285,
                                      "mem_231959")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228279, 1,
                                                    sizeof(n_203572),
                                                    &n_203572));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228279, 2,
                                                    sizeof(partition_sizze_203667),
                                                    &partition_sizze_203667));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228279, 3,
                                                    sizeof(ext_mem_231668.mem),
                                                    &ext_mem_231668.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228279, 4,
                                                    sizeof(ext_mem_231952.mem),
                                                    &ext_mem_231952.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228279, 5,
                                                    sizeof(ext_mem_231953.mem),
                                                    &ext_mem_231953.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228279, 6,
                                                    sizeof(ext_mem_231954.mem),
                                                    &ext_mem_231954.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228279, 7,
                                                    sizeof(mem_231959.mem),
                                                    &mem_231959.mem));
            if (1 * ((size_t) segmap_usable_groups_228275 *
                     (size_t) segmap_group_sizze_228274) != 0) {
                const size_t global_work_sizze_237718[1] =
                             {(size_t) segmap_usable_groups_228275 *
                             (size_t) segmap_group_sizze_228274};
                const size_t local_work_sizze_237722[1] =
                             {(size_t) segmap_group_sizze_228274};
                int64_t time_start_237719 = 0, time_end_237720 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                            "main.segmap_228279", global_work_sizze_237718[0],
                            local_work_sizze_237722[0], (int) 0);
                    time_start_237719 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_228279,
                                                                1, NULL,
                                                                global_work_sizze_237718,
                                                                local_work_sizze_237722,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_228279_runs,
                                                                                                          &ctx->mainzisegmap_228279_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_237720 = get_wall_time();
                    
                    long time_diff_237721 = time_end_237720 - time_start_237719;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_228279", time_diff_237721);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_unref_device(ctx, &ext_mem_231668, "ext_mem_231668") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231952, "ext_mem_231952") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231953, "ext_mem_231953") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231954, "ext_mem_231954") !=
                0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_231960, &mem_231959,
                                    "mem_231959") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_231959, "mem_231959") != 0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231952, "ext_mem_231952") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231953, "ext_mem_231953") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231954, "ext_mem_231954") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231924, "ext_mem_231924") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231668, "ext_mem_231668") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231669, "ext_mem_231669") !=
                0)
                return 1;
        } else {
            if (memblock_set_device(ctx, &ext_mem_231960, &mem_param_229601,
                                    "mem_param_229601") != 0)
                return 1;
        }
        
        int64_t ctx_param_ext_tmp_232965 = ext_231632;
        int64_t ctx_param_ext_tmp_232966 = ext_231630;
        int64_t ctx_param_ext_tmp_232967 = ext_231965;
        int64_t ctx_param_ext_tmp_232968 = ext_231964;
        int64_t ctx_param_ext_tmp_232969 = ext_231961;
        int64_t ctx_param_ext_tmp_232970 = ext_231963;
        int64_t ctx_param_ext_tmp_232971 = ext_231967;
        int64_t ctx_param_ext_tmp_232972 = ext_231962;
        int64_t ctx_param_ext_tmp_232973 = ext_231966;
        struct memblock_device mem_param_tmp_232974;
        
        mem_param_tmp_232974.references = NULL;
        if (memblock_set_device(ctx, &mem_param_tmp_232974, &ext_mem_231626,
                                "ext_mem_231626") != 0)
            return 1;
        
        struct memblock_device mem_param_tmp_232975;
        
        mem_param_tmp_232975.references = NULL;
        if (memblock_set_device(ctx, &mem_param_tmp_232975, &ext_mem_231625,
                                "ext_mem_231625") != 0)
            return 1;
        
        struct memblock_device mem_param_tmp_232976;
        
        mem_param_tmp_232976.references = NULL;
        if (memblock_set_device(ctx, &mem_param_tmp_232976, &ext_mem_231960,
                                "ext_mem_231960") != 0)
            return 1;
        ctx_param_ext_229587 = ctx_param_ext_tmp_232965;
        ctx_param_ext_229589 = ctx_param_ext_tmp_232966;
        ctx_param_ext_229594 = ctx_param_ext_tmp_232967;
        ctx_param_ext_229595 = ctx_param_ext_tmp_232968;
        ctx_param_ext_229596 = ctx_param_ext_tmp_232969;
        ctx_param_ext_229597 = ctx_param_ext_tmp_232970;
        ctx_param_ext_229598 = ctx_param_ext_tmp_232971;
        ctx_param_ext_229599 = ctx_param_ext_tmp_232972;
        ctx_param_ext_229600 = ctx_param_ext_tmp_232973;
        if (memblock_set_device(ctx, &mem_param_229585, &mem_param_tmp_232974,
                                "mem_param_tmp_232974") != 0)
            return 1;
        if (memblock_set_device(ctx, &mem_param_229593, &mem_param_tmp_232975,
                                "mem_param_tmp_232975") != 0)
            return 1;
        if (memblock_set_device(ctx, &mem_param_229601, &mem_param_tmp_232976,
                                "mem_param_tmp_232976") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_tmp_232976,
                                  "mem_param_tmp_232976") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_tmp_232975,
                                  "mem_param_tmp_232975") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_tmp_232974,
                                  "mem_param_tmp_232974") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231960, "ext_mem_231960") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229623, "mem_param_229623") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229615, "mem_param_229615") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231625, "ext_mem_231625") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231626, "ext_mem_231626") != 0)
            return 1;
    }
    ext_231983 = ctx_param_ext_229587;
    ext_231981 = ctx_param_ext_229589;
    ext_231977 = ctx_param_ext_229594;
    ext_231976 = ctx_param_ext_229595;
    ext_231975 = ctx_param_ext_229596;
    ext_231974 = ctx_param_ext_229597;
    ext_231973 = ctx_param_ext_229598;
    ext_231972 = ctx_param_ext_229599;
    ext_231971 = ctx_param_ext_229600;
    if (memblock_set_device(ctx, &ext_mem_231970, &mem_param_229585,
                            "mem_param_229585") != 0)
        return 1;
    if (memblock_set_device(ctx, &ext_mem_231969, &mem_param_229593,
                            "mem_param_229593") != 0)
        return 1;
    if (memblock_set_device(ctx, &ext_mem_231968, &mem_param_229601,
                            "mem_param_229601") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229628, "mem_229628") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229634, "mem_229634") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229639, "mem_229639") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230608, "mem_230608") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230625, "mem_230625") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230642, "mem_230642") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230659, "mem_230659") != 0)
        return 1;
    
    struct memblock_device mem_231995;
    
    mem_231995.references = NULL;
    if (memblock_alloc_device(ctx, &mem_231995, bytes_229268, "mem_231995")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhreplicate_f64(ctx, mem_231995, m_203571 * n_203572,
                                      NAN) != 0) {
        if (memblock_unref_device(ctx, &mem_231995, "mem_231995") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229601, "mem_param_229601") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229593, "mem_param_229593") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229585, "mem_param_229585") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231968, "ext_mem_231968") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231969, "ext_mem_231969") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231970, "ext_mem_231970") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230659, "mem_230659") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230642, "mem_230642") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230625, "mem_230625") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230608, "mem_230608") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229639, "mem_229639") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229634, "mem_229634") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229628, "mem_229628") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_231999;
    
    mem_231999.references = NULL;
    if (memblock_alloc_device(ctx, &mem_231999, bytes_229268, "mem_231999")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhreplicate_f64(ctx, mem_231999, m_203571 * n_203572,
                                      NAN) != 0) {
        if (memblock_unref_device(ctx, &mem_231999, "mem_231999") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231995, "mem_231995") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229601, "mem_param_229601") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229593, "mem_param_229593") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229585, "mem_param_229585") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231968, "ext_mem_231968") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231969, "ext_mem_231969") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231970, "ext_mem_231970") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230659, "mem_230659") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230642, "mem_230642") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230625, "mem_230625") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230608, "mem_230608") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229639, "mem_229639") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229634, "mem_229634") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229628, "mem_229628") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_232003;
    
    mem_232003.references = NULL;
    if (memblock_alloc_device(ctx, &mem_232003, bytes_229268, "mem_232003")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhreplicate_f64(ctx, mem_232003, m_203571 * n_203572,
                                      NAN) != 0) {
        if (memblock_unref_device(ctx, &mem_232003, "mem_232003") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231999, "mem_231999") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231995, "mem_231995") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229601, "mem_param_229601") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229593, "mem_param_229593") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229585, "mem_param_229585") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231968, "ext_mem_231968") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231969, "ext_mem_231969") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231970, "ext_mem_231970") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230659, "mem_230659") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230642, "mem_230642") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230625, "mem_230625") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230608, "mem_230608") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229639, "mem_229639") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229634, "mem_229634") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229628, "mem_229628") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t segmap_group_sizze_228305;
    
    segmap_group_sizze_228305 =
        *ctx->tuning_params.mainzisegmap_group_sizze_228304;
    
    int64_t num_groups_228307;
    int32_t max_num_groups_236778;
    
    max_num_groups_236778 = *ctx->tuning_params.mainzisegmap_num_groups_228306;
    num_groups_228307 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(partition_sizze_203667,
                                                             segmap_group_sizze_228305),
                                                   sext_i32_i64(max_num_groups_236778))));
    
    struct memblock_device mem_232006;
    
    mem_232006.references = NULL;
    if (memblock_alloc_device(ctx, &mem_232006, binop_y_229284, "mem_232006")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_232006, (int64_t) 0,
                                              ext_mem_231970, (int64_t) 0,
                                              (int64_t) 1, n_203572,
                                              partition_sizze_203667) != 0) {
        if (memblock_unref_device(ctx, &mem_232006, "mem_232006") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_232003, "mem_232003") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231999, "mem_231999") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231995, "mem_231995") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229601, "mem_param_229601") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229593, "mem_param_229593") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229585, "mem_param_229585") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231968, "ext_mem_231968") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231969, "ext_mem_231969") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231970, "ext_mem_231970") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230659, "mem_230659") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230642, "mem_230642") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230625, "mem_230625") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230608, "mem_230608") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229639, "mem_229639") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229634, "mem_229634") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229628, "mem_229628") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    if (memblock_unref_device(ctx, &ext_mem_231970, "ext_mem_231970") != 0)
        return 1;
    
    struct memblock_device mem_232009;
    
    mem_232009.references = NULL;
    if (memblock_alloc_device(ctx, &mem_232009, binop_y_229284, "mem_232009")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_232009, (int64_t) 0,
                                              ext_mem_231969, (int64_t) 0,
                                              (int64_t) 1, n_203572,
                                              partition_sizze_203667) != 0) {
        if (memblock_unref_device(ctx, &mem_232009, "mem_232009") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_232006, "mem_232006") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_232003, "mem_232003") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231999, "mem_231999") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231995, "mem_231995") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229601, "mem_param_229601") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229593, "mem_param_229593") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229585, "mem_param_229585") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231968, "ext_mem_231968") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231969, "ext_mem_231969") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231970, "ext_mem_231970") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230659, "mem_230659") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230642, "mem_230642") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230625, "mem_230625") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230608, "mem_230608") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229639, "mem_229639") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229634, "mem_229634") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229628, "mem_229628") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    if (memblock_unref_device(ctx, &ext_mem_231969, "ext_mem_231969") != 0)
        return 1;
    
    int64_t num_threads_232357 = segmap_group_sizze_228305 * num_groups_228307;
    int64_t total_sizze_232358 = bytes_229277 * num_threads_232357;
    struct memblock_device color_232194;
    
    color_232194.references = NULL;
    if (memblock_alloc_device(ctx, &color_232194, total_sizze_232358,
                              "color_232194")) {
        err = 1;
        goto cleanup;
    }
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "\n# SegMap");
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228302, 1,
                                            sizeof(m_203571), &m_203571));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228302, 2,
                                            sizeof(n_203572), &n_203572));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228302, 3,
                                            sizeof(partition_sizze_203667),
                                            &partition_sizze_203667));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228302, 4,
                                            sizeof(num_groups_228307),
                                            &num_groups_228307));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228302, 5,
                                            sizeof(num_threads_232357),
                                            &num_threads_232357));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228302, 6,
                                            sizeof(mem_229269.mem),
                                            &mem_229269.mem));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228302, 7,
                                            sizeof(mem_229272.mem),
                                            &mem_229272.mem));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228302, 8,
                                            sizeof(mem_231995.mem),
                                            &mem_231995.mem));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228302, 9,
                                            sizeof(mem_231999.mem),
                                            &mem_231999.mem));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228302, 10,
                                            sizeof(mem_232003.mem),
                                            &mem_232003.mem));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228302, 11,
                                            sizeof(mem_232006.mem),
                                            &mem_232006.mem));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228302, 12,
                                            sizeof(mem_232009.mem),
                                            &mem_232009.mem));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228302, 13,
                                            sizeof(color_232194.mem),
                                            &color_232194.mem));
    if (1 * ((size_t) num_groups_228307 * (size_t) segmap_group_sizze_228305) !=
        0) {
        const size_t global_work_sizze_237723[1] = {(size_t) num_groups_228307 *
                     (size_t) segmap_group_sizze_228305};
        const size_t local_work_sizze_237727[1] =
                     {(size_t) segmap_group_sizze_228305};
        int64_t time_start_237724 = 0, time_end_237725 = 0;
        
        if (ctx->debugging) {
            fprintf(ctx->log,
                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                    "main.segmap_228302", global_work_sizze_237723[0],
                    local_work_sizze_237727[0], (int) 0);
            time_start_237724 = get_wall_time();
        }
        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                        ctx->mainzisegmap_228302,
                                                        1, NULL,
                                                        global_work_sizze_237723,
                                                        local_work_sizze_237727,
                                                        0, NULL,
                                                        ctx->profiling_paused ||
                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                  &ctx->mainzisegmap_228302_runs,
                                                                                                  &ctx->mainzisegmap_228302_total_runtime)));
        if (ctx->debugging) {
            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
            time_end_237725 = get_wall_time();
            
            long time_diff_237726 = time_end_237725 - time_start_237724;
            
            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                    "main.segmap_228302", time_diff_237726);
        }
    }
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "");
    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_232006, "mem_232006") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_232009, "mem_232009") != 0)
        return 1;
    if (memblock_unref_device(ctx, &color_232194, "color_232194") != 0)
        return 1;
    if (memblock_set_device(ctx, &mem_out_232359, &mem_231995, "mem_231995") !=
        0)
        return 1;
    if (memblock_set_device(ctx, &mem_out_232360, &mem_231999, "mem_231999") !=
        0)
        return 1;
    if (memblock_set_device(ctx, &mem_out_232361, &mem_232003, "mem_232003") !=
        0)
        return 1;
    (*mem_out_p_236847).references = NULL;
    if (memblock_set_device(ctx, &*mem_out_p_236847, &mem_out_232359,
                            "mem_out_232359") != 0)
        return 1;
    (*mem_out_p_236848).references = NULL;
    if (memblock_set_device(ctx, &*mem_out_p_236848, &mem_out_232360,
                            "mem_out_232360") != 0)
        return 1;
    (*mem_out_p_236849).references = NULL;
    if (memblock_set_device(ctx, &*mem_out_p_236849, &mem_out_232361,
                            "mem_out_232361") != 0)
        return 1;
    if (memblock_unref_device(ctx, &color_232194, "color_232194") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_232009, "mem_232009") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_232006, "mem_232006") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_232003, "mem_232003") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_231999, "mem_231999") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_231995, "mem_231995") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_param_229601, "mem_param_229601") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_param_229593, "mem_param_229593") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_param_229585, "mem_param_229585") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_231968, "ext_mem_231968") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_231969, "ext_mem_231969") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_231970, "ext_mem_231970") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230659, "mem_230659") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230642, "mem_230642") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230625, "mem_230625") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230608, "mem_230608") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229639, "mem_229639") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229634, "mem_229634") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229628, "mem_229628") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
        return 1;
    if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
        return 1;
    
  cleanup:
    { }
    return err;
}

int futhark_entry_main(struct futhark_context *ctx,
                       struct futhark_f64_2d **out0,
                       struct futhark_f64_2d **out1,
                       struct futhark_f64_2d **out2, const
                       struct futhark_f64_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, const int64_t in12, const int64_t in13,
                       const int64_t in14)
{
    struct memblock_device Y_mem_229239;
    
    Y_mem_229239.references = NULL;
    
    int64_t m_203571;
    int64_t n_203572;
    int64_t n_p_203574;
    int64_t q_s_203575;
    int64_t q_t_203576;
    int64_t q_l_203577;
    int64_t d_s_203578;
    int64_t d_t_203579;
    int64_t d_l_203580;
    int64_t jump_s_203581;
    int64_t jump_t_203582;
    int64_t jump_l_203583;
    int64_t n_inner_203584;
    int64_t n_outer_203585;
    int64_t jump_threshold_203586;
    int64_t q_threshold_203587;
    struct memblock_device mem_out_232359;
    
    mem_out_232359.references = NULL;
    
    struct memblock_device mem_out_232360;
    
    mem_out_232360.references = NULL;
    
    struct memblock_device mem_out_232361;
    
    mem_out_232361.references = NULL;
    
    int ret = 0;
    
    lock_lock(&ctx->lock);
    Y_mem_229239 = in0->mem;
    m_203571 = in0->shape[0];
    n_203572 = in0->shape[1];
    n_p_203574 = in1;
    q_s_203575 = in2;
    q_t_203576 = in3;
    q_l_203577 = in4;
    d_s_203578 = in5;
    d_t_203579 = in6;
    d_l_203580 = in7;
    jump_s_203581 = in8;
    jump_t_203582 = in9;
    jump_l_203583 = in10;
    n_inner_203584 = in11;
    n_outer_203585 = in12;
    jump_threshold_203586 = in13;
    q_threshold_203587 = in14;
    if (!(m_203571 == in0->shape[0] && n_203572 == in0->shape[1])) {
        ret = 1;
        if (!ctx->error)
            ctx->error =
                msgprintf("Error: entry point arguments have invalid sizes.\n");
    }
    if (ret == 0) {
        ret = futrts_entry_main(ctx, &mem_out_232359, &mem_out_232360,
                                &mem_out_232361, Y_mem_229239, m_203571,
                                n_203572, n_p_203574, q_s_203575, q_t_203576,
                                q_l_203577, d_s_203578, d_t_203579, d_l_203580,
                                jump_s_203581, jump_t_203582, jump_l_203583,
                                n_inner_203584, n_outer_203585,
                                jump_threshold_203586, q_threshold_203587);
        if (ret == 0) {
            assert((*out0 =
                    (struct futhark_f64_2d *) malloc(sizeof(struct futhark_f64_2d))) !=
                NULL);
            (*out0)->mem = mem_out_232359;
            (*out0)->shape[0] = m_203571;
            (*out0)->shape[1] = n_203572;
            assert((*out1 =
                    (struct futhark_f64_2d *) malloc(sizeof(struct futhark_f64_2d))) !=
                NULL);
            (*out1)->mem = mem_out_232360;
            (*out1)->shape[0] = m_203571;
            (*out1)->shape[1] = n_203572;
            assert((*out2 =
                    (struct futhark_f64_2d *) malloc(sizeof(struct futhark_f64_2d))) !=
                NULL);
            (*out2)->mem = mem_out_232361;
            (*out2)->shape[0] = m_203571;
            (*out2)->shape[1] = n_203572;
        }
    }
    lock_unlock(&ctx->lock);
    return ret;
}
  
